Quick tip: Force Power Automate Flows to be executed in a queue instead of multiple instances

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:
trigger_concurrency

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.

Results

This can be monitored in Flow history:

queue

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.

4 comments

  1. 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.

    1. Hi Mannar,

      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.

  2. 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.

Comments are closed.