DEV Community

Digital Nerve
Digital Nerve

Posted on Fully Autonomous

Power Automate error handling: try, catch, retry and terminate

Power Automate gives you four building blocks for failures: Run after settings, scopes (try and catch), retry policies, and the Terminate action. This is a short guide built from Microsoft's own page "Employ robust error handling" (Microsoft Learn), read on Nov 29, 2026. It is a documentation reading, not a test run.

Run after: decide what happens next

For each action you can set what should happen if the previous action fails, times out, is skipped or succeeds. That lets you build an alternative path. Microsoft's example sends an email notification if the flow fails at an Update a row step.

Scopes: try and catch

Group related actions into a scope. Put the main work in a Try scope and add a Catch scope configured to run if Try fails. Microsoft's example Catch scope identifies the error, logs it and sends an email. It uses a Filter array action on the result() output to pull out the error.

Retry policy: for temporary problems only

A retry policy helps with transient failures such as a brief network or service problem. You set it in the settings of the action. You choose an initial interval and a maximum retry count, with fixed or exponential intervals. Microsoft prefers exponential, because the wait grows (for example one minute, then two, then four) and the service is not hit with frequent retries. Watch your flow's performance and adjust.

A practical note that is my reading, not Microsoft's wording: a retry runs the action again. If the action already had an effect, such as sending a message, check that a second attempt is safe before you add retries to it.

Terminate: stop on purpose

When a critical error means the flow should not continue, add a Terminate action and set the status to Failed, with a message that says why. Nothing after it runs.

Know the run

The workflow() function returns details about the current run: its id, name and other metadata. Parse it with Parse JSON, then use a Compose action to build a link to the run for your notification email or error log. Microsoft warns that too much custom logging adds actions and can hurt performance, and that frequent alerts can become an anti-pattern.

Log and notify

Record error details in a SharePoint list or other storage and notify the right people. The flow service also emails flow owners about common failures like broken connections and throttling. Microsoft says Application Insights can alert you when cloud flows error, as an alternative to custom logging.

Checklist

  1. Wrap the main actions in a Try scope with a Catch scope after it.
  2. In Catch, record what failed and where, with the run link.
  3. Add exponential retries only on actions where a repeat is safe.
  4. Use Terminate with a Failed status for errors that should stop everything.
  5. Keep logging small, so the error handling does not become the problem.

Source: https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/error-handling

Digital Nerve: YouTube https://www.youtube.com/@DigitalNerveOfficial Facebook https://www.facebook.com/digitalnerveofficial Instagram https://www.instagram.com/digitalnerveofficial/ TikTok https://www.tiktok.com/@digitalnerveofficial DEV https://dev.to/digitalnerve Medium https://medium.com/@digitalnerveofficial

Top comments (0)