跳转到主要内容
GET /api/v1/forward/schedule_runs/{run_id} 返回单条 Schedule Run 执行记录。可传 identity_id 作为额外归属约束。

请求头

Header是否必填说明
AuthorizationBearer <PAT>

路径参数

参数类型是否必填说明
run_idstringSchedule Run ID。

查询参数

参数类型是否必填默认值说明
identity_idstring-额外归属约束。

示例请求

curl -s -X GET 'https://api.qoder.com/api/v1/forward/schedule_runs/srun_019f00112233445566778899aabbccdd' \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "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": 1,
  "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"
}

响应字段

字段类型说明
idstringSchedule Run ID。
schedule_idstring所属 Schedule ID。
identity_idstringForward Identity ID。
template_idstringForward Template ID。
session_idstring | null本次执行创建或使用的 Session。
statusstringpendingrunningcompletedfailedskipped
trigger_contextobject触发来源。
errorobject | null失败或跳过时的结构化错误。
result_payloadstring | null主流程文本结果。
error_messagestring | null便于展示的错误信息;结构化信息保留在 error
push_sinkstring | null本次 IM 投递使用的 Sink 类型;未配置投递时为 null
push_statusstringIM 投递状态:pendingsucceededfailedskipped。主流程状态与投递状态相互独立。
push_finished_atstring | nullIM 投递结束时间。
attemptinteger尝试序号,当前为 1
triggered_atstring触发时间。
started_atstring | null开始执行时间。
completed_atstring | null结束时间。
duration_msinteger | null执行耗时,单位毫秒。
created_atstring记录创建时间。

Trigger Context 对象

type说明
schedule系统根据 Schedule 的 trigger_policy 自动触发,例如 crononceinterval;自动触发时返回 scheduled_at
manual调用 POST /api/v1/forward/schedules/{schedule_id}/run 手动触发。

Run Error 对象

error 对象用于表达结构化失败或跳过原因。status=failedstatus=skipped 时可能返回;status=completed 时为 null
error.type说明
concurrency_limit_reached同一个 Schedule 已达到 execution.max_concurrent_runs,本次触发已记录但不会执行。
session_creation_failed创建或绑定 Forward Session 失败。
execution_failedTemplate 执行失败。

错误

HTTPTypeCode触发条件
404not_found_errorschedule_run_not_foundRun 不存在、跨租户,或不满足 identity_id 约束。
401authentication_errorauthentication_requiredPAT 无效或已过期。

注意事项

  • error.type=concurrency_limit_reached 表示已记录本次触发,但因并发限制被跳过。
  • 可轮询本接口直到 status 进入终态。

相关

列出 Schedule Runs

获取 Schedule