Skip to main content
GET
/
api
/
open
/
v2
/
workflow
/
run
/
execution
查询工作流执行进度
curl --request GET \
  --url https://www.chenyu.cn/api/open/v2/workflow/run/execution \
  --header 'Authorization: Bearer <token>'
{
  "code": 123,
  "msg": "<string>",
  "data": {
    "task_id": "<string>",
    "workflow_id": "<string>",
    "status": "<string>",
    "queue_info": {},
    "progress_percent": 123,
    "progress_snapshot": {},
    "logs": [
      {}
    ],
    "actual_execution_duration_sec": 123,
    "compute_cost": 123,
    "external_model_cost": 123,
    "total_cost": 123,
    "outputs": {},
    "error": {},
    "created_at": "<string>",
    "started_at": "<string>",
    "terminal_at": "<string>"
  },
  "data.error": {
    "reason": "<string>",
    "detail": "<string>",
    "engine_code": "<string>",
    "status_code": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://chenyu.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

查询工作流执行进度

根据运行订单 ID 查询执行引擎侧的任务状态、队列信息、实时进度、运行日志和输出结果。前端轮询时建议使用此接口。

请求参数

run_order_id
string
required
运行订单 ID

响应参数

code
integer
响应码,0 表示成功
msg
string
响应信息
data
object
执行任务详情

错误响应

当查询执行进度时执行引擎暂不可用或返回错误,接口会返回一个简单原因和详细错误信息。
code
integer
0 表示失败
msg
string
简单失败原因
data.error
object
执行引擎错误详情

代码示例

import time
import requests

url = "https://www.chenyu.cn/api/open/v2/workflow/run/execution"
headers = {
    "Authorization": "Bearer your_api_key",
    "Content-Type": "application/json"
}
params = {
    "run_order_id": "wfrun_314ff7d8b7a5beff1388"
}

while True:
    result = requests.get(url, headers=headers, params=params).json()
    task = result["data"]
    print(task["status"], task.get("progress_percent"))

    if task["status"] in ["succeeded", "failed", "canceled"]:
        print(task.get("outputs"))
        break

    time.sleep(2)

响应示例

{
  "code": 0,
  "msg": "查询成功",
  "data": {
    "task_id": "task_1778147626528703038_eb84d292e0851c08",
    "workflow_id": "wf_861ef31e94dcfb10e6e7",
    "status": "succeeded",
    "queue_info": null,
    "progress_percent": 100,
    "progress_snapshot": {
      "internal_status": "succeeded",
      "completed_node_count": 7,
      "total_runnable_nodes": 7,
      "last_event_type": "execution_success"
    },
    "logs": [
      {
        "at": "2026-05-08T10:00:01Z",
        "event_type": "execution_start",
        "level": "info",
        "message": "execution started",
        "progress_percent": 0
      },
      {
        "at": "2026-05-08T10:00:10Z",
        "event_type": "execution_success",
        "level": "info",
        "message": "execution succeeded",
        "progress_percent": 100
      }
    ],
    "actual_execution_duration_sec": 8.42,
    "compute_cost": 0.0002878,
    "external_model_cost": 0,
    "total_cost": 0.0002878,
    "outputs": {
      "n9_images": "https://www.chenyu.cn/media/example-output"
    },
    "error": null,
    "created_at": "2026-05-08T10:00:00Z",
    "started_at": "2026-05-08T10:00:01Z",
    "terminal_at": "2026-05-08T10:00:10Z"
  }
}

错误示例

{
  "code": 1,
  "msg": "Task not found.",
  "data": {
    "error": {
      "reason": "Task not found.",
      "detail": "execution task task_1778147626528703038_eb84d292e0851c08 does not exist",
      "engine_code": "TASK_NOT_FOUND",
      "status_code": 404
    }
  }
}