全部產品
Search
文件中心

Qoder CN 系列:擷取 Schedule Run

更新時間:Jul 15, 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 進入終態。