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

# Get Run Status

> Check the status of a workflow run

# Get Run Status

Returns the current status of a workflow run. Use this to poll for completion before fetching results.

## Path Parameters

<ParamField path="workflowId" type="string" required>
  The unique identifier of the workflow
</ParamField>

<ParamField path="runId" type="string" required>
  The unique identifier of the run (returned when triggering the run)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="data properties">
    <ResponseField name="status" type="string">
      Current status of the run. One of:

      * `queued` - Run is waiting to start
      * `running` - Run is in progress
      * `completed` - Run finished successfully
      * `failed` - Run encountered an error
      * `cancelled` - Run was cancelled
      * `pausing` - Run is being paused
      * `paused` - Run is paused
    </ResponseField>

    <ResponseField name="startedAt" type="string">
      ISO 8601 timestamp when the run started
    </ResponseField>

    <ResponseField name="finishedAt" type="string | null">
      ISO 8601 timestamp when the run finished, or `null` if still running
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message if the run failed (only present when status is `failed`)
    </ResponseField>
  </Expandable>
</ResponseField>

## Polling Strategy

We recommend polling with exponential backoff:

```javascript theme={null}
async function waitForCompletion(workflowId, runId) {
  let delay = 500; // Start with 500ms
  const maxDelay = 5000; // Cap at 5 seconds
  
  while (true) {
    const { data } = await checkStatus(workflowId, runId);
    
    if (data.status === 'completed') {
      return { success: true };
    }
    
    if (data.status === 'failed') {
      return { success: false, error: data.error };
    }
    
    await new Promise(r => setTimeout(r, delay));
    delay = Math.min(delay * 1.5, maxDelay);
  }
}
```

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status \
    -H "x-origami-key: your-api-key"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status',
    {
      headers: { 'x-origami-key': 'your-api-key' },
    }
  );
  ```

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

  response = requests.get(
      "https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status",
      headers={"x-origami-key": "your-api-key"},
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Running theme={null}
  {
    "success": true,
    "data": {
      "status": "running",
      "startedAt": "2024-01-15T10:30:00Z",
      "finishedAt": null
    }
  }
  ```

  ```json 200 Completed theme={null}
  {
    "success": true,
    "data": {
      "status": "completed",
      "startedAt": "2024-01-15T10:30:00Z",
      "finishedAt": "2024-01-15T10:30:45Z"
    }
  }
  ```

  ```json 200 Failed theme={null}
  {
    "success": true,
    "data": {
      "status": "failed",
      "startedAt": "2024-01-15T10:30:00Z",
      "finishedAt": "2024-01-15T10:30:12Z",
      "error": "Node 'api_call' failed: Connection timeout"
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "error": "Workflow run not found"
  }
  ```
</ResponseExample>
