Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Making the ‘Append to’ loops in your Power Automate flow faster

Posted on May 24, 2023May 24, 2023 by Tom

“I’m adding multiple attachments to an email but the appending loop seems to be quite slow, how can I make loops faster in Power Automate?”


As already explained in previous articles, if your flow is slow, it’s probably due to unnecessary loop(s). An ‘Apply to each’ that can be often replaced with a select or a filter. But in some situations you still need a loop. For example, if there’s another action involved, e.g. ‘Get file content’ when preparing email attachments. Can these loops be at least a little faster?

Enable parallelism

If you really need a loop, one way to make it faster is to turn on parallelism. Go into the ‘Apply to each’ settings under the three dots…

… and enable the Concurrency control. Move the slider to the right to enable the maximum, 50 parallel branches running at once.

Power Automate loops faster

With this setting it’ll start processing all the items in the input array at the same time. Just be careful about using variables in parallel loops.

Use ‘Compose’ instead of variables

The other improvement comes with the use of ‘Compose’ action instead of a variable. If you used variable, you’d probably append to that variable in the loop and use it later in the flow.

Yet you don’t need a variable. You can use just the ‘Compose’ action where you define the input for each loop…

…and collect the composed output after the loop with an expression. You must always use an expression as it’s not something the designer will offer among the dynamic contents.

outputs('Compose')
Power Automate loops faster

This approach will give you the same result as a variable, but in a faster way. Use it later in the flow in the same way as you’d use the variable, in this example to add the email attachments.

Summary

If there’s no way to remove loops from your Power Automate flow, yet you need them to run faster, you can try one of the solutions above. If you enable parallelism it’ll process up to 50 loop runs at the same time, giving a significant performance boost. And if you use the ‘Compose’ workaround instead of variables you can improve it even more.


🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

7 thoughts on “Making the ‘Append to’ loops in your Power Automate flow faster”

  1. iBro says:
    November 24, 2023 at 9:20 am

    Current implementation does not support accessing Compose like that in a nested Apply to Each.

    Reply
  2. Pingback: Reduce the number of variables in your Power Automate flow
  3. Pingback: Speeding Up Power Automate: Replacing 'Append to Variable' with 'Compose' for Efficient Workflows - Fredrik Engseth
  4. Colum says:
    June 18, 2024 at 12:35 pm

    Hi,

    Firstly I would like to complement you on your blog and newsletter. They have greatly helped my team and I implement Power platform solutions in our organisation, and we have borrowed from a lot of the approaches you describe.

    I am writing today because we have noticed that the behaviour of the ‘outputs’ function described in this post has become unstable recently. We have noticed this week that occasionally it will not append all elements to the output array. The items in the loop look fine, but the outputs expression only grabs the last item, or only the first and last… We have seen different cases and haven’t yet been able to establish real pattern, although we think it has something to do with the difference in the duration of the different iterations of the loop. The first examples we found had one iteration that took four days to complete, while the rest of the iterations only took a couple of hours. I am currently running some tests, but I can already see that even when one iteration has a duration of one day, and the others only a couple of seconds, the result is not as expected.

    I was wondering if you have previously come across any issues like this or if you are aware of any limitation regarding the maximum duration?

    Thanks,
    Colum

    Reply
    1. Tom says:
      August 17, 2024 at 2:17 pm

      Hello Colum,
      I didn’t encounter such behaviour and I’ve been using it in many of my flows, but probably none of them is taking hours/days in the loop. If it’s doing some simple task then I’d expect it’s some issue on Microsoft side.
      When I built flows that were running for long in the past (e.g. parallel approvals in a loop) I think I used appending variables as in that case the performance didn’t matter.

      Reply
  5. Marin says:
    February 11, 2025 at 3:49 pm

    In regards to this comment: “…and collect the composed output after the loop with an expression.”

    Wouldn’t that value just be the last value in the loop?

    Reply
    1. Tom says:
      February 22, 2025 at 7:38 pm

      Hello Marin,
      it’ll be an array containing all the outputs from the first ‘Compose’ action.

      Reply

Leave a Reply Cancel reply

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

🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes