1 Flow Performance tip to get your flows out of the stone age

Are you flows slow, and did you wish that you could take your flows out of the stone age? Flow performance can be very important.

Why improve Flow performance?

In general there are two reasons to consider to improve the flow performance.

  1. A user is waiting for your flow to finish
  2. A lot of work is being done by your flow

Today I’m having a look at handling multiple arrays of data. In my example I will collect all connectors from my UK and Europe environments and I want a new collection of connectors that exist in the UK and also exist in Europe.

Collect two arrays of data

Imagine when you migrate your flows from a UK based environment to Europe and you want to make sure that all your connectors used are still available.

The slow flow performance way

At first you might think about creating two apply to each steps and step through all 308 connectors in the UK. For each of these 308 connectors you would go through the connectors in Europe and job done!

Nested Apply To each looking at all connectors

You will be waiting for a very long time.

Flow will now be running 308 * 308 times through the same steps.

Waiting forever to run

This flow will take more than 1 hour to run! I didn’t wait for it to complete and cancelled my flow after a while as I didn’t want to waste a lot of time waiting for my flow to complete.

In the above example I’m only comparing two arrays. In my example below I’m gong to have a look at 4 environments in 4 different locations. As I posted before the connectors available in each location does vary.

We will need to speed this flow up! Power Automate can perform better than this.

The intersection function

The intersection function does exactly the same as the above flow. The intersection function takes a number of arrays and will take items that exist in all arrays. I will however need to do a bit more than just run the intersection function.

The List Connector action will add some information in each array item that is specific to each of my environments. Running an intersection on the output form the List Connectors actions will simply result in empty arrays of data as the items in the arrays don’t exactly match.

To create a clean array of data I’m now pushing the List Connectors data through an Select action.

Create Clean array

I do the same for each of my environments making my data ready for the intersection function. For more information on the Select actions pleae have a look at Convert your time faster in Power Apps to all time zones using Power Automate.

Intersection function in action

And now we are down to 0 seconds when we run the flow! This is a massive improvement from over an hour run time.

0 seconds for the intersection

0 Seconds is good enough for me!

Some thoughts on Flow performance

It is important to massage your data using the select action. Using the select action it is possible to shape the data exactly the way that your flow needs your data. Doing this will then improve the performance of your flow.

When a flow is slow, run your flow and find the pain points, once the pain points are clear the performance improvements will be quite easy.

Related performance posts

In the past I’ve written quite a few more posts about performance in flows. Below a few posts that may help you improve your flow performance.

Improve your flow’s performance in a few easy steps

How to make your flows perform better

Convert your time faster in Power Apps to all time zones using Power Automate


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@sharepains.com

Related Posts

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading