API 参考 / workflow-config

发布草稿为不可变版本

POST /api/v1/projects/{projectId}/workflows/{templateId}/draft/publish · publishWorkflowDraft

验证草稿后冻结为 published 状态(status=published,之后不可再修改)。 bindTypes 非空时同步将这些工作项类型绑定到新版本。需 manage_workflows。

鉴权:项目 API Token(Authorization: Bearer wfp_…)。详见 Agent 接入。

参数

projectId(必填)
string
templateId(必填)
string

请求体

bindTypes
string[]

响应字段 · 200

id(必填)
string
projectId(必填)
string
templateId(必填)
string
versionNo(必填)
integer
status(必填)
enum;取值:draft / published / archived
changeNote
string
publishedAt
string
publishedBy
string
createdAt(必填)
string
updatedAt(必填)
string

错误

请求示例(curl)

curl -X POST "https://你的项目.workflow.games/api/v1/projects/{projectId}/workflows/{templateId}/draft/publish" \
  -H "Authorization: Bearer wfp_…" \
  -H "content-type: application/json" \
  --data '{"bindTypes":["示例文本"]}'

响应示例

HTTP/1.1 200
{
  "id": "018f3c2e-0000-7000-8000-000000000000",
  "projectId": "018f3c2e-0000-7000-8000-000000000000",
  "templateId": "018f3c2e-0000-7000-8000-000000000000",
  "versionNo": 1,
  "status": "draft",
  "createdAt": "示例文本",
  "updatedAt": "2026-08-01"
}

合同真值:OpenAPI 3.1(0.1.0)。

相关:Agent 接入指南 · 使用指南 · API 参考索引

Workflow 正在加载…