scenario-workflow-authoring
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScenario Workflow Authoring
Scenario 工作流创作
Overview
概述
A workflow has two representations: (the editable node graph: , , ) and (the compiled runnable form). Authoring through MCP means writing the whole document: there are no per-node editing tools; every change is a read, modify, write of the full graph through or . Never hand-write : compiles into it and flips status to . Editing a ready workflow's leaves the stale running until you publish again.
editor_infonodesedgesinputKeysfloweditor_infoworkflow_createworkflow_updateflowworkflow_publisheditor_inforeadyeditor_infoflowRead references/editor-info.md before writing any graph: it holds the node type vocabulary, the node choice doctrine (when an node is legitimate), the edge direction rule, per-node data contracts, and a validated minimal example. Create, update, publish, copy and delete live in the tool catalog ( plus the matching executor, see the skill). , and are direct tools: scope and go in their top-level arguments, never an executor wrapper. Running and pricing: the skill. If a sibling skill named here is missing from your available skills, ask the user to install it (); unattended, proceed from tool schemas and flag the gap.
llmscenario_tools_searchscenarioworkflows_listworkflow_getworkflow_rundry_runscenario-workflowsnpx skills add scenario-labs/skills --skill <name>工作流有两种表现形式:(可编辑的节点图,包含、、)和(编译后的可运行形式)。通过MCP进行创作意味着编写完整的文档:没有单节点编辑工具;每次修改都是通过或对完整图进行读取、修改、写入的操作。切勿手动编写:会将编译为并将状态切换为。编辑已就绪工作流的后,旧的仍会继续运行,直到你重新发布。
editor_infonodesedgesinputKeysfloweditor_infoworkflow_createworkflow_updateflowworkflow_publisheditor_infoflowreadyeditor_infoflow在编写任何图之前,请先阅读references/editor-info.md:该文档包含节点类型词汇表、节点选择原则(何时使用节点是合理的)、边的方向规则、各节点的数据契约,以及一个经过验证的最小示例。创建、更新、发布、复制和删除操作位于工具目录中(加上对应的执行器,参见技能)。、和是直接工具:scope和放在它们的顶层参数中,切勿使用执行器包装。运行和定价相关内容请参考技能。如果你的可用技能中缺少此处提到的同级技能,请让用户安装(命令:);如果处于无人值守模式,请根据工具模式继续操作并标记缺失的技能。
llmscenario_tools_searchscenarioworkflows_listworkflow_getworkflow_rundry_runscenario-workflowsnpx skills add scenario-labs/skills --skill <name>Quick reference
快速参考
| Step | Call | Notes |
|---|---|---|
| 1. Study a graph | | Copy the shape, never ids |
| 2. Model contract | | Handle names and required inputs |
| 3. Author | | Per the reference file |
| 4. Create | | Non-atomic, see below |
| 5. Publish | | Compiles |
| 6. Validate | | Prices and runs the real validator |
workflow_createworkflow_updateworkflow_getworkflows_listsearchtarget="workflows"public=truequerylimit=3query="image"filter: 'status = "ready"'workflowsworkflow_getworkflows_list| 步骤 | 调用方式 | 说明 |
|---|---|---|
| 1. 研究参考图 | 对可用工作流调用 | 复制结构,切勿复制ID |
| 2. 模型契约 | | 处理名称和必填输入 |
| 3. 创作 | | 遵循参考文档要求 |
| 4. 创建 | | 非原子操作,见下文 |
| 5. 发布 | | 编译 |
| 6. 验证 | 带 | 进行定价并运行真实验证器 |
workflow_createworkflow_updateworkflow_getworkflows_listsearchtarget="workflows"public=truequerylimit=3query="image"filter: 'status = "ready"'workflowsworkflow_getworkflows_listWorked example: a text-to-image app
示例:文本生成图像应用
- with
recommendand the user's brief ascapability: "txt2img", following thepromptskill'sscenariodiscipline, thennext_step: its input names become the model node's handle names, and itsmodel_schema_getflag marks what must be wired. Userequiredinstead when the user names a model.search - Author :
editor_infowithtext1,data.isInput: truewithmodel1,type: "model"anddata.modelId, one edge fromdata.isOutput: true's input tomodel1's output (edges name the downstream node astext1, see the reference),source.inputKeys: ["text1"] - with
workflow_create,name, andeditor_infonaminginputs_definitionas a string input. The published input key is the node id, which is why run inputs have names liketext1.text1 - , then
workflow_publishwithworkflow_runto validate and price. Fix the graph and re-publish if validation fails.dry_run=true
- 调用,设置
recommend,将用户的需求简报作为capability: "txt2img",遵循prompt技能的scenario规范,然后调用next_step:它的输入名称将成为模型节点的句柄名称,其model_schema_get标记会标明哪些必须连接。如果用户指定了模型名称,则改用required。search - 编写:
editor_info节点设置text1,data.isInput: true节点设置model1、type: "model"和data.modelId,添加一条从data.isOutput: true的输入到model1的输出的边(边将下游节点记为text1,参见参考文档),设置source。inputKeys: ["text1"] - 调用,传入
workflow_create、name,以及将editor_info列为字符串输入的text1。发布后的输入键就是节点ID,这就是运行时输入名称类似inputs_definition的原因。text1 - 调用,然后使用
workflow_publish调用dry_run=true进行验证和定价。如果验证失败,请修复图并重新发布。workflow_run
Migrating a graph from another node tool
从其他节点工具迁移图
A pipeline exported by Weavy, ComfyUI, or another node editor does not import: only Scenario's own export round-trips. It is translated node by node, then created, published, and dry-run as above. The mapping table, member resolution, and the report the user gets are in references/foreign-graph-import.md; read it before touching such an export, since its first rule is to reduce the file to a table locally rather than paste it into the conversation.
Weavy、ComfyUI或其他节点编辑器导出的流水线无法直接导入:只有Scenario自身的导出格式支持往返导入。需要逐节点进行转换,然后按照上述步骤创建、发布并试运行。映射表、成员解析以及用户会收到的报告都在references/foreign-graph-import.md中;在处理此类导出文件之前请先阅读该文档,因为它的第一条规则是先在本地将文件整理为表格,而不是直接粘贴到对话中。
Common mistakes
常见错误
- Writing UI palette names as node types: persisted types are the camelCase vocabulary in the reference, and every generator is .
type: "model" - Wiring edges producer to consumer: persisted edges point the other way.
- Expecting an update to change a live app without re-publishing.
editor_info - Retrying a failed with a second create instead of
workflow_createon the id from the error.workflow_update - Publishing with no pins: at least one node listed in
data.isInputand oneinputKeysnode.data.isOutput - Gating a text node in front of a builder or model: a branch skips only the node wired to its handle, so the consumer stays pending and the job never completes. Gate the node that does the work, or use a CEL ternary for conditional prompt text, per the reference's section.
ifElse - Double-quoted CEL literals: they evaluate but corrupt the canvas editor, single quotes only.
- Sending to
workflow_id: get, update, publish, run and delete takeworkflow_copy, but copy takesworkflow_id; the copy inherits everything verbatim and needs its own publish.source_workflow_id
- 将UI面板名称当作节点类型:持久化的类型是参考文档中的驼峰命名词汇,所有生成器的类型都是。
type: "model" - 错误地将边从生产者连接到消费者:持久化存储的边方向相反。
- 以为更新就能修改已上线的应用,而不需要重新发布。
editor_info - 失败的重试时再次调用创建接口,而不是使用错误信息中的ID调用
workflow_create。workflow_update - 发布时没有引脚:至少需要有一个列在中的
inputKeys节点,以及一个data.isInput节点。data.isOutput - 在构建器或模型前面的文本节点上设置门控:分支只会跳过连接到其句柄的节点,因此消费者会一直处于待处理状态,任务永远不会完成。应该在执行实际工作的节点上设置门控,或者根据参考文档的部分,使用CEL三元表达式实现提示词文本的条件判断。
ifElse - CEL字面量使用双引号:双引号虽然能正常求值,但会损坏画布编辑器,请仅使用单引号。
- 向传入
workflow_copy:获取、更新、发布、运行和删除操作使用workflow_id,但复制操作使用的是workflow_id;副本会原样继承所有内容,需要单独发布。",source_workflow_id