POST
/
api
/
workflows
/
{workflowName}
/
run
/
stream
管理端流式运行 workflow
curl --request POST \
  --url https://wfapi.yuhe.space/api/workflows/{workflowName}/run/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": "latest",
  "version": "<string>",
  "args": [],
  "conversationId": "<string>",
  "conversation_id": "<string>",
  "toolPermissionPolicies": {
    "search": {
      "enabled": true,
      "autoApprove": false
    }
  }
}
'
"{\"type\":\"workflow_started\",\"runId\":\"20260513-abc\",\"workflowName\":\"smoke\",\"startedAt\":\"2026-05-13T00:00:00.000Z\"}\n{\"type\":\"timer_started\",\"runId\":\"20260513-abc\",\"workflowName\":\"smoke\",\"timer\":{\"errCode\":0,\"errMessage\":\"\",\"timerId\":\"api-call\",\"title\":\"外部接口调用\",\"startedAt\":\"2026-05-13T00:00:00.100Z\",\"status\":\"running\"}}\n{\"type\":\"timer_finished\",\"runId\":\"20260513-abc\",\"workflowName\":\"smoke\",\"timer\":{\"errCode\":0,\"errMessage\":\"\",\"timerId\":\"api-call\",\"title\":\"外部接口调用\",\"startedAt\":\"2026-05-13T00:00:00.100Z\",\"status\":\"success\",\"endedAt\":\"2026-05-13T00:00:01.000Z\",\"durationMs\":900}}\n{\"type\":\"run_result\",\"data\":{\"runId\":\"20260513-abc\",\"status\":\"success\"}}\n"

Authorizations

Authorization
string
header
required

使用 WORKFLOW_SERVER_ADMIN_KEY 或已创建的账号 API Key。

Path Parameters

workflowName
string
required

Body

application/json
target
string
Example:

"latest"

version
string

指定语义化版本号的别名;未提供 target 时会作为运行目标。

args
string[]
conversationId
string
conversation_id
string
toolPermissionPolicies
object
Example:
{
"search": { "enabled": true, "autoApprove": false }
}

Response

200 - application/x-ndjson

NDJSON 流,每行是 runtime event、run_result 或 error;runtime event 包含 timer_started / timer_finished,用于展示业务计时卡片。

The response is of type string.