Skip to main content

Command Palette

Search for a command to run...

Power Automate Error Handling Best Practices (Real Examples)

Updated
3 min read
Power Automate Error Handling Best Practices (Real Examples)

Introduction

Power Automate flows are extremely powerful, but real-world automation always faces failures like
• SharePoint connection issues
• Permission problems
• “Get Items” threshold errors
• API timeouts
• Invalid data formats
• Random intermittent failures

So the difference between a beginner and an expert flow is error handling.

In this blog, I will explain best practices of error handling in Power Automate with real examples, so your flows become stable, professional, and production-ready.

1. Use “Try – Catch – Finally” Pattern (Best Practice)

Power Automate does not have direct try/catch like programming, but we can implement it using

Scopes-
Scope: TRY
Scope: CATCH
Scope: FINALLY

🔹 How to build:
1. Add a Scope → rename it TRY
2. Put your main actions inside TRY
3. Add another Scope → rename it CATCH
4. Add another Scope → rename it FINALLY
5. Configure Run after:
• CATCH should run after TRY → has failed, has timed out
• FINALLY should run after TRY → is successful, has failed, has skipped, has timed out

✅ This is the most professional structure for Power Automate flows.

2. Always Configure “Run After” Correctly

Most people make mistake: they only check “is successful”.

Correct approach:

For error handling steps (like email notification), configure run after:
• has failed
• has timed out
• has been skipped

📌 Example:
If your “Create item” fails, then your “Send email” must still run.

3. Capture Error Message Dynamically (Real Example)

Instead of writing generic email like “Flow failed”, capture the actual reason.

Best method:

In CATCH scope, add:

Compose – Error Details

Use expression:

string(outputs('TRY')) Or for action-level error: outputs('Create_item')?['body']

Email example:

Subject: ❌ Flow Failed - Invoice Upload
Body:
• Flow Name
• Failed Step
• Error Message
• Run URL

This makes troubleshooting very easy.

4. Use Terminate Action Properly

After handling errors, use:

Terminate
• Status: Failed (or Cancelled)

📌 Why?
Because sometimes flow continues and updates incorrect data even after failure.

Example:
If “Update Item” fails, do NOT proceed to “Send success email”.

5. Retry Policy (Very Important for Random Failures)

Many failures are temporary:
• SharePoint throttling
• Outlook temporary issue
• HTTP 429 too many requests

Best Practice:

Open action settings → Retry Policy:
• Type: Exponential
• Count: 3–5

📌 Example:
“Send an HTTP request to SharePoint” should always have retry.

6. Use Parallel Branching Carefully

Parallel branches can fail silently if not monitored.

Best practice:
• After parallel actions, add a final scope
• Check run after for both branches

Example:
Branch A: Create item
Branch B: Upload attachment
Final: Update status “Completed”

If attachment fails, do not mark completed.

7. Log Errors into SharePoint List (Production-Level)

This is the most useful for business.

Create a SharePoint list: Flow Error Logs
Columns:
• FlowName
• RunID
• ErrorStep
• ErrorMessage
• CreatedOn
• TriggerUser
• Payload (optional)

In CATCH scope, create item in this list.

📌 Benefit:
You can track errors historically like a ticketing system.

8. Use “Configure Timeout” for Long Actions

Some actions take too long and flow times out.

Example:
• approvals
• large file upload
• long API calls

Open action settings:
• Timeout: PT30M (30 minutes)

9. Validate Inputs Before Main Actions

This prevents many failures.

Example:
Before creating SharePoint item:
• Check if Bill No is blank
• Check if attachment exists
• Validate email format

Real example:

Condition:
If length(BillNo) = 0 → terminate with friendly message.

10. Always Send a Failure Notification (Real Example)

In CATCH scope, send email/Teams message:

Teams message example:
• ❌ Flow failed
• Bill No: 1024
• User: Deepika
• Error: Access denied
• Link to run

This reduces dependency on the IT team.

#PowerApps #MicrosoftPowerPlatform #PowerAutomate #ErrorHandling