Skip to content
This documentation is currently in preview, therefore subject to change.

Handle Errors in Flows

Proper error handling ensures your flows are resilient and provide meaningful feedback when issues occur with document generation.


Configure Run After

Power Automate’s “Configure run after” feature lets you control when actions execute based on the outcome of previous actions.

Setting Up Error Handling

  1. Add an action after your Build a Doc action
  2. Click the menu → Configure run after
  3. Select the conditions:
    • is successful
    • has failed
    • is skipped
    • has timed out

Parallel Error Branch

Create a parallel branch that only runs on failure:

Build a Doc Action
├── [Success path] Create file in SharePoint
└── [Failure path] Send error notification email

Using Scope for Try-Catch

Scope actions let you group related actions and handle errors at the group level.

Try-Catch Pattern

Scope: Try
├── Get file content
├── Build a Doc: Convert Word Document
└── Create file
Scope: Catch (Configure run after: Try has failed)
├── Compose: Error details
├── Send email: Error notification
└── Terminate: Failed

Configuration Steps

  1. Add a Scope action, rename to “Try”
  2. Add your Build a Doc actions inside the Try scope
  3. Add another Scope after Try, rename to “Catch”
  4. Configure Catch to run after Try “has failed”
  5. Add error handling actions inside Catch

Accessing Error Information

Use expressions to access error details:

Error Message

result('Build_a_Doc_Action')?['error']?['message']

Full Error Object

result('Build_a_Doc_Action')?['error']

Action Status

actions('Build_a_Doc_Action')?['status']

Action Outputs (including errors)

actions('Build_a_Doc_Action')?['outputs']

Common Error Scenarios

401 Unauthorised

Handling:

if equals(result('Action')?['statusCode'], 401)
→ Send notification about invalid API key
→ Terminate flow

429 Rate Limited

Handling:

  • Enable retry policy with exponential backoff
  • Add delay between document generations in loops

Template Errors

Handling:

  • Enable “Inline template syntax errors” in the action
  • Errors appear in the output document instead of failing
  • Good for development and debugging

Timeout

Handling:

  • Increase timeout in action settings
  • For large documents, consider breaking into smaller parts

Logging Errors

Teams Notification

Use the Teams connector to post error messages to a channel for team visibility.

  • Add Microsoft Teams → Post a message in a channel
  • Select Team or Channel to post to
  • Set Message to include error details and timestamp

Trigger the action from the Catch scope

Best Practices

  1. Always add error handling - Don’t assume actions will succeed
  2. Log errors - Maintain an audit trail for troubleshooting
  3. Notify appropriately - Alert relevant people without creating noise
  4. Use inline errors during development - Faster debugging
  5. Test failure scenarios - Intentionally trigger errors to verify handling
  6. Terminate failed flows - Don’t let failed flows continue silently