Get Responses
Get Run Status
Check the status of a workflow run
GET
/
api
/
v1
/
workflows
/
{workflowId}
/
runs
/
{runId}
/
async
/
status
curl https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status \
-H "x-origami-key: your-api-key"
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' },
}
);
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"},
)
{
"success": true,
"data": {
"status": "running",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": null
}
}
{
"success": true,
"data": {
"status": "completed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:45Z"
}
}
{
"success": true,
"data": {
"status": "failed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:12Z",
"error": "Node 'api_call' failed: Connection timeout"
}
}
{
"success": false,
"error": "Workflow run not found"
}
Get Run Status
Returns the current status of a workflow run. Use this to poll for completion before fetching results.Path Parameters
string
required
The unique identifier of the workflow
string
required
The unique identifier of the run (returned when triggering the run)
Response
boolean
Whether the request was successful
object
Show data properties
Show data properties
string
Current status of the run. One of:
queued- Run is waiting to startrunning- Run is in progresscompleted- Run finished successfullyfailed- Run encountered an errorcancelled- Run was cancelledpausing- Run is being pausedpaused- Run is paused
string
ISO 8601 timestamp when the run started
string | null
ISO 8601 timestamp when the run finished, or
null if still runningstring
Error message if the run failed (only present when status is
failed)Polling Strategy
We recommend polling with exponential backoff: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);
}
}
curl https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status \
-H "x-origami-key: your-api-key"
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' },
}
);
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"},
)
{
"success": true,
"data": {
"status": "running",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": null
}
}
{
"success": true,
"data": {
"status": "completed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:45Z"
}
}
{
"success": true,
"data": {
"status": "failed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:12Z",
"error": "Node 'api_call' failed: Connection timeout"
}
}
{
"success": false,
"error": "Workflow run not found"
}
⌘I
curl https://api.origamiagents.com/api/v1/workflows/wf_abc123/runs/run_xyz789/async/status \
-H "x-origami-key: your-api-key"
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' },
}
);
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"},
)
{
"success": true,
"data": {
"status": "running",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": null
}
}
{
"success": true,
"data": {
"status": "completed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:45Z"
}
}
{
"success": true,
"data": {
"status": "failed",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:12Z",
"error": "Node 'api_call' failed: Connection timeout"
}
}
{
"success": false,
"error": "Workflow run not found"
}