Skip to main content
Schedules

列出 Schedule Runs

分页列出 Schedule Run 执行记录。

GET /api/v1/forward/schedule_runs 查询某个 Identity 下的 Schedule Run;传入 schedule_id 可收敛到单个 Schedule。

请求头

Header是否必填说明
AuthorizationBearer <PAT 或 SAT>

查询参数

参数类型是否必填默认值说明
identity_idstring-Run 所属 Forward Identity ID。
schedule_idstring-按 Schedule ID 过滤。
statusstring-pendingrunningcompletedfailedskipped 过滤。
trigger_typestring-schedulemanual 过滤。
has_errorboolean-是否只返回有错误或无错误的 Run。
limitinteger20分页大小,最大 100。
after_idstring-向后翻页游标。
before_idstring-向前翻页游标。
sort_bystringcreated_at排序字段:created_attriggered_at
orderstringdesc排序方向:ascdesc

示例请求

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/schedule_runs?identity_id=idn_019eabc123&sort_by=triggered_at&order=desc&limit=20' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "srun_019f00112233445566778899aabbccdd",
      "schedule_id": "sched_019f00112233445566778899aabbccdd",
      "identity_id": "idn_019eabc123",
      "template_id": "tmpl_support",
      "session_id": "sess_019ec55a68b37e1e8d660691af161ab4",
      "status": "completed",
      "trigger_context": {
        "type": "schedule",
        "scheduled_at": "2026-06-22T01:00:00Z"
      },
      "result_payload": "Today's technology highlights: ...",
      "push_sink": "im_channel",
      "push_status": "succeeded",
      "push_finished_at": "2026-06-22T01:00:21Z",
      "attempt": 2,
      "triggered_at": "2026-06-22T01:00:00Z",
      "started_at": "2026-06-22T01:00:03Z",
      "completed_at": "2026-06-22T01:00:20Z",
      "duration_ms": 17000,
      "created_at": "2026-06-22T01:00:00Z"
    }
  ],
  "first_id": "srun_019f00112233445566778899aabbccdd",
  "last_id": "srun_019f00112233445566778899aabbccdd",
  "has_more": false
}

响应字段

字段类型说明
dataarray当前页的 Schedule Run 对象。
first_idstring|null当前页第一条 Run ID。
last_idstring|null当前页最后一条 Run ID。
has_moreboolean是否还有更多记录。
data[] 中每一项都是 Schedule Run 对象,字段与 Get Schedule Run 一致,包括 trigger_contexterrorpush_sinkpush_statusattempt 和执行时间字段。attempt1 开始;当 Schedule 的 execution.max_attempts=2 且服务端完成自动重试时,同一个 Run 可能返回 attempt=2

错误

HTTPTypeCode触发条件
400invalid_request_errorinvalid_identityidentity_id 缺失或不合法。
400invalid_request_errorinvalid_requestsort_byorder 不合法,同时传入 after_idbefore_id,或游标包含不支持的控制字符。
400invalid_request_errorinvalid_limitlimit 不在 1~100 范围内或不是整数。
401authentication_errorauthentication_requiredPAT 或 SAT 无效或已过期。

备注

  • Schedule Run 是独立资源。
  • 默认按 (created_at, run_id) 倒序返回;指定 sort_by=triggered_at 时按 (triggered_at, run_id) 稳定排序。
  • after_idbefore_id 不能同时传;游标会按当前 sort_byorder 解析,切换排序方式时应重新开始分页。
  • 为保持 v1 兼容性,非空且不含控制字符的 after_id / before_id 如果在当前 owner/Identity 下找不到,服务端会忽略该游标并返回当前筛选与排序条件的第一页。调用方不应依赖该容错,应仅原样回传同一 owner/Identity、sort_byorder 下上一页返回的 first_id / last_id
  • completedfailedskipped 是终态。
  • push_status 表达 IM 流式投递状态,和主流程 status 相互独立。

相关