Workflows - Best Practices

When creating workflows is it more proficient to

  1. create 1 workflow trigger against a single module with many paths/events?
  2. create multiple workflow triggers against a single module that performs a specific task?

I have a lot of business rules (10 or more) that need to be applied to a single module. Each business rules has 1-many processes that need to be ran. From a coding standpoint its easier to split these out that way 1 bug in a workflow doesnt crash the other 10. But I’m not sure about performance doing it this way. Is performance the same either way or is 1 trigger/workflow that does 10000 things more efficient? Or is it more efficient to have multiple worklfows against the same module?

any update on this I have not seen any feedback from the corteza team on this topic?

I think this is more related to the business case rather than a standard

I would suggest creating one workflow at the beginning and extracting more if needed

@esnyder - I’m not an expert, but at a module level, for beforeUpdate, afterUpdate, beforeCreate and afterCreate triggers, I ensure that a trigger is only used in 1 workflow. If you have multiple workflows for a module using (for example) the beforeUpdate trigger, you run the risk of workflows competing with each other.

Thanks Mark for the tip, do you think having the same trigger for a module for different workflows for multiple purposes result in cases where a workflow works once and then again not work in other iterations?

I haven’t fully tested multiple workflows with the same trigger on the same module… But we avoid as workflows may have conflicting actions (e.g., modifying the same field) as it could lead to unintended results. It’s advisable to manage dependencies carefully, as one workflow might affect the execution of another if they rely on shared data. To avoid potential conflicts, consider using a single workflow with multiple paths or ensuring proper sequencing through delays.

1 Like

Thank you Mark for the reply, it’s really helpful. Have a good day

1 Like