The default behaviour of a Power Automate Flow is to allow multiple instances of the same flow running. But depending on the scenario or implementation, this can be a big problem, for example, a Flow that is triggered when an item is modified and then based on that iterates through a big list of items and updates a field.
Especially when it comes to SharePoint Online, the Flow can be throttled by the number of requests sent in a short period of time or in parallel (if multiple instances of the same flow run and execute a lot of calls to the SharePoint APIs at the same time). Or also, if multiple instances of a Flow execute at the same time, unnecessary actions or actions with wrong values (being changed by other instance of the flow that is not the current one) could be called.
How to avoid this behaviour?
To block this behaviour to happen, a simple option is available:
- Enable concurrency in the flow trigger and limit the degree of parallelism to 1.
By doing this, any extra instance of the flow is queued. For example, if 10 items are modified at the same time in a SharePoint list, only one instance of the flow would be running, and 9 instances of the Flow are queued. After the running instance finishes the execution, the next instance in the queue starts to execute and 8 are queued.
From the Flow trigger options menu, under settings, switch concurrency control to on and reduce the degree of parallelism to 1:
After updating the setting mentioned above, whenever the Flow different instances of the Flow are triggered within the Flow trigger time frame, the first instance triggered will be executed, and the other instances keep waiting until the running it is its time to run.
This can be monitored in Flow history:
By changing a simple setting it’s possible to implement a force your flows to be executed in a queue instead of parallel execution in Power Automate.
Hi Michael, Thanks for the tip.
I have one more question. I have the concurrency setting in my flow to 1. But i have an approval in the flow logic. If the other instances would have to wait until the approval is done.
Is there a way to set a timeout for this concurrency setting.
Meaning it shall not wait for more than 5 mins. If the flow execution takes more than 5 mins the next flow should run.
Please help me on this.
The other instances will have to approve until the approval is done, as the other instances only start when the active one is completed.
To force the active instance to be completed if a certain approval is not executed within your 5 minutes, you can create a parallel branch, add there a delay action specifying a 5 min delay, and then use a ‘Terminate’ action to force your Flow to be completed.
Hi Michael, do you know whether there is a limit on the amount of flow instances being queued. In the flow I prepared it looked like it could only handle 11 or 12 queued instances and the remaining were not visible in the run history.
Hi Joris, not that I am aware of, from my experience sometimes it just takes longer to appear in the run history if queued…