Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

How to solve the nesting limit of ‘8’ error in Power Automate

Posted on February 13, 2022February 13, 2022 by Tom

“I can’t save the Power Automate flow I just built, it shows me the maximum nesting limit of ‘8’ error, how can I solve it?”

“The power flow’s logic app flow template was invalid. The template actions ‘xxx’ are nested at level ‘9’ which exceeds the maximum nesting limit of ‘8’.”


Even though Power Automate allows you to build very complex flows, it has limits. One of them is how deep you can go using the control actions like the ‘Condition’, ‘Apply to each’, ‘Switch’, etc. Each of these actions inside another one adds a new nesting level in the flow. Once you overcome the 8th nesting level, you won’t be able to save the flow. All the work you did on the flow could be lost just because of that.

Power Automate nesting limit error

This post will show you some solutions how to stay within this limit.

Use configuration list(s)

If the nested levels are caused mostly by ‘Condition’ actions, you should consider using a configuration list. Instead of many comparisons you could have a single lookup to find the corresponding value right away.

Power Automate nesting limit error

Reduce the number of ‘Apply to each’ actions

Every time you process an array in Power Automate, it’ll add ‘Apply to each’ automatically. But sometimes, e.g. when processing approval task response, it’s only a single item in this array and you don’t need a loop. While it’s ok to keep it in the flow as it’ll run only once anyway, you can save one nesting level if you remove it.

Check your flow for such ‘Apply to each’, maybe there’s one that you could remove.

Power Automate nesting limit error

Reduce the number of ‘Condition’ actions

From time to time you use ‘Condition’ only to change a value in the same action. Update a SharePoint field with a different value, send an email to different user, etc. In such situations you don’t need the ‘Condition’ action, you can use the if(…) expression instead as explained in the date formatting article.

Power Automate nesting limit error

Redesign the flow

Another approach, which is a bit more time consuming than the two above, might be to redesign the whole flow. Maybe you don’t need so many nested ‘Condition’ and ‘Apply to each’ actions. The flow could work just as well if you separate them – condition 1: do something; condition 2: do something else.

Summary

The Power Automate nesting limit error is not something you can disable. You must solve it, and it’ll require a change in your flow. It can be a big change as changing the whole flow design, or it can be a smaller change when you just replace a ‘Condition’ or an ‘Apply to each’ with an expression. The outcome is clear – maximum 8 nested controls, and it’s up to you how you achieve it.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

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

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme