Power Community

Power Community

A new approach to error handling in Power Automate

For quite a few years now I’ve promoted the Try-Catch error handling pattern. But there is a new approach on its way.

A new approach to error handling in Power Automate Microsoft Power Automate image

The Flow Run Table

Within Dataverse you can now find the Flow Run table. The Flow Run table has a record for every run of a flow. This includes the status, trigger type, parent flow run IDs and so much more. A column Error Message (which doesn’t appear to be set yet) also seems to be a useful piece of information.

So how can we use this?

Replacing the try-catch error handling

Well one of the negatives of the Try-Catch pattern is that we will be adding the same scope boxes with the same email in every single flow that we have. This is cluttering the actual flows.

We could now simply have a flow triggering on the Flow Run table, and then send out our email with the flow run URL to report the issue. Now we only have to include the following flow in each of our environments to do exactly the same:

New approach to error handling in Power Automate

I would include a try catch in the error handling flow. Just in case the error handling flow is failing. Although that could of course also be handled by the above flow. Care should of course be taken that we don’t end up in an endless loop. So excluding the error handling flow from the above pattern might be a good idea anyway.

Does this really replace the Try-Catch?

Not really.

Quite often, I would want my flows to complete specific steps to recover from a failure, however the simple reporting of the errors could quite well be handled with the above steps instead of the Try Catch pattern.

So for example, if I had a flow that provisioned a SharePoint site and the provisioning process would fail due to time out issues, then I would probably want my flow to retry the provisioning process at a quieter time.

Also, the Error messages currently aren’t recorded yet. where you might want to inform someone of the failure details in the email that you send them.

But in short, this is a great improvement, to simplify the whole error handling in Power Automate and Dataverse.

This post was originally published on this site

- Advertisement -spot_img


Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

Clone Dynamics 365 CRM Sales Order Records along with their Related Invoice Records!

Sales teams using Dynamics 365 CRM have to frequently create new sales orders and invoices based on existing ones....

More Articles Like This

- Advertisement -spot_img