全部产品
Search
文档中心

Qoder CN 系列:获取 Schedule Run

更新时间:Jul 14, 2026

根据 ID 获取一条 Schedule Run。

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

-

额外归属约束。

示例请求

curl -s -X GET 'https://api.qoder.com.cn/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"
}

响应字段

字段

类型

说明

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

pendingrunningcompletedfailedskipped

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 投递状态:pendingsucceededfailedskipped。主流程状态与投递状态相互独立。

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 自动触发,例如 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_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 进入终态。