Skip to content

workflow_validate ​

POST /workflow/validate

口径:本页参数表最后核对于 v23.9(2026-10-27)。v24.0~v24.8 的改动(add_video 的 timeline_start/timeline_end 别名、apply_edl 批内失败计数、resource/search 的 limit 与 count 等价、/agent/route 类型分诊等)以 llms-full.txt 与 GET /agent/capabilities 为准。

接口说明 ​

只校验工作流结构,不执行任何动作,不创建草稿。适合大模型在真正运行前先自检一遍。

请求参数 ​

与 POST /workflow/run 相同,传 steps 和可选的 inputs。

示例 ​

json
{
  "steps": [
    {"id": "create", "action": "create_draft", "params": {"width": 1080}},
    {"id": "img", "action": "add_image", "params": {"image_url": "https://example.com/a.png", "start": 0, "end": 5}}
  ]
}

返回:

json
{
  "success": true,
  "output": {
    "valid": true,
    "step_count": 2,
    "action_count": 2,
    "actions": ["create_draft", "add_image"],
    "errors": [],
    "warnings": [],
    "limits": {"max_steps": 300, "max_loop_iterations": 200, "max_total_iterations": 2000, "timeout_seconds": 180}
  },
  "error": ""
}

校验内容 ​

  • 步骤必须是对象,action 必须在白名单内。
  • params 必须是对象或合法的 JSON 字符串。
  • 检查每个动作的必填参数是否缺失。
  • 检查 ${...} 引用的名称是否已声明;未声明的引用会放进 warnings。
  • 检查 if、for 的结构是否正确。

errors 非空时 valid 为 false,此时不要执行 POST /workflow/run。

个人自建服务