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