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

# Get Flow Runs by Flow

> Get a list of flow runs for a specific flow

Retrieves all flow runs for a specific flow.

## Usage Notes

* Returns all runs without pagination
* Results are ordered by creation date (newest first)
* The flow must belong to your workspace

## Request

<ParamField path="id" type="string" required>
  The ID of the flow
</ParamField>

## Response

<ResponseExample>
  ```json theme={null}
  [
    {
      "id": "Wp7kRnT2mX4vQ9bL",
      "flow_id": "dk4g1tUg1uHLs8YU",
      "workspace_id": "uT2bJNWN75YPU95r",
      "status": "completed",
      "status_history": [
        {
          "status": "processing",
          "time": 1682366228,
          "message": "Flow started via api"
        },
        {
          "status": "completed",
          "time": 1682366258,
          "message": "Flow completed successfully"
        }
      ],
      "error": null,
      "metadata": {
        "customer_id": "12345",
        "order_number": "PO-2024-001"
      },
      "trigger_method": "api",
      "start_time": 1682366228,
      "end_time": 1682366258,
      "duration": 30000,
      "drive_files": {},
      "created_at": 1682366228,
      "updated_at": 1682366258
    },
    {
      "id": "hN3cYs8fKj6pA5wD",
      "flow_id": "dk4g1tUg1uHLs8YU",
      "workspace_id": "uT2bJNWN75YPU95r",
      "status": "failed",
      "status_history": [
        {
          "status": "processing",
          "time": 1682365228,
          "message": "Flow started via manual"
        },
        {
          "status": "failed",
          "time": 1682365258,
          "message": "Extraction step 'Extract Invoice' failed: Template not found"
        }
      ],
      "error": "Extraction step 'Extract Invoice' failed: Template not found",
      "metadata": {
        "customer_id": "54321"
      },
      "trigger_method": "manual",
      "start_time": 1682365228,
      "end_time": 1682365258,
      "duration": 30000,
      "drive_files": {},
      "created_at": 1682365228,
      "updated_at": 1682365258
    }
  ]
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.tableflow.com/v2/flows/dk4g1tUg1uHLs8YU/runs \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.tableflow.com/v2/flows/dk4g1tUg1uHLs8YU/runs",
      headers={
          "Authorization": "Bearer YOUR_API_KEY"
      }
  )

  flow_runs = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.tableflow.com/v2/flows/dk4g1tUg1uHLs8YU/runs", {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  });

  const flowRuns = await response.json();
  ```
</RequestExample>

<ResponseField name="flow_runs" type="array">
  Array of flow run objects

  <Expandable title="Flow Run Object">
    <ResponseField name="id" type="string" required>
      The unique identifier for the flow run
    </ResponseField>

    <ResponseField name="flow_id" type="string" required>
      The ID of the flow being executed
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    <ResponseField name="status" type="string" required>
      Current status of the flow run

      * `processing` - Flow is currently executing
      * `review` - Flow is paused for human review
      * `completed` - Flow completed successfully
      * `failed` - Flow failed (check error field)
    </ResponseField>

    <ResponseField name="status_history" type="array" required>
      History of status changes

      <Expandable title="Status History Entry">
        <ResponseField name="status" type="string" required>
          The status value
        </ResponseField>

        <ResponseField name="time" type="number" required>
          Unix timestamp of the status change
        </ResponseField>

        <ResponseField name="message" type="string" required>
          Description of the status change
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message if the flow run failed
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Custom metadata provided when running the flow
    </ResponseField>

    <ResponseField name="trigger_method" type="string" required>
      How the flow was triggered: api or manual
    </ResponseField>

    <ResponseField name="start_time" type="number" required>
      Unix timestamp when the flow run started
    </ResponseField>

    <ResponseField name="end_time" type="number">
      Unix timestamp when the flow run completed
    </ResponseField>

    <ResponseField name="duration" type="number" required>
      Duration of the flow run in milliseconds
    </ResponseField>

    <ResponseField name="drive_files" type="object">
      Google Drive files created during the flow (if Google Drive integration is enabled)
    </ResponseField>

    <ResponseField name="created_at" type="number" required>
      Unix timestamp when the flow run was created
    </ResponseField>

    <ResponseField name="updated_at" type="number" required>
      Unix timestamp when the flow run was last updated
    </ResponseField>
  </Expandable>
</ResponseField>
