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: