Exception Handling In Power Automate Flow

Exceptions are runtime anomalies or abnormal conditions that a flow encounters during its execution. Using exception handling, we can receive notifications or log errors in case there is some error during execution of the Power Automate flow.

There are three blocks in handling exceptions in any Power Automate flow.

Try

Represents a block of actions that can throw an exception.

Catch

Represents a block of actions that is executed when a particular exception is thrown.

Finally

Represents a block of actions that is executed as the Final step.

Exception Handling in Power Automate flow

Here are the steps for exception handling in Power Automate flow.

Step 1

Add three Scope controls in your flow. Scope encapsulates a block of actions and inherits the last terminal status (Succeeded, Failed, Cancelled) of the actions inside.

Step 2

Rename these scope controls Try, Catch, and Finally.

Step 3

Add all your logic actions/ steps in the Try scope.

Step 4

Change run after setting the Catch scope to run only if the Try scope has failed, is skipped, or has timed out. Uncheck ‘is successful’.

Step 5

In the Catch block, add logic to set variables for logging purposes and status.

Step 6

In Finally block, you can either log the error message in any SharePoint list or send email notifications to some group or individual with error details, or both.


Similar Articles