Check the status of a workflow run
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 } }
Show data properties
queued
running
completed
failed
cancelled
pausing
paused
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); } }