Async Polling Pattern¶
Use GET /v1/automation/tasks/{task_id} to poll for task status.
Status Values¶
queued- Waiting to be processedrunning- Currently executingneeds_input- Requires user inputcompleted- Finished successfullyfailed- Task failedcancelled- Task cancelled
Polling Loop¶
while (retryCount < maxRetries) {
const response = await fetch(`/tasks/${taskId}`);
const data = await response.json();
if (['completed', 'failed', 'cancelled'].includes(data.status)) {
return data;
}
await sleep(5000);
}
Platform Examples¶
n8n: Split in Batches → HTTP Request → Sleep → Filter (status check) → Loop
Make: Iterator → Sleep → HTTP Request → Array Aggregator