Power Automate: error handling that lasts

A flow without error handling fails silently or at the wrong moment. The admin gets an email “Your flow failed” with ActionFailed or BadRequest, but nobody knows which item was not processed. Or worse: the run shows “Succeeded” while the key step was skipped. This guide sets out a fixed pattern you can use in every flow.

Run after: the basis

By default an action only runs if the previous one succeeded. Via the three dots → Configure run after you can let an action also run when the previous one has failed, is skipped or has timed out. That is how you build an error path.

The pattern: Try, Catch, Finally

  1. Scope “Try”: put all regular actions in it.
  2. Scope “Catch”: run after on Try = has failed and has timed out. Here you log the error and alert someone.
  3. Scope “Finally” (optional): run after on Catch = all boxes ticked. Clean-up that must always happen.
  4. End the Catch with Terminate with status Failed. Otherwise the run shows “Succeeded”, because the Catch itself succeeded.

Getting the real error message

In the Catch, add a Filter array on the result of the Try scope, so only the failed actions remain:

Code
From:      result('Try')
Condition: item()?['status']  is equal to  Failed

The error message of the first failed action is then as follows. Replace Filter_array with the name of your action, with underscores instead of spaces.

Code
first(body('Filter_array'))?['outputs']?['body']?['error']?['message']

Also put a link to the run itself in your alert, so the admin can look straight away:

CSV
concat('https://make.powerautomate.com/environments/', workflow()?['tags']?['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']?['name'])

Retrying on temporary errors

Errors such as 429 Too Many Requests or a temporary 502 often clear by themselves. Most actions have a retry policy under Settings. The default policy already retries a few times; raise it for busy SharePoint lists rather than building loops yourself.

Common messages

  • ActionFailed. An action failed. No dependent actions succeeded.: an action inside a scope or loop failed. Open the run and find the red action; the real cause is in its output.
  • BadRequest: the input is wrong, for example an empty required column or a wrong date format.
  • Forbidden / 403: the connection (the account) has no rights on that site or list.
  • InvalidTemplate: an expression refers to something empty. Use ? in expressions, such as body('Action')?['field'], and coalesce() for a default value.

Just starting? Read a first Microsoft 365 flow first.

Frequent errors and how to fix them

These are the messages people type into search when the module will not start. The exact wording is here so this page can be found.

ActionFailed / BadRequest
Configure Run After on the next step; log Body in Compose. See the error-handling guide.
DLP blocked connector
The connector is in the wrong DLP group. A Power Platform admin must set Business vs Non-business.

Questions about this, or need help setting it up? We are happy to think along.

Message on LinkedIn →