查询工作流执行进度
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
}
}运行管理
查询工作流执行进度
查询工作流运行的实时进度、日志和输出结果
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
}
}查询工作流执行进度
根据运行订单 ID 查询执行引擎侧的任务状态、队列信息、实时进度、运行日志和输出结果。前端轮询时建议使用此接口。请求参数
运行订单 ID
响应参数
响应码,
0 表示成功响应信息
执行任务详情
Show data
Show data
执行引擎任务 ID
工作流 ID
执行状态,如
queued、running、succeeded、failed队列信息。排队时包含
position 和 estimated_wait_sec执行进度百分比
执行引擎进度快照
运行日志列表。日志项包含
at、event_type、level、message、node_id、progress_percent实际执行时长,单位秒
计算资源费用
第三方模型费用
实际总消耗
输出结果。key 来自详情接口的
candidate_output_manifest,值可能是文本、图片、视频或音频地址失败信息,成功时为
null创建时间
开始执行时间
终态时间
错误响应
当查询执行进度时执行引擎暂不可用或返回错误,接口会返回一个简单原因和详细错误信息。非
0 表示失败简单失败原因
代码示例
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
}
}
}
⌘I