POST
/
workflows
/
run
curl --request POST \
  --url https://wfapi.yuhe.space/workflows/run \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workflow": "smoke",
  "inputs": {
    "message": "hello"
  },
  "conversation_id": "thread-1",
  "response_mode": "blocking",
  "target": "latest",
  "user": "external-user"
}
'
{
  "workflow_run_id": "<string>",
  "task_id": "<string>",
  "data": {
    "id": "<string>",
    "workflow_id": "<string>",
    "outputs": {
      "errCode": 123,
      "errMessage": "<string>",
      "items": [
        {
          "id": "<string>",
          "title": "<string>",
          "content": "<unknown>",
          "icon": "<string>",
          "collapsed": true,
          "metadata": {}
        }
      ]
    },
    "error": "<string>",
    "elapsed_time": 123,
    "total_tokens": 123,
    "total_steps": 123,
    "created_at": 123,
    "finished_at": 123,
    "conversation_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
user
string
required
Example:

"external-user"

workflow
string

使用路径式 /workflows/{workflowName}/run 时可省略。

Example:

"smoke"

workflow_id
string
workflowName
string
workflowId
string
inputs
object

按 workflow executor.params 命名传入结构化输入。multiple: truecontrol: "checkboxes" 的非 file 参数会序列化为 JSON 数组字符串。 control: "textarea" 只影响 App/server 表单展示,仍按普通字符串输入处理。 boolean 参数默认值为 "true" 且输入 false 时会显式传入 false

args
string[]
files
any[]
conversation_id
string
conversationId
string
response_mode
enum<string>
default:blocking
Available options:
blocking,
streaming
target
string

latest、draft 或语义化版本号。

Example:

"latest"

version
string

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

Response

Blocking 返回 Dify 风格结果;streaming 时返回 text/event-stream。

workflow_run_id
string
required
task_id
string
required
data
object
required