How to Set Up Error Handling in Power Automate
In Power Automate, error handling is built using a Scope action as a try-catch pattern. You wrap your main actions in a first Scope (Try), add a second Scope (Catch) below it, and configure the second Scope to run after the first one has failed. Inside the Catch Scope, you add a notification email and optionally log the error details to a SharePoint list or database table.
A flow without error handling fails silently. This how-to shows you how to use a Scope as a try-catch, send a notification on failure, and log error details for debugging.
Why error handling matters
Power Automate flows fail for many reasons: a connector loses authentication, a file is not where it is expected, an API returns an unexpected response, or a SharePoint site is temporarily unavailable. Without error handling, the flow quietly stops and no one is notified. With error handling, the failure triggers a notification with the relevant details so you can investigate and fix the issue the same day.
Step 1: Wrap your actions in a Scope
Add a Scope action and move all your main flow actions inside it. Name it “Try” or “Main”. This groups your actions so you can reference them as a unit when configuring the error handler below.
Step 2: Add a second Scope for the error handler
Add another Scope below the first one and name it “Catch” or “Error handler”. This is where you define what happens when something goes wrong in the Try Scope.
Step 3: Configure Run after on the error Scope
Click the three dots on the error Scope and select “Configure run after”. Check “has failed” and “has timed out”. Uncheck “is successful”. This ensures the error Scope only runs when the Try Scope fails, not on every successful run.
Step 4: Add a notification action inside the error Scope
Inside the error Scope, add a “Send an email” action. Use the dynamic value “Workflow run URL” from the flow details to include a direct link to the failed run. Include the flow name and timestamp in the email subject so the recipient knows immediately which flow is affected and when it failed.
Step 5: Log the error details
Add a “Create item” action to a SharePoint list, or an equivalent in a database table, to record the error timestamp, flow name, and error message. This builds an audit trail you can review when diagnosing recurring issues or when you need to report on flow reliability.
Step 6: Test with a deliberate failure
Temporarily break something in your Try Scope, such as pointing a SharePoint action at a non-existent list, and run the flow. Confirm that the error Scope fires and the notification arrives. Fix the deliberate break before publishing.
For flows that run on a schedule, combining this error handling pattern with a proper trigger setup is essential. See how to create a scheduled flow in Power Automate for the trigger configuration.
Our tip: Include the Workflow run URL as a link in your error notification email. Power Automate provides this as a dynamic value. It lets you click directly from the email to the exact failed run in the run history, which cuts your debugging time in half compared to navigating there manually.
Frequently asked questions
What happens without error handling in a Power Automate flow?
Without error handling, a failed flow stops at the failing step and marks the run as failed. Power Automate sends a generic failure email to the flow owner by default, but that email contains limited information and is easy to miss. No custom notification is sent, no error details are logged, and there is no automatic retry or escalation. You may not find out the flow failed until someone notices that data has not been updated.
What is the difference between a timeout and a failure?
A failure occurs when an action returns an error, such as a connector authentication error, a missing file, or an API returning a 400 or 500 response. A timeout occurs when an action takes longer than its maximum allowed time without completing. Both should be caught by your error handler. When configuring 'Run after' on the Catch Scope, check both 'has failed' and 'has timed out' to cover both cases.
Can I add a retry policy inside a Scope?
Yes. Individual actions in Power Automate have a Retry policy in their settings. You can set the number of retries and the interval. This is useful for transient errors like API rate limits or temporary network issues. A retry policy on the action itself handles short-term failures; the Scope-based error handler catches failures that persist after all retries are exhausted.
How do I get the error message from a failed action?
Use the 'result()' expression with the name of your Try Scope as the argument. For example: result('Try'). This returns an array of action results including status codes and error messages. You can use actions() combined with the action name for individual action details. Add this as dynamic content in your error notification email or log entry so you have the specific failure reason, not just the fact that something failed.