分页列出 Schedule Run 执行记录。
GET /api/v1/forward/schedule_runs
查询某个 Identity 下的 Schedule Run;传入 schedule_id 可收敛到单个 Schedule。
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT 或 SAT> |
查询参数
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| identity_id | string | 是 | - | Run 所属 Forward Identity ID。 |
| schedule_id | string | 否 | - | 按 Schedule ID 过滤。 |
| status | string | 否 | - | 按 pending、running、completed、failed 或 skipped 过滤。 |
| trigger_type | string | 否 | - | 按 schedule 或 manual 过滤。 |
| has_error | boolean | 否 | - | 是否只返回有错误或无错误的 Run。 |
| limit | integer | 否 | 20 | 分页大小,最大 100。 |
| after_id | string | 否 | - | 向后翻页游标。 |
| before_id | string | 否 | - | 向前翻页游标。 |
| sort_by | string | 否 | created_at | 排序字段:created_at 或 triggered_at。 |
| order | string | 否 | desc | 排序方向:asc 或 desc。 |
示例请求
示例响应
HTTP 200 OK
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| data | array | 当前页的 Schedule Run 对象。 |
| first_id | string|null | 当前页第一条 Run ID。 |
| last_id | string|null | 当前页最后一条 Run ID。 |
| has_more | boolean | 是否还有更多记录。 |
data[] 中每一项都是 Schedule Run 对象,字段与 Get Schedule Run 一致,包括 trigger_context、error、push_sink、push_status、attempt 和执行时间字段。attempt 从 1 开始;当 Schedule 的 execution.max_attempts=2 且服务端完成自动重试时,同一个 Run 可能返回 attempt=2。
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 400 | invalid_request_error | invalid_identity | identity_id 缺失或不合法。 |
| 400 | invalid_request_error | invalid_request | sort_by、order 不合法,同时传入 after_id 和 before_id,或游标包含不支持的控制字符。 |
| 400 | invalid_request_error | invalid_limit | limit 不在 1~100 范围内或不是整数。 |
| 401 | authentication_error | authentication_required | PAT 或 SAT 无效或已过期。 |
备注
- Schedule Run 是独立资源。
- 默认按
(created_at, run_id)倒序返回;指定sort_by=triggered_at时按(triggered_at, run_id)稳定排序。 after_id与before_id不能同时传;游标会按当前sort_by和order解析,切换排序方式时应重新开始分页。- 为保持 v1 兼容性,非空且不含控制字符的
after_id/before_id如果在当前 owner/Identity 下找不到,服务端会忽略该游标并返回当前筛选与排序条件的第一页。调用方不应依赖该容错,应仅原样回传同一 owner/Identity、sort_by和order下上一页返回的first_id/last_id。 completed、failed和skipped是终态。push_status表达 IM 流式投递状态,和主流程status相互独立。

