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'.

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.

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.

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:
- Invalid Connection. Please Choose a Connection Power Automate
- [Solved] You do not have permission to view the membership of the group in SharePoint
- The execution of template action ‘Switch’ failed – Error in Power Automate
- The DateTime String must match ISO 8601 format error in Power Automate
- Power Automate Approval Templates to Automate Business Processes

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.