Error handling

Completed

When a failure happens in a Power Automate cloud flow, the default behavior is to stop processing. You might want to handle errors and roll back earlier steps in case of failure.

A solution architect should specify how errors are to be handled within cloud flows.

Run after

The way that errors are handled is by changing the Run after settings in the steps in the flow. The available settings are:

  • Is successful (the default setting)
  • Has timed out
  • Is skipped
  • Has failed

You can adjust the Run after setting by opening the Settings tab of the action and scrolling down it (see the image below). By default, the action just preceding the current action shows, but you can also use the Select actions choice to pick a different preceding action to base the run after conditions on.

Whatever you choose determines the condition for running your step. In the example below, the Send a push notification runs only if the Get a row by ID step has failed. This is a way to handle errors, by sending someone a notification in the event of a step failure.

Screenshot showing the run after settings.

Observe how each action has a color associated with it that will show up in the flow designer. In the example above, since we selected the condition Has failed, a red dot appears above the step as a visual cue that this step has a defined run after condition.

Parallel branches

When using the run after settings, you can have different settings for success and failure by using parallel branches. Our image below shows how the Run after setting for the step on the right side of our branch uses the default setting of Is successful. Both use the same action as their initiator but behave differently based on what happens as the action executes.

Screenshot showing the parallel branch with run after.

Changesets

If your flow needs to perform a series of actions on Dataverse data, and you must ensure that all steps work or none of them work, then you should use a changeset. The Perform a changeset request action allows you to perform a group of Microsoft Dataverse connector operations as a single transaction. If one of the operations fails, all the successful actions are rolled back.

As of November 2024, you must be in the classic designer to call this action into your flow.

Screenshot that shows a changeset in flow.

If you define a changeset, the operations run in a single transaction. If any of the steps error, any changes made by these steps will be rolled back.

Note

Changesets are only available with the Create, Update, and Delete actions in the Dataverse connector.

API limits

The platform has API limits and service protection limits. Power Automate observes these limits; each step in a flow consumes an API call.

Limits are also applied for certain actions in Power Automate and for Power Automate:

  • Many operations like the Apply for Each loop only work up to 100,000 iterations. You might be required to partition work when working with large sets of items.
  • The Do Until loop has a default of 60 loops or 1 hour of run time. If it exceeds these limits, it exits the loop without error. You can increase the number of loops and time in the settings for the action.
  • Flows can run for a maximum of 30 days. You shouldn't use long running flows; use scheduled flows that check if the row needs to be processed instead.
  • Connectors have throttling limits, for instance, the Dataverse connector permits only 6,000 API calls for each connection every 300 seconds.