• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Log in
  • ☰
  • Solutions
  • Forums
  • Tickets
New Topic
Discussions Recipe Building Recipe Building Questions
B

Brad Eisenberg

started a topic about 2 years ago
Answered

Looking for strategy to prevent a recursive loop

I have a recipe that triggers off of updated events in Google Calendar. In the recipe, I want to record a history of the RSVP status of event guests. Every time the event is modified, I want to record the time, name, and response status of the event guests in the Event description.


The issue here is that using the Update Event action in my recipe to record the response history triggers my recipe to run again which puts the recipe into a recursive loop.


Usually when I have a recipe that is triggered by an update, I add a filter to the trigger to not process records that have some condition which I can set in my Update action later on. In this case however, I want the recipe to continue checking for future event updates and RSVP responses so that strategy won't work.


Any ideas?


Best Answer
B
Bryan Yap said about 2 years ago

Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode. 


Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.


You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.

Answer

Bryan Yap

said about 2 years ago

Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode. 


Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.


You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.

B

Brad Eisenberg

said about 2 years ago

Fantastic idea Bryan! I actually ended up implementing another strategy - I had my recipe add a time stamp to the last row of the event description when making automated updates from the recipe, and also added a condition to my trigger to parse the description of newly modified events and disregard those with a time stamp within the last minute.


It's an imperfect solution, as it eliminates events that have been validly edited by users within that time window, but it's done the trick so far.


As I continue to tinker, I'll consider you hash strategy as an alternative. My only concern with your idea in my case is the sheer number of events the recipe is processing. A reference spreadsheet could become unwieldy.

Bryan Yap

said about 2 years ago

Hi Brad,


Agreed, if you are intending to have numerous events being processed by the recipe, then I would recommend that you consider making use of a production grade database such as SQL Server using our SQL Server connector. Google sheets and CSVs are only a good fit for cases where the recipe load is low. Alternatively, if you are open to trying, I believe you can also try writing the data to other databases such as firebase/firestore. But in that case, you would need to make use of our HTTP connector to do CRUD operations.

Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Expert Hour
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
Workato 2018 © | Privacy | Terms | +1 (844) GO-WORKATO
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato