# Callable recipe - Wait for async calls action
This action waits for async calls to complete. At the wait action, Workato puts the recipe on hold and checks periodically if the asynchronous call(s) have completed processing. Once all the async call(s) have been completed (successfully or unsuccessfully), Workato will proceed with the next step(s) in the recipe.
Run independent process in parallel
Use async calls with the wait action to efficiently run independent processes in parallel. This speeds up the overall processing time.
For example, Acme company syncs data from S3 to Snowflake daily. Each table in Snowflake is unique and the bulk load to Snowlake action can be called asynchronously for each table. Thus, multiple asynchronous recipes can run in parallel.
To receive a slack notification after all the asynchronous recipes have finished processing, using the use the Wait action. It checks that all async calls have completed processing before moving to the next recipe step.
Wait for async action
|Async calls to wait for||Select the async call to wait for. Only async calls can be selected by this action.|
|Timeout limit (minutes)||Set an upper limit for this wait action. Workato allows waiting up to 24 hours (1440 minutes).|
|Results||A list datapill containing metadata about the callable recipe(s) that were called asynchronously, including the list size and list index.|
|All jobs succeeded||Whether all async calls completed successfully.|
|Job succeeded count||The number of async calls that completed successfully.|
|Job failed count||The number of async calls that failed.|
|Job timeout count||The number of async calls that exceeded the timeout limit defined in the input configuration.|
Not applicable for dependent steps
Using call recipe (asynchronous) does not guarantee that the callable recipes will run in sequence. If your workflow requires steps to be called in sequence, use the Call recipe (synchronous) instead.
# FAQ - Wait for Async calls issued within a loop
If the recipe issues multiple asynchronous calls to the same callable recipe using a loop, the Wait for Async calls action will wait for the last call.
In the example below, the recipe is making multiple asynchronous calls within a loop. Outside the loop, the wait action will only monitor the last async calls and only one copy of call recipe 1 and call recipe 2 is picked up by the wait for async calls action. If loop runs for 10 times, the wait action outside the loop only monitors the completion of the 10th call to call recipe 1 and call recipe 2.
Only the last call to call recipe 1 and call recipe 2 is monitored by the wait for async calls action_
Timeout for multiple async calls issued to the same callable recipe
The wait action will only monitor the last iteration of the async calls in a loop. Issuing too many calls to the same callable recipe may result in the last async call taking a longer time to finish processing.
Once the timeout limit is reached, the wait action will consider the async calls to have timed out and proceed with the next steps in the recipe.
# FAQ - Output of async recipes not available
Asynchronous calls to recipes do not wait for a response, thus there will not be any
reply output. If your use case requires information from a called recipe (asynchronous), you can use Lookup table actions to pass the information.
# Workaround using lookup table
- Call recipe (asynchronous) with a unique ID. You can use the job ID of the main recipe or a unique timestamp.
- After the called recipe has finished processing, Add an entry to the lookup table with the unique ID.
- Next, retrieve the lookup table entry with the Search entries action using the same unique ID.