GET /api/v1/forward/schedule_runs/{run_id}
返回单条 Schedule Run 执行记录。可传 identity_id 作为额外归属约束。
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
路径参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| run_id | string | 是 | Schedule Run ID。 |
查询参数
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| identity_id | string | 否 | - | 额外归属约束。 |
示例请求
示例响应
HTTP 200 OK响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | Schedule Run ID。 |
| schedule_id | string | 所属 Schedule ID。 |
| identity_id | string | Forward Identity ID。 |
| template_id | string | Forward Template ID。 |
| session_id | string | null | 本次执行创建或使用的 Session。 |
| status | string | pending、running、completed、failed 或 skipped。 |
| trigger_context | object | 触发来源。 |
| error | object | null | 失败或跳过时的结构化错误。 |
| result_payload | string | null | 主流程文本结果。 |
| error_message | string | null | 便于展示的错误信息;结构化信息保留在 error。 |
| push_sink | string | null | 本次 IM 投递使用的 Sink 类型;未配置投递时为 null。 |
| push_status | string | IM 投递状态:pending、succeeded、failed 或 skipped。主流程状态与投递状态相互独立。 |
| push_finished_at | string | null | IM 投递结束时间。 |
| attempt | integer | 尝试序号,当前为 1。 |
| triggered_at | string | 触发时间。 |
| started_at | string | null | 开始执行时间。 |
| completed_at | string | null | 结束时间。 |
| duration_ms | integer | null | 执行耗时,单位毫秒。 |
| created_at | string | 记录创建时间。 |
Trigger Context 对象
| type | 说明 |
|---|---|
schedule | 系统根据 Schedule 的 trigger_policy 自动触发,例如 cron、once、interval;自动触发时返回 scheduled_at。 |
manual | 调用 POST /api/v1/forward/schedules/{schedule_id}/run 手动触发。 |
Run Error 对象
error 对象用于表达结构化失败或跳过原因。status=failed 或 status=skipped 时可能返回;status=completed 时为 null。
| error.type | 说明 |
|---|---|
concurrency_limit_reached | 同一个 Schedule 已达到 execution.max_concurrent_runs,本次触发已记录但不会执行。 |
session_creation_failed | 创建或绑定 Forward Session 失败。 |
execution_failed | Template 执行失败。 |
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 404 | not_found_error | schedule_run_not_found | Run 不存在、跨租户,或不满足 identity_id 约束。 |
| 401 | authentication_error | authentication_required | PAT 无效或已过期。 |
注意事项
error.type=concurrency_limit_reached表示已记录本次触发,但因并发限制被跳过。- 可轮询本接口直到
status进入终态。