cancel
Showing results for 
Search instead for 
Did you mean: 

Working around the 90 minute limit

jessica-lie
Workato employee
Workato employee

[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. 

8 REPLIES 8

jessica-lie
Workato employee
Workato employee

[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.

jessica-lie
Workato employee
Workato employee

[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:

  • if a child recipe fails, can it “self-heals” by using Monitor/Error + Retry? If so, we may let it retry itself a couple times.
  • Then, if the retry still fails – write the necessary information somewhere
    • Use another recipe to monitor this somewhere to alert you/or run in a different time/schedule. Ideally, we want this somewhere to be empty.

Pros:

  • We turn child from synchronous into asynchronous
  • Master recipe / Child recipe are likely to run within the 90-mins limit.

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

  • If iteration index is % x = 0, slow down for y second. This means I don’t have to slow down for each iteration but only on some iterations.

--

And I haven’t read pub/sub yet…..gotta do it!

[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.


jessica-lie
Workato employee
Workato employee

[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)

  • file_1: reference file – store the size of the for loop list
  • file_2: iteration update – default vaule = 0

Parent Recipe:

  1. Save the list size in file_1
  2. Create a for loop with the list size
    1. Call child recipe

Chile Recipe:

  1. Update file_2 = previous value + 1
  2. Do the job
  3. Compare file_1 and file_2’s value:
    1. If file_2 < file_1: ignore
    2. If file_2 = file_1: this indicate the whole loop is done, notify you, and reset both file_1, file_2