Back to All

Best practice regarding flows that should not be run in parallel with itself?

Some flows are perfectly fine to run in parallel with itself.

But there are some flows that you wouldn't want to run in parallel with itself. For example when two instances of the same flow would process the same data at the same time, it could potentially cause problems or create an infinite loop (as it did not expect the data to be modified by another flow at the same time).

Mainly this could happen for index flows that triggers too often or takes longer time than expected so that they will overlap, or if you manually trigger a flow and it is already running - either by a timer trigger, a previous manual trigger or maybe even another person.

I assume the easiest is to just have a task in the beginning of a flow that gets it's own name and check if the currently amount of processes with that name and status.name:running is 2 (the original one and the current one), or >1 to be safe, and then quit.

Do you have any best practices for this or maybe a blueprint? :)