主题
save_workflow_preset
POST /workflow/presets/save
口径:本页参数表最后核对于 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 传 preset 名称直接执行。
保存前会校验步骤:动作必须在白名单内、必填参数不能缺失、if/for 结构必须正确。校验不通过会直接报错,不会写入。
请求参数
| 参数 | 必填 | 说明 |
|---|---|---|
name | 是 | 预设名,1-64 个字符,只允许字母、数字、点、横线和下划线 |
steps | 是 | 步骤数组,写法与 POST /workflow/run 一致 |
inputs | 否 | 预设的默认变量表 |
description | 否 | 说明文字 |
示例
json
{
"name": "image_caption",
"description": "封面加标题",
"inputs": {
"cover": "https://example.com/default.png",
"title": "默认标题"
},
"steps": [
{"id": "create", "action": "create_draft", "params": {}},
{"id": "img", "action": "add_image",
"params": {"image_url": "${cover}", "start": 0, "end": 5}},
{"id": "text", "action": "add_text",
"params": {"text": "${title}", "start": 0, "end": 5}}
]
}返回:
json
{
"success": true,
"output": {
"name": "image_caption",
"description": "封面加标题",
"input_names": ["cover", "title"],
"step_count": 3,
"updated_at": "2026-01-01T00:00:00Z"
},
"error": ""
}同名预设会被覆盖。预设数量上限为 200 个。