Skip to main content
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"
{
  "success": true,
  "data": {
    "status": "running",
    "startedAt": "2024-01-15T10:30:00Z",
    "finishedAt": null
  }
}

Get Run Status

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

Path Parameters

workflowId
string
required
The unique identifier of the workflow
runId
string
required
The unique identifier of the run (returned when triggering the run)

Response

success
boolean
Whether the request was successful
data
object

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"
{
  "success": true,
  "data": {
    "status": "running",
    "startedAt": "2024-01-15T10:30:00Z",
    "finishedAt": null
  }
}