When you need to process many Workflow executions at once, the async execution endpoint is ideal for batch processing. Async executions automatically queue when you exceed your concurrency limit, allowing you to initiate many executions quickly without waiting for each one to complete.
Async execution is perfect for batch processing scenarios because:
The simplest pattern is to initiate all executions at once. They’ll queue automatically if needed:
After initiating your batch, you have several options for tracking completion:
The most efficient approach is to use webhooks to receive completion notifications. See our Long Running Workflows guide for webhook setup details.
Poll the status endpoint to check completion. This is useful when you need to wait for results before proceeding:
Initiate executions and periodically check status, but rely on webhooks for final notification:
Always include an external_id when initiating batch executions. This allows you to correlate webhook events with your internal records, making it easy to track which item in your batch corresponds to each execution.
Be aware of your organization’s concurrency limits. While async executions queue automatically, understanding your limits helps you plan batch sizes and processing times.
Some executions in a batch may fail. Use webhooks or status polling to identify failures and implement retry logic or error handling as needed.
For large batches (hundreds or thousands of executions), webhooks are more efficient than polling. They reduce API calls and provide real-time notifications.
There’s no hard limit on batch size, but consider: