create_workflow
Build deterministic, resumable DAG workflows from named steps with dependencies, boolean gates, and sandboxed auto-agent execution, validating structure and cycles on creation.
Instructions
新建工作流。steps 为数组,每项 {id?, title, instruction?, dependsOn?, gate?, mode?, agentPrompt?, model?, timeoutMs?, maxRetries?, tools?, maxTurns?, outputSchema?, verify?, sandboxCwd?};gate 是布尔表达式(支持 && || ! 和括号),只允许引用该步骤的直接依赖,依赖落定后求值为假则该步骤被自动跳过。mode=auto 的步骤可被 run_workflow 自动执行:每个 auto 步骤由服务器内 agent 循环驱动(多轮工具调用:读/写文件、列目录、grep、bash、fetch_url,全部限定在 sandboxCwd 沙箱内);tools 为该步工具白名单,maxTurns 为循环轮数上限(默认取 WORKFLOW_MAX_TURNS,8),outputSchema 为结果 JSON Schema(不符自动重试一轮),verify 为完成后的质量关(JS 布尔断言或 reviewer 提示词),sandboxCwd 覆盖该步沙箱目录。顶层 finalVerify(提示词)在全部步骤落定后做整体一致性检查。创建时即做结构、环与 id 合法性校验。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"steps": "<steps>"
},
"name": "create_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 工作流名称(用于生成 id,非唯一) | |
| steps | Yes | ||
| description | No | 目标/总纲,一句话 | |
| finalVerify | No | 流程级整体一致性检查提示词;全部步骤落定后由模型审核,结论记入 flow.finalVerifyResult(不改步骤状态) |