โ01-15-2021 04:17 AM
[Dec 3, 2020] Mike Power (CRM Enterprise Architect at American University) posted:
Good afternoon all,
I have a parent recipe that retrieves records from an outside source, then loops through each transaction and calls a child recipe to process that individual transaction. When all are done, it marks a flag that all transactions are complete.
Currently I make the calls to the child recipe synchronously so that when I get to the last steps in the parent recipe, I know theyโre all done. Recently I started hitting that 90 minute timeout in Workato.
So Iโm considering how to re-do things.
My initial thoughts are to call the child recipe asynchronously (though it seems to only allow it up to 5 times in parallel, where I may have a couple thousand transactions to get through), then at the end of the parent recipe update either a Lookup table or maybe thereโs something in the pub/sub I can utilize (though I havenโt read up on that yet). Then maybe each child recipe, when they finish, they update either the Lookup or pub/sub so that a recipe gets triggered to compare the count completed with the total count (recorded by the parent recipe when it finished), and only when they equal does a triggered recipe update the flag.
Clearly this is half-baked and Iโm just starting to think it through. Iโd welcome any thoughts from anyone who has already cracked this nut before.
โ01-15-2021 04:24 AM
[Dec 11, 2020] Deepak Mohan from Box replied:
Instead of calculating the time taken, use "is lastโ option and add a condition when its met to take further action may be in another recipe.
โ01-15-2021 04:30 AM
[Dec 4, 2020] Gordon Hu from WeGalvanize replied:
Hi Mike,
It looks like you are using synchronous recipe to monitor success/failure. Iโve done it the same way but not in a big for-loop so havenโt encountered the 90-min time out yet.
I have an idea:
Pros:
Having said that, we may run into API limit โ given the number of iterations. I have sometimes โslowed downโ my iteration by using this trick
--
And I havenโt read pub/sub yetโฆ..gotta do it!
โ01-15-2021 04:31 AM
[Dec 4, 2020] Mike Power (CRM Enterprise Architect at American University) replied:
Thanks for the response Gordon. I actually donโt need to worry about the child recipes at all b/c they are doing just that, they are logging out their status within their own execution, and if anything goes wrong with them they are creating a Task in Dynamics CRM to draw our attention.
So the parent recipe really doesnโt need anything from them.
The key is simply waiting until theyโre all finished before updating the flag that theyโre all done. Thatโs the part Iโm still not sure the best way to accomplish that avoids the 90 minute limit.
โ01-15-2021 04:32 AM
[Dec 4, 2020] Gordon Hu from WeGalvanize replied:
Mike,
I have a not-so-smart but quick workaround ๐ .
Create two Box files (doesnโt have to be box, just need somewhere to store the value)
Parent Recipe:
Chile Recipe: