Inkey Solution Logo
banner

Blogs

Concurrency Control In Loop In Power Automate And Logic Apps

, December 22, 2023 1861 Views

To understand concurrency control in loop of Power Automate Flow/Logic Apps, let us try to understand in this blog about, what is concurrency in a loop, how it is beneficial of us and when we do not need to manage concurrency.

What is Concurrency?

  • Concurrency means one kind of parallelism where the number of operations executed simultaneously based on the configuration. That’s it.
  • In Power Automate/Logic Apps, in any loop, by default, there are 20 operations run simultaneously at the same time.

Pros

  • As the actions execute simultaneously, the output becomes very quick.

Cons

  • This Is causing an issue if we need to use the result of previous action into the next action of the same loop. E.g. We need to manage the previous action ate time in the next action.
  • If suppose we are calling third party API, and if this third-party API has some throttling configured that is allowing only suppose 10 operations at the same time, then the default concurrency setting might cause an issue.

Resolution

  • Now, it’s time to resolve or manage the issues generally happens with concurrency.
  • To manage the concurrency, we do have an option in each and every loop in which we can configure the concurrency from default to level 1
  • It means only 1 operation at a time will be performed.

Let’s understand with a proper example. Suppose we want to send mail to users only after the previous loop is finished.

loop in power automate or logic app

message

  • In the above result, we can see that each mail was sent at the same time because of concurrent run every delay start at same time and completed at send time.
  • So, if you want to wait till the completion of first and the execution of next then you need to remove concurrency

Let’s see how we can control concurrency in loop.

concurrency control in loop

  • Click on the three dots icon and pick “Settings.”

  • Turn on the concurrency control toggle.

concurrency control in loop

  • Decrease the degree of parallelism to reduce the concurrency. If the Degree of parallelism is 1 then there will be no concurrency. By default, the degree of parallelism is 20.
  • If the degree of parallelism is 1 then only one iteration occurs at a time.

Let’s see the above example but now with degree of parallelism 1.

concurrency control in loop

We can see that each mail is sent after the previous loop is finished.

In the loop world of Power Automate and Logic Apps, controlling concurrency is like finding the sweet spot between speed and reliability. We’ve seen that speeding things up is great, but it can cause problems when tasks depend on each other. So, when you’re adding delays or want tasks to run one after the other, turning off concurrency is the way to go. Just toggle on the concurrency control, adjust the degree of parallelism, and you’re in control.


Know the number of records in any Dataverse entity or table.
https://www.inkeysolutions.com/entity-record-counter

ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://www.inkeysolutions.com/microsoft-power-platform/power-app/atm-inspection

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox

Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr

Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator

mm

Inkey

INKEY is your solution partner.
Our focus is to deliver you in-time intelligent innovative solutions ("key") for the problems in hand. Maintaining a quality standard right from the inception of a project is our top most priority.

Our team of talented professionals will execute your projects with dedication and excellence. We take ownership and accountability for the effort that goes into meeting our client’s needs.

Years of experience and proven success of delivering innovative custom solutions.

More posts by

Leave a Reply

Your email address will not be published. Required fields are marked *

The maximum upload file size: 2 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Drop file here

Would you like to digitize your business and put it on the cloud?
Do you need clear, concise reports for your organization?