Power Automate Standards: Performance Optimization

Power Automate Standards: Performance Optimization
Table of Contents
• Enable Concurrency Control In Apply To Each LoopsExecute Flow Actions In Parallel BranchesUse Filter Queries When Retrieving Large DatasetsReduce Table Sizes By Selecting ColumnsStay Below The Data Connector API LimitsIdentify Bottlenecks With Process AdvisorFavor Compose Over Declaring Variables When Creating ArraysExploit Batch Update APIsAvoid Using On-Premise Actions


Enable Concurrency Control In Apply To Each Loops

Apply To Each loops run sequentially by default. If there are 20 items to loop over, the flow will run them in order: 1, 2, 3… until it reaches item 20. Enable concurrency control in the Apply to Each action settings to run up to 50 actions at the same time.




Execute Flow Actions In Parallel Branches

Power Automate executes flow actions in sequence. But actions can also be run in parallel when they are not dependent upon each another. For example, a flow that gets multiple lists of items in sequence may be reorganized to get all lists of items at the same time.




Use Filter Queries When Retrieving Large Datasets

It takes more time to retrieve a large set of records from a datasource than a small set of records. Apply filters when fetching data to reduce the number of rows being downloaded.

If there is no option to filter the records before downloading them use the Filter Data Operation immediately afterwards. Smaller datasets require less iterations in loops.

Example: Dataverse – List Rows action




Reduce Table Sizes By Selecting Columns

Similarly, a table with more columns is slower to download than a table with less columns. Always define which columns should be selected to minimize the size of the dataset being downloaded.

Example: SharePoint Get Items action



Example: Dataverse – List Rows action




Stay Below The Data Connector API Limits

Every flow data connector has API limits for throughput. After a set number of API calls per minute the data connector will become throttled to protect the service. Be aware of the API limits for each connector used in a flow. API limits can be found in the Power Automate documentation for the data connector.

Example: Dataverse connector limits




Identify Bottlenecks With Process Advisor

Process advisor tracks the average duration of individual flow actions as well as total duration. Inspect flows using process advisor to see where bottlenecks are occurring. Focus attention on the slowest actions when improving the flow.




Favor Compose Over Declaring Variables When Creating Arrays

The Compose action executes twice as fast as declaring variables. For large arrays this is a huge time saver. Use Compose instead of a variable to build arrays when the array does not have to be modified.




Exploit Batch Update APIs

Look for batching capabilities in APIs. Batching allows us to do a high-volume of transactions at high-speed. For instance, SharePoint lists have batch create, update and delete abilities only accessible through the SharePoint HTTP action. Read the API documentation for the desired service to check if this is available.




Avoid Using On-Premise Actions

Flow actions that connect to cloud resources are faster than on-premise records. For example, it would be faster to access files stored in OneDrive than files stored on the local File System via a gateway.




Questions?

If you have any questions or feedback about Power Automate Standards: Performance Optimization please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Subscribe
Notify of
guest

6 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Johannes
Johannes
6 months ago

Under “Enable Concurrency Control In Apply To Each Loops” you have written:
“Apply To Each loops run sequentially by default.”

This does not seems to be the current default behavior. In Power Automate I find this description:

“By default, Logic App instances run at the same time, or in parallel. This control changes how new runs are queued and can’t be changed after enabling. To run as many parallel instances as possible, leave this control turned off.”

Johannes
Johannes
6 months ago

Hi Matthew,
this is the official description in Power Automate in the Apply to each action under Settings -> General -> Concurrency Control.

Screenshot_20240407_133547.jpg
Tim Wilkinson
Tim Wilkinson
4 months ago

Hi Matthew. I just did a quick test in the new interface. I have a flow with an Apply to Each that loops through 1000 records in a csv and has a couple of compose steps to convert it to a JSON object.

With Concurrency Control set to “On” and Degree of Parallelism set to “30”, it took 15 seconds to complete.

With Concurrency Control set to “Off” it took around 4 minutes to complete.

Based on that I think it is pretty clear the text in the new interface is wrong. I also note it says that once Concurrency Control is turned on, it can’t be turned off (which is false as I was able to turn it off) and that it references “Logic Apps” and not Power Automate. I realise the new interface is based on Logic Apps, but you would think it would reference the correct product.

TL;DR: your understanding that Apply to Each steps run in serial by default and that the new editor isn’t yet ready yet seem to be correct 🙂

Nikhil Parikh
Nikhil Parikh
1 month ago

I have a flow which is getting data from dataverse performs data manipulation and updates into Salesforce. I added parallel processing to improve performance and it helped to a certain extent but still there are few actions whoch take a lot of time.

  1. There is a switch case and just to evaluate it takes 30 secs…..is there an alternate for it.
  2. in case of parallel actions does it internally processes actions towards the left faster then towards the right.
  3. Instead of having all code in one big flow is it a good idea to make child flows and call them….would that improve performance.