Workflow sequence when multiple workflows fire on same record

Just wanted to share this with y’all, in case somebody might be able to save some time on this question.

I have two workflows (WF) set up for leads coming in from a web-form:

WF1: populate custom field for leads containing salutation = “Mr.”
WF2: send email with an email template that uses the custom lead field set by WF1.

Now for the Email to contain the contents of the custom lead field populated by WF1, the WF1 must complete before WF2. If WF2 fires before WF1, the email that’s sent out will not contain the custom field information.

So what I found out for such cases, is that it’s simply the workflow ID that determines which workflow fires when. It seems that all else being equal workflows simply fire according to ID, alphabetically (or by number size if you like). 1<2<3<4<5<6<7<8<9<a<b<c<d<e<f

Example 1:
if WF1 has id = 103ea175-cebb-0ca6-f496-5887a143dac7 and WF2 has id = 410c1d0f-a0ea-ecdd-7e08-59f762daf232, then WF1 will fire before WF2 and all will be good.

Example 2:
if WF1 has id = a61dc0eb-7b40-6438-bb45-59d635a1c897 and WF2 has id = 8c8d1d2d-2434-83af-1767-58eba7dc0db5, then WF2 will fire before WF1. In this case the Email sent out by WF2 will not contain the information added to the custom field by WF1.


So. If I need workflows to fire in a certain sequence, I need to make sure the ids of said workflows start low and end high.

If I need to change the sequence I’ve found the best way to go is to duplicate one of the workflows while monitoring the ID given to the duplicate, until you have one that lines up with the others the way you want. Then you can delete the other copies you don’t need…

dirty, but it works.


Naturally, a feature would be nice to somehow put workflows in a certain order, for cases where the same record will fire multiple workflows at the same time and the workflows require a specific order.

1 Like

Hello,

I’ve just tried it on our version 7.8.7 and it didn’t work. IDs, names etc. had no affect on the sequence.

The sequence of how our workflows are executed, seems to be by creation date.
The oldest is being fired first.

So I had to duplicate WF1.
Now, WF2 has been created earlier than the (new) duplicate of WF1 and the order/sequence of execution is correct.

Maybe you can solve it by simply creating an extra field that is updated when WF1 is fired. If WF2 finds the correct value then it can continue its execution otherwise it will wait until the next run.
Probably cleaner than your hack.

That won’t work for only on save and without repeated runs I guess?
But yes, we have a whole bunch of dropdown fields like you described and we never ran into a sequence issue there.