[SalesForce] Order of Execution of WF Rules and Process Builder on the same object

I was reading docs and was surprised by the following sentence:

Warning For a given object, use either workflow rules or processes — not
a combination of the two. If you use both, you can’t predict the order
in which they’re executed.

I thought that the order of execution is quite definite and WF rules are followed by processes. Isn't it?

PS. The question is not about best practice, I understand that if you have a trigger, WF rule (+ field update), and PB (+ field update) on the same object,
then you can suffer from up to 6 (six!) trigger calls in the same context.

before/after => WF (then again before/after) => PB (then again before/after)

So the question is more about the order of execution in such a complex (poorly designed, legacy) environment.

Best Answer

I would think of a scenario where workflow flow field update as an action and process builder post action should not be used on same object.

According to order of execution, if we update a field via workflow and if before/after trigger exists, then trigger will fire on that object.

Now, if on the same object process exists and updates a field then again it will fire before/after trigger again.

So, unnecessary triggers are firing twice (one for w/f & other for process) and bringing the complexity of execution.

I think we will not mix same operations in both workflow and process.

Like, in the same object, if I need to update field, send email, I can either use one of them.

For fresh development, I will look for process builder which gives me lot of flexibility. For earlier developed code which is running on production where workflows exist, there either I will disable all the workflows and transform all the workflows in process or I will continue to use workflows.

Actions of Workflow and Process Builders

workflow process comparison

If I need to work on time-dependent action which not supported by process builder, I will go for workflow.

Likewise, for those actions which are not supported by workflow, I will go for process builder.

This is my understanding.

Related Topic