@schift-io/workflow-dify
v0.1.0
Published
Project Schift Workflow v2 artifacts into Dify workflow export graphs.
Readme
@schift-io/workflow-dify
Project a Workflow v2 artifact into a Dify workflow DSL export.
import { WorkspaceClient } from "@schift-io/sdk";
import { analyzeDifyLoss, asDify, fromDify } from "@schift-io/workflow-dify";
const client = new WorkspaceClient({ apiKey: process.env.SCHIFT_API_KEY! });
const wf = client.workflow({ yaml });
const difyExport = await asDify(wf);
const workflowV2 = fromDify(difyExport);
const losses = analyzeDifyLoss(difyExport);asDify() is a projection layer. It does not execute Dify plugins or call a
Dify server. Existing Dify raw node config in Workflow v2 config.raw is
preserved where available; Dify app/workflow metadata under metadata.dify is
carried back into the export envelope. Otherwise the adapter emits the nearest
Dify node shape from canonical Workflow v2 block types.
fromDify() converts a Dify workflow DSL object into canonical Workflow v2 JSON
locally, without calling the hosted platform. Mapped Dify nodes with runtime/plugin
semantics outside the canonical IR are reported by analyzeDifyLoss() and
preserved under metadata.dify.losses.
