Solved

Multiple hook execution order

  • 17 February 2023
  • 5 replies
  • 54 views

Badge

Hi there.

If a hook is used in multiple workflows, in what order are the workflows executed? I want them to run in a certain order.

I want to execute a specific action after the user is created, but if I write it in a conditional branch, the code is used in two branches and I want to divide it into multiple workflows. For this purpose, I am looking for a way to execute the workflows in order. I think it can be done by calling another workflow from a workflow.

Thanks.

icon

Best answer by Anonymous 17 February 2023, 17:49

View original

5 replies

Hi @ryush00,

The workflows will trigger at the same time and most actions will run at the same time. There is no guarantee that certain actions will run in order if the hook is added to multiple workflow. The best thing to do in this scenario is to create one workflow that uses the hook and runs your first set of actions and then create scheduled or callable workflows at the end of each the first workflow to run the next set of actions. This is the only way to ensure that the actions happen in a certain order. 

 

Josh C - Sr. TSE

Badge

Thank you for reply! 😀

 

I’ll check these articles!

Badge

@josh.carroccia A few questions…

  1. What is the shortest amount of time that can be scheduled for a callable workflow? I see it is down to minutes, is it possible to schedule down to seconds?
  2. Is there an estimated amount of time that all actions are ran?

@josie Thanks for the question. 

 

  1. You can set a lower amount under 1 minute but it needs to be done by editing the workflow json directly. Here is a video, the values are store in seconds so you can just enter the time in seconds you want. 
  2. The actions are ran immediately once it is triggered. So if it is 5 seconds, it will will run 5 seconds after it is scheduled. There are rate limits though. which are described here. https://help.kustomer.com/en_us/scheduled-workflows-H1ydD61hZ, 1000 runs per 15 minutes across all scheduled workflows within an organization.
Badge

Thank you so much, @josh.carroccia !!

One more follow up Q to #2 - is there a way for me to find out how many runs per 15 minutes is happening within my Org?

Reply