Get a run
/runs/{run_id}Returns one run's status, progress and summary, and can hold until it finishes. It is how you wait for a run.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| No |
|
|
Guidance
Poll with
wait=30in a loop untilstatusissucceeded,failedorcancelled. Each call returns as soon as the run finishes, so there is no need to sleep between calls.Past your plan's long polls at once, the call answers straight away with the run as it is. If an unfinished run comes back in under a second or two, wait 2 seconds before the next poll, as the CLI does.
A
200means the run has finished and a202means it has not. Readstatusto tell success from failure.On
failed, readfailure:retryable: truemeans running it again can help, andfailure.diagnosticsnames what stopped a script before it produced anything. Errors and exit codes explains each kind.On
succeeded,summaryhas the counts. Call Get run results for the points, events or result blocks.consoleholds the first 50 lines an indicator or definition printed, once the run has finished. Read it when a run succeeds but the numbers look wrong.
Path parameters
Name | Type | Description |
|---|---|---|
| string | A run id, |
Query parameters
Name | Type | Required | Default | Description |
|---|---|---|---|---|
| integer | No | 0 | Seconds to hold until the run finishes, 0 to 30. Values outside the range are clamped |
Response
Returns a Run: 200 when it has finished, 202 while it is still queued or running.
Status codes
Status | Code | Meaning |
|---|---|---|
| - | The run has finished: |
| - | The run is still |
|
| You have no run with that id |
