Share via


Microsoft Flow: Error handling

Microsoft Flow is a cloud-based service that makes it practical and simple for line-of-business users to build workflows that automate time-consuming business tasks and processes across applications and services.

Capture the error

Click on 3 dots next to your step or condition and choose Configure run after

 

There are 4 possibilities:

  • is successful
  • has failed
  • is skipped
  • has timed out

The default option is to run after the previous step has been successful. 

Choose 'has failed' instead of the 'successful' option. The step will run only after the previous one has failed. In the step you can send an email with the error, repeat the previous action, terminate the workflow, or assign other steps for error handling. The options allow you to either catch the error on has failed or continue the workflow despite an error in the previous step.

Continue the workflow

Depending on your design, a failed step may be acceptable and the requirements still allow the workflow to continue. As in the image above, click on the ... (3 dots) and configure run after to run after both the step 'is successful' and 'has failed':

Capture response status 

If you are interested in a particular error or would like to implement a more detailed error handling, you can capture the status code using Expressions:

equals(int(actionOutputs('Create_file').statusCode),409)

  • 'Create_file' is the name of the previous step
  • 409 is the status code. Replace it with the one you are interested in, e.g. 404, 403, etc.

Microsoft Flow is always expanding and adding more options. If you have more ideas of how to handle errors in Microsoft Flow, don't hesitate to post in the comments!

equals(int(actionOutputs('Create_file').statusCode), 409)

See Also

Automate processes + tasks
Verifying and modifying Flows Policy in site using PowerShell