跳转到主要内容
POST
/
workflows
/
run
{
  "workflow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "running",
    "outputs": {},
    "error": "<string>",
    "elapsed_time": 123,
    "total_tokens": 123,
    "total_steps": 0,
    "created_at": 123,
    "finished_at": 123
  }
}

Authorizations

Authorization
string
header
required

API-Key 鉴权。所有 API 请求都应在 Authorization HTTP Header 中包含你的 API-Key,格式为:Bearer {API_KEY}。强烈建议开发者把 API-Key 放在后端存储,而非客户端,以免泄露。

Body

application/json
inputs
object
required

允许传入 App 定义的各变量值。如果变量是文件列表类型,该变量对应的值应是 InputFileObjectWorkflowCn 对象的列表。

Example:
{
"user_query": "请帮我翻译这句话。",
"target_language": "法语"
}
response_mode
enum<string>
required

返回响应模式。streaming (推荐) 基于 SSE;blocking 等待执行完毕后返回 (Cloudflare 100秒超时限制)。

可用选项:
streaming,
blocking
user
string
required

用户标识,应用内唯一。

Response

工作流执行成功。响应结构取决于 response_mode

  • blocking: application/json 格式,包含 WorkflowCompletionResponseCn 对象。
  • streaming: text/event-stream 格式,包含 ChunkWorkflowEventCn 事件流。

阻塞模式下的 workflow 执行结果。

workflow_run_id
string<uuid>

workflow 执行 ID。

task_id
string<uuid>

任务 ID。

data
object

Workflow 执行结束事件的详细内容。