Skip to main content
Breathbase
Power Platform

Error handling in Power Automate: 7 patterns you need to know

From try-catch scopes to retry logic. Seven proven patterns to make your Power Automate flows robust and reliable.

April 1, 20259 minMiquel van Dongen
AI Summary

 

Error handling in Power Automate

When building Power Automate flows for production environments, error handling is not a luxury but a necessity. A flow running without error handling can fail silently without anyone noticing, resulting in lost data and frustrated users. In this article, we cover seven patterns every Power Automate developer should know to build reliable and maintainable flows.

Pattern 1: try-catch with scopes

The most fundamental error handling pattern in Power Automate is using scopes as try-catch blocks. You place your main logic in a scope called "Try" and add a second scope called "Catch" that only runs when the Try scope fails. By setting the "Run After" property of the Catch scope to "has failed", you create a reliable error handling structure. Within the Catch scope, you have access to error details via the result() function, allowing you to determine exactly which action failed and why.

Pattern 1 and 2: try-catch and retry logic

Pattern 2: retry logic for external services

External API calls can fail due to temporary network issues or throttling. Power Automate offers built-in retry policies that you can configure on HTTP actions. You can set the number of attempts, the interval, and the type of backoff (fixed or exponential). For more complex scenarios, you can build a Do Until loop that repeats an action until it succeeds or a maximum number of attempts is reached. This is especially valuable for integrations with systems like Dynamics 365 or external web services.

Pattern 3 and 4: error notifications and logging

Pattern 3: automated error notifications

When a flow fails, the right team should be notified immediately. Build a reusable child flow that sends error notifications via email, Teams, or a ticketing system. Include the flow name, error message, timestamp, and a direct link to the flow run. This significantly reduces the time between an error occurring and its resolution.

Pattern 4: structured logging

Log all flow executions to a central Dataverse table or SharePoint list. Capture not only errors but also successful runs with relevant metadata such as duration, processed records, and parameters used. This gives you a complete overview of the health of your automations and makes it easy to identify trends and recurring issues.

The best error handling is the kind you build before the first error occurs. Invest time in robust patterns and you will save multiples in troubleshooting later.

Pattern 5, 6 and 7: advanced techniques

Pattern 5: graceful degradation

Not every error needs to stop the entire flow. With graceful degradation, you build flows that continue on an alternative path when a non-critical step fails. Suppose your flow enriches customer data from three different sources. If one source is unavailable, the flow can continue with data from the other two sources and retrieve the missing enrichment later.

Pattern 6: compensating actions

For flows that update multiple systems, an error midway can lead to inconsistent data. Compensating actions roll back previously completed steps when a later step fails. This is similar to database transactions and is essential for Power Platform solutions that orchestrate multiple data sources.

Pattern 7: circuit breaker

The circuit breaker pattern prevents your flow from repeatedly calling a failing service. Track how often an external service fails and temporarily switch to a fallback when a threshold is reached. After a cooldown period, the flow tries the primary service again. This protects both your flow and the external service from overload.

Best practices for production flows

Combine these patterns based on the complexity of your flow. Always start with try-catch scopes and error notifications as a foundation. Add retry logic for external integrations and implement logging for every production flow. Use graceful degradation and compensating actions for business-critical processes. At Breathbase, we apply these patterns as standard in every flow we build for clients, resulting in reliable automations that require minimal maintenance.

Tags

Power AutomateError HandlingBest Practices
Miquel van Dongen

Miquel van Dongen

Founder & Consultant @ Breathbase

Specialist in Microsoft Dynamics 365, Power Platform and AI-driven software development. Helps organizations get the most out of their digital transformation.

More about Miquel

Get in touch

Have a question or want to explore possibilities? Feel free to reach out to us.