Skip to content

GET /workflows/:id/runs/:runId

定义

查询指定运行的当前状态、结果或错误信息。

用途

  • 异步启动后轮询进度
  • 获取 result.state 中的 output.<unitId>
  • 检查是否处于 paused(如 HITL 等待)

方法与路径

项目
方法GET
路径/workflows/:id/runs/:runId

路径参数

参数类型必填说明
idstring工作流 ID
runIdstring运行 ID

请求参数

无 query、无 body。

响应

成功: 200 OK — 完整 RunRecord

字段类型说明
runIdstring运行 ID
workflowIdstring工作流 ID
statusRunStatus当前状态
createdAtnumber创建时间戳
updatedAtnumber更新时间戳
resultWorkflowResult可选,含 completedUnitsstate
errorstring失败时的错误消息

错误

状态码条件Body
404runId 不存在{ "error": "run not found" }
500服务内部异常{ "error": "<message>" }

示例

bash
curl http://127.0.0.1:8787/workflows/yaml-sequential-example/runs/run-1-1710000000000

TypeScript SDK:

typescript
const record = await client.getRun('yaml-sequential-example', runId);
console.log(record.status, record.result?.completedUnits);

相关

MIT Licensed