# MD_FLIGHT_RUNS
> List the execution history of a Flight, newest first.
Returns every run of a single [Flight](/concepts/flights). Each row has a status, a sequential run number, and the version of the Flight that ran.

## Syntax

```sql
SELECT * FROM MD_FLIGHT_RUNS(
    flight_id := '<flight_id>',
    "LIMIT" := <n>,
    "OFFSET" := <n>
);
```

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `flight_id` | `UUID` | Yes | Identifier of the Flight. |
| `LIMIT` | `BIGINT` | No | Maximum number of runs to return. |
| `OFFSET` | `BIGINT` | No | Skip this many runs before returning. |

`LIMIT` and `OFFSET` are SQL keywords and must be quoted when used as named arguments.

## Return columns

| Column | Type | Description |
|---|---|---|
| `flight_id` | `UUID` | Flight identifier. |
| `flight_name` | `VARCHAR` | Flight name at the time of the run. |
| `flight_version` | `INTEGER` | The version this run locked to at start. |
| `run_number` | `INTEGER` | Sequential run number, starting at `1`. |
| `is_scheduled` | `BOOLEAN` | `true` if the run was triggered by the schedule, `false` for on-demand. |
| `status` | `VARCHAR` | Run status: `RUN_STATUS_PENDING`, `RUN_STATUS_RUNNING`, `RUN_STATUS_SUCCEEDED`, `RUN_STATUS_FAILED`, or `RUN_STATUS_CANCELLED`. |
| `created_at` | `TIMESTAMP WITH TIME ZONE` | When the run was created. |

## Examples

Latest 10 runs, newest first:

```sql
SELECT run_number, status, flight_version, created_at
FROM MD_FLIGHT_RUNS(flight_id := '<flight_id>')
ORDER BY run_number DESC
LIMIT 10;
```

Find recent failures:

```sql
SELECT run_number, flight_version, created_at
FROM MD_FLIGHT_RUNS(flight_id := '<flight_id>')
WHERE status = 'RUN_STATUS_FAILED'
ORDER BY run_number DESC;
```

Total runs per version:

```sql
SELECT flight_version, COUNT(*) AS runs
FROM MD_FLIGHT_RUNS(flight_id := '<flight_id>')
GROUP BY flight_version
ORDER BY flight_version DESC;
```

## Related

- [`MD_RUN_FLIGHT`](../md-run-flight) — Trigger an on-demand run.
- [`MD_FLIGHT_LOGS`](../md-flight-logs) — Read a specific run's output.
- [`MD_CANCEL_FLIGHT_RUN`](../md-cancel-flight-run) — Cancel an in-progress run.
- [`list_flight_runs` MCP tool](/sql-reference/mcp/) — AI-agent equivalent.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/sql-reference/motherduck-sql-reference/flights/md-flight-runs/",
  "page_title": "MD_FLIGHT_RUNS",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
