Categories: Microsoft Flow

Improve your flow’s performance in a few easy steps

In recent days I’ve had a look at performance in Microsoft Flow and how to improve the performance of my flows with easy steps or patterns. We all know that nested Apply to each steps are not a great idea or maybe …

Therefore I started by creating some nested apply to each steps. If you do a bad job then do at least a really bad job!

I’ve got a number of set variable actions and a number of compose actions. All of these are building up some HTML out of data collected from SharePoint using Get Items actions.

To run all of this within an apply to each about 45 times takes 16 minutes. Pretty performance poor isn’t it?

I decided to optimise the flow a bit by adding Select statements straight after the Get Items actions and I gained 10 minutes. Simply by adding all the complexity into a single select my flow started to perform a lot better

I always thought that the usage of the variables would really cause the performance trouble as Flow is waiting for  locks on the variables. Both versions of the flow are using the same number of variables and the same number of compose actions.

Time to look at the details.

Within the original Flow within the Apply to each there were a lot of expressions used. Moving these expressions from the nested apply to each steps to a single Select action reduced the complexity in the nested Apply-to each steps.

In the optimised flow I put all my expressions in the Select action.

This now means that as I use a Set Variable inside my apply for each becomes very simple a set of references to my data returned by the select.

Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using

Recent Posts

Call Microsoft Graph from an HTTP Action vs Custom Connector in Power Automate

Is there a difference between calling Microsoft Graph Endpoints using an HTTP action or creating…

5 days ago

Calculate the Sum for a SharePoint column in Power Automate

Last week Shane Young asked me about calculating the Sum for a SharePoint column in…

1 week ago

Object must implement IConvertible in Power Apps

In Power Apps when you do a Patch to create a new item or to…

2 weeks ago

Get started with adaptive cards in Power Automate

Getting started with adaptive cards can be difficult. In this post i have written some…

3 weeks ago

Create PDF documents from data in Power Automate

In this post I will look at how to create PDF documents from data. Use…

3 weeks ago

Unnest nested arrays in Power Automate

We all know this problem, you have a nested array in Power Automate but how…

4 weeks ago