Power Automate which exceeds the maximum nesting limit of ‘8’

Last month, while working on a document management system for our courses, I had to build a flow with more than 10 levels of approvals. Each level depended on a different condition, and when I added the 9th Condition action, I tried to save the flow. I ran into the error:

The power flow's logic app flow template was invalid. The template actions 'Condition_9' are nested at level '9' which exceeds the maximum nesting limit of '8'.
The power flow's logic app flow template was invalid. The template actions 'Condition_9' are nested at level '9' which exceeds the maximum nesting limit of '8'.

In this tutorial, I’ll explain why this error occurs and walk you through the different ways to prevent and fix it in Power Automate.

[Error] are nested at level ‘9’ which exceeds the maximum nesting limit of ‘8’.

The error “are nested at level ‘9’ which exceeds the maximum nesting limit of ‘8’” appears when your flow becomes too deeply nested. This usually happens when you keep adding Condition actions inside other Conditions or placing Apply to each loops within other loops.

Power Automate has a strict limit of 8 nesting levels. Once your flow structure goes beyond that, like in my case, when the 9th Condition was added, Power Automate fails to save or run the flow and throws this error.

This limitation exists because deeply nested flows become harder to maintain, slower to run, and more prone to logical errors. Power Automate prevents this by enforcing the maximum nesting depth.

If you want more details about the platform limitations, you can refer to Microsoft’s official documentation.

[Solved] are nested at level ‘9’ which exceeds the maximum nesting limit of ‘8’.

When checking many different values, such as approval levels, document types, or data types, a Switch case is the best option to avoid deep nesting.

Instead of stacking one Condition inside another, you can:

  • Add a Switch action and use your main variable (like data type, approval level, or document category) as the switch expression
  • Create individual cases for each expected value
  • Perform the required actions inside each case

This reduces the nesting level dramatically because all cases exist at the same level within the Switch block.

In my example, rather than creating 10 nested Conditions, I simply created 10 cases inside a single Switch action.

'exceeds the maximum nesting limit of '8'' error in Power automate

If the Switch case does not fully solve your scenario, Power Automate provides several other techniques to reduce nesting.

Option 1: Reduce the Number of Apply to each Loops

Whenever you use an array, Power Automate automatically wraps your action inside an Apply to each loop. However, not all arrays actually require looping.

For example, when processing approval responses, sometimes the array contains only a single item. In that case, you can safely remove the Apply to each loop to save a nesting level.

are nested at level '9' which exceeds the maximum nesting limit of '8'.

Option 2: Replace Condition Actions with IF Expressions

As we are using a condition to update the single value in the same action. For example, change the value of a SharePoint field, send an email to a different user, and so on. In such cases, the if expression might be used instead of the ‘Condition’ action.

Option 3: Combine Multiple Checks Inside One Condition

If multiple conditions lead to the same outcome, you don’t need separate Condition blocks.

Power Automate allows adding multiple rows inside a single Condition using AND/OR logic.

For example, if two or more document types require the same approver, add them all to a single condition block rather than creating separate nested ones.

Option 4: Redesign the Flow to Avoid Deep Nesting

Sometimes the flow becomes complex simply because too many operations are packed inside one branch.

Instead, break your logic into:

  • Condition 1 -> perform action
  • Condition 2 -> perform next action
  • Condition 3 -> perform next action

These do not need to be nested inside each other. This reduces nesting and improves readability and maintainability.

These methods, including the Switch case, are reliable ways to fix the “nested at level ‘9’ which exceeds the maximum nesting limit of ‘8’” error in Power Automate. By reducing unnecessary loops, combining conditions, using expressions, or restructuring the flow, you can ensure your automation runs smoothly without hitting nesting limits.

Also, you may like the following tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App