> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# スケジュール実行を取得する

> 1 つの Schedule Run を ID で取得します。

`GET /api/v1/forward/schedule_runs/{run_id}`

単一の Schedule Run 実行レコードを返します。所有権の追加制約として `identity_id` を指定できます。

## Headers

| Header          | Required | Description    |
| --------------- | -------- | -------------- |
| `Authorization` | Yes      | `Bearer <PAT>` |

## Path parameters

| Parameter | Type   | Required | Description      |
| --------- | ------ | -------- | ---------------- |
| `run_id`  | string | Yes      | Schedule Run ID。 |

## Query parameters

| Parameter     | Type   | Required | Default | Description   |
| ------------- | ------ | -------- | ------- | ------------- |
| `identity_id` | string | No       | -       | 所有権の追加制約(任意)。 |

## Example request

```bash theme={null}
curl -s -X GET 'https://api.qoder.com/api/v1/forward/schedule_runs/srun_019f00112233445566778899aabbccdd?identity_id=idn_019eabc123' \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "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"
  },
  "error": null,
  "error_message": null,
  "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"
}
```

## Response fields

| Field              | Type          | Description                                             |
| ------------------ | ------------- | ------------------------------------------------------- |
| `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        | `pending`、`running`、`completed`、`failed`、または `skipped`。 |
| `trigger_context`  | object        | トリガーソース。`type` は `schedule` または `manual`。               |
| `error`            | object\|null  | 失敗またはスキップされた実行の構造化エラー。                                  |
| `result_payload`   | string\|null  | メインのテキスト結果。                                             |
| `error_message`    | string\|null  | 人間が読めるエラーメッセージ。構造化された詳細は `error` に残ります。                 |
| `push_sink`        | string\|null  | IM 配信に使用される sink タイプ。配信が構成されていない場合は `null`。             |
| `push_status`      | string        | `pending`、`succeeded`、`failed`、または `skipped`。           |
| `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`     | Description                                                                                             |
| ---------- | ------------------------------------------------------------------------------------------------------- |
| `schedule` | `cron`、`once`、`interval` などの Schedule の `trigger_policy` から自動的にトリガーされます。自動トリガーには `scheduled_at` が含まれます。 |
| `manual`   | `POST /api/v1/forward/schedules/{schedule_id}/run` によって手動でトリガーされます。                                     |

## Run error

`error` オブジェクトは構造化された失敗またはスキップの理由を説明します。`status` が `failed` または `skipped` の場合に返されることがあり、`status` が `completed` の場合は `null` です。

| `error.type`                | Description                                                                  |
| --------------------------- | ---------------------------------------------------------------------------- |
| `concurrency_limit_reached` | Schedule が `execution.max_concurrent_runs` に達しました。このトリガーは記録されましたが実行されませんでした。 |
| `session_creation_failed`   | Forward が実行 Session の作成またはバインドに失敗しました。                                       |
| `execution_failed`          | Template の実行が失敗しました。                                                         |

## Errors

| HTTP | Type                   | Code                      | Trigger                                           |
| ---- | ---------------------- | ------------------------- | ------------------------------------------------- |
| 401  | `authentication_error` | `authentication_required` | PAT が無効または期限切れです。                                 |
| 404  | `not_found_error`      | `schedule_run_not_found`  | 実行が存在しない、テナントをまたいでいる、または `identity_id` 制約を満たしません。 |

## Notes

* `error.type=concurrency_limit_reached` は、`max_concurrent_runs` により実行が記録されたもののスキップされたことを意味します。
* `status` が終了状態に入るまで、このエンドポイントをポーリングしてください。

## Related

<CardGroup cols={2}>
  <Card title="スケジュール実行を一覧表示する" icon="history" href="/cloud-agents/api/forward/schedule-runs/list" />

  <Card title="スケジュールを取得する" icon="file-lines" href="/cloud-agents/api/forward/schedules/get" />
</CardGroup>
