Did you know that every action in Power Automate already has a built-in try/catch? Itâs hidden behind the âConfigure run afterâ setting, and once you see it, youâll never write a flow without it again.
The pattern in 30 seconds
- Wrap your business logic in a Scope named
Try. - Add a second Scope named
Catchright after it. - Open Catchâs three-dot menu â Configure run after â check has failed, is skipped, and has timed out.
Thatâs it. If anything inside Try fails, the flow jumps to Catch. If everything succeeds, Catch is skipped. It behaves exactly like try/catch in any programming language.
Why a Scope, not just âConfigure run afterâ on a single action?
You can set Configure run after on any single action, but that only handles failures of that specific action. With a Scope, youâre catching failures from any of the dozens of actions inside it. Thatâs how you avoid the âadd error handling to 40 actions individuallyâ trap.
What the Catch scope should actually do
A good Catch is more than just âsend email on errorâ:
- Capture the failure context with
result('Try'). That expression returns an array with status, error code, and message for every action inside the Try scope, so you can see exactly which step failed. - Log it somewhere durable â a Dataverse table, a SharePoint list, or Application Insights â so you can audit and trend failures.
- Notify the right channel. Teams adaptive cards work great because they include the run URL.
- Decide on retry vs. terminate. For idempotent operations, you can re-run the Try block once. For everything else, terminate with a clear status so the parent system knows it failed.
Add a Finally
A third Scope after Catch with run after set to is successful, has failed, is skipped, has timed out acts like a finally. Use it to release locks, clean up temporary records, or update a âlast runâ status â guaranteed to execute regardless of outcome.
Why this matters
Most flows in production fail silently because no one sees the run history until something is already broken. Adding Try/Catch/Finally takes about two minutes per flow and gives you actionable alerts, audit trails, and the option to retry safely. Itâs the single highest-ROI pattern you can apply to every flow you own.
đŹ Comments & Suggestions
Share your thoughts, tips, or drop a useful link below.