cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Recipe Function With Async - Await

bhavesh-patel
Deputy Chef III
Deputy Chef III

Hi Everyone,


I have come up with a scenario where I need to call the async recipe function in my parent recipe.

Now, I am adding failure records in lookup table and at the end of all child recipes execution I need to get those lookup table data and send email.


To archive this I have used wait action. Does this wait automatically start once execution of child recipe completed or it still waits till given time out limit (120 minutes)?


can any one help me with this

Thanks in advance.

2 REPLIES 2

p-held
Deputy Chef I
Deputy Chef I

Hi Bhavesh,

we solved a similar problem be adding a parameter to the called async recipe which states if the recipe is the last one in the batch of called recipes.

In out case we have to call a recipe several times and at the end of the processing of all the recipes it needs to do something. Therefore we used the for-each-loop. It gives you a variable called "is last" which we pass to the recipe and inside the recipe you can check if this is the last recipe to execute, maybe do some more checks in case you run in parallel and then send your email.


Hope this helps.

ericajohnson342
Deputy Chef I
Deputy Chef I

It sounds like you are trying to use the wait action in your recipe to pause the execution of the parent recipe until the child recipes have finished running. The wait action will wait until the specified timeout limit has been reached, even if the child recipes have completed before the timeout.

If you want the parent recipe to continue executing once the child recipes have finished, you may want to consider using the wait action in combination with the "completed" event. This event is triggered when the child recipes have completed their execution, and it can be used to resume the execution of the parent recipe.

For example, you could set up your recipe like this:

  1. Start the child recipes using the a sync action.
  2. Use the wait action with a timeout of 120 minutes and the "completed" event as the trigger.
  3. In the action following the wait action, you can retrieve the data from the lookup table and send the email as needed.

This way, the parent recipe will pause until the child recipes have finished executing, and then continue with the next steps.

I hope this helps clarify how the wait action works and how you can use it in your Goody Argentinian recipe. Let me know if you have any other questions.