Using Concurrency Control & Degree of Parallelism in Power Automate Flow.

 Hello Guys,

In our previous blog we have seen how easily we can store these 5000 records in Array. Today we are going to learn one of the important feature of Power Automate Flow which is Concurrency Control.



Do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.

First of all we will create one manual flow which will retrieve Account records. For time being I have already created the flow which is as shown below. Here we are retrieving top 100 rows.



Now we will iterate this flow and try to update one field of account.



Now we will run the flow and check the output.




As you can see flow has run successfully. Also if you expand the Apply to each step you will see that here apply to each loop is running in sequential manner which means one after another. we can control this sequential manner by enabling concurrent control for the step.

By enabling this feature we can run the inside step of Apply to each loop parallelly also we can limit the highest number of step run that can run at the same time or parallel. Let's see how to do that.

Click on three(...) dots of apply to each step and click on Settings.



Enable the feature, Save the changes and run the flow.  



As you can see previously to complete Apply to each step it took 2 min. Now due to parallel run it got completed in 15 sec only. This conclude If we enable concurrency control on Apply to each action then this action will execute more smoothly and our flow will take less time to run.

You can enable Concurrency Control on trigger action also. For example we have created one automated flow as shown below:




click on three(...) dots and select settings.




Now when we enable concurrency control you can see one more option which is Degree of Parallelism. Using this setting you can set how many instance of the flow should run at a time. 

By default this value is 25 but you can set it to from 1 to 50. So if you set degree of parallelism to say 1 then it means only two instance of the flow can run at a time. Once it is completed then only the next instance will run or else it will be waiting in queue to be run. Let's change the degree of parallelism to 3 for apply to each loop and see what output we are getting.





As you can see previously this step was taking 15 secs to complete the execution. Now it took 30 secs. This means at a time only 3 updates will be completed parallelly and rest have to wait in a queue.

Note: While working with concurrency control keep in mind that once this control is enabled, it can not be disabled. Also here execution is in parallel so data can become corrupted if the Flows depend on the data to perform actions since the data is changed by its previous run

Hope it helps...



Comments

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Using Pipelines in Power platform for deploying solutions to environments.

Understanding Sales Process in D365.