Async Polling
When your workflow takes more than a few seconds to complete, use the async pattern: fire the trigger, then poll for status and retrieve results when done. This is the recommended approach for integrations that need to programmatically retrieve workflow results.How It Works
Trigger the workflow asynchronously
Call the trigger endpoint with Response headers:
x-api-wait: false (or omit the header entirely). The API returns immediately with an empty body. Two response headers contain the IDs you need for polling:X-Pf-Run-Id: The unique identifier for this workflow runX-Pf-Automation-Id: The automation/workflow ID
Poll for status
Check the status endpoint until the workflow completes. Poll every 2-5 seconds for typical workflows.Response:Status values:
Polling endpoints always use the webhook-style URL format (
/ext/webhook/{apiKey}/...) — even if you triggered the workflow using the API endpoint with X-API-KEY header authentication.| Status | Meaning |
|---|---|
PENDING | Workflow is queued but not yet started |
RUNNING | Workflow is currently executing |
COMPLETE | Workflow completed successfully |
FAILED | Workflow failed with an error |
TIMEOUT | Workflow exceeded execution time limit |
Complete Examples
Bash
JavaScript / TypeScript
Python
Designated Output
If your trigger has a designated output configured, the results response includes a top-leveldesignatedOutput field with a direct link to the output file:
Best Practices
- Poll interval: Every 2-5 seconds for most workflows. For long-running workflows, poll every 10-30 seconds.
- Set a timeout: Add a maximum polling duration to avoid infinite loops in production.
- Handle errors: Always check for
FAILEDandTIMEOUTstatuses in your polling loop. - Use step status: The
stepStatusfield in the status response lets you track progress of multi-step workflows while they run.

