Improving Microsoft Flow Runtime using Concurrency Control

Satyvir Jasra, 22 October 2019

In Microsoft Flow, one of the most used controls is ‘Apply Each’ which is used to process a list of items. However, if there is a large list of items to process through, the ‘Apply Each’ action will run for a very long time, because only one item can be processed at a time. What if we could process multiple items at the same time? That’s where one of the most overlooked features comes handy – Concurrency Control. By default, for each loops run sequentially and we can override this by changing the setting of the ‘For Each’ control and turning on ‘Concurrency Control’.

Once the control is turned on, we can set the degree of parallelism too. I have set it to 50 (maximum).

Following is the run time of A simple Microsoft Flow logic that updated the names of around 1000 Account records without Concurrency Control turned on. It took 4 minutes and 33 seconds to process all those records.

Following is the run time of the same Microsoft Flow logic with Concurrency Control turned on this time and degree of parallelism set to 50.  This time it took just 15 seconds to run the same logic.

Just like a sequential for loop, in case there is an error while processing one of the items with concurrency turned on, the Flow will show the items it failed to run after processing all of them.