Edit

Share via


Use scopes to organize actions in cloud flows

Scopes are a unique type of control action in Power Automate. You can think of a scope as a container that groups related actions together. When you run a scope, all the actions inside it execute as one single block. This makes it easier to manage, organize, and keep track of your flow, especially as it gets more complicated.

Benefits of using scopes

Scopes provide many advantages for organizing and managing your cloud flows, including the following:

  • Organization and clarity: Scopes help you organize complex flows by grouping related actions together. For example, you might create separate scopes for data validation, main processing, and error handling.
  • Error management: Scopes can work with run-after conditions to create try/catch/finally patterns. For example, you might set the Error Handling scope to run only if the Main Processing scope encounters a failure.
  • Bulk actions: You can quickly collapse or expand scopes in the designer, making it simpler to focus on a specific section of your flow.
  • Status monitoring: Each scope provides a status (like Succeeded, Failed, Skipped, and others), which can guide what your flow does next based on the outcome.

When to use scopes

Consider using scopes when you need to group similar steps, especially in longer, or more intricate flows. The following list includes some common situations:

  • Divide business logic, error management, data transformation, or notification processes.
  • Implement try/catch structures for better error control.

Prerequisites

Before you can use complete the procedures in Add a scope to your flow, ensure you have the following:

  • A valid Power Automate account
  • Access to Microsoft Outlook
  • Access to SharePoint

If you want to use actions other than the ones in the procedures (Outlook and SharePoint), ensure you have the necessary permissions to use those actions in your flow.

Add a scope to your flow

Power Automate allows you to use either the new designer or the classic designer to configure your cloud flow. The steps are similar in both designers. Learn more (with examples) in Identify differences between the new designer and the classic designer.

The examples in the following instructions use actions to create an email and update a file in SharePoint in the new scope you create. You can replace these actions with any other actions that you want to group.

  1. Sign in to Power Automate.

  2. Create or open a cloud flow.

    To open a cloud flow:

    1. On the navigation menu to the left, select My flows, and then select a flow.
    2. On the command bar, select Edit.
  3. In the designer, select the plus sign (+) below the trigger or action where you want to add a scope.

  4. In the Add an action search field, enter scope.

  5. Under the Control heading, select Scope.

  6. To add the first action you want to include in the scope, select the plus sign (+) inside the scope in the designer.

  7. In the configuration pane, enter send an email, and then select the Send an email notification (V3) action under the Mail heading.

  8. To add another action to the scope, select the plus sign (+) below the Send an email notification (V3) card inside the scope in the designer.

  9. In the configuration pane, enter update file, and then select Update file under the SharePoint heading.

    <Screenshot of a scope in the new designer with two actions inside it: Send an email and Update file.>

Known issues and limitations

  • Power Automate supports a maximum of eight (8) nested levels of actions, including scopes, conditions, switch cases, and apply-to-each loops. Flows exceeding this depth don't save or run.
  • When a scope fails, it reports a single Failed status for the entire scope. To identify which specific action caused the failure, you must expand the scope.
  • Flows with a high number of actions or deeply nested scopes might experience slower performance in both the flow designer and during execution.
  • Triggers and response actions should remain outside of scopes. To improve clarity and maintain proper flow behavior, keep entry and exit points separate.

Best practices for using scopes