Intermediate | Flow of the Week: Get notified immediately when your flow has errors or failures

Hey Flow Fans!

If you have been using Microsoft Flow for a while and have automated your business processes, chances are that your flow has failed or errored out due to some unforeseen circumstances or bugs in the logic of your flow.

One of the key principles of software engineering is to consider and handle as many failure cases as you can, but to also be able to detect, respond and recover from failures as soon as you can, when they happen. These principles can be transferred to business processes that are automated using Microsoft Flow. Today, for Flow of the week – I am going to show you how to stay on top of mission critical business processes that you have automated using Flow, and how to get notified or perform recovery steps in case a flow fails or errors out. Let’s jump into the details, and look at the how, since we have already established the what.

I have a flow that copies over the images I upload to a folder in my OneDrive account to my Azure Storage account and emails me back a link to that image, so I can use the link in my blogs. Pretty cool right?

Imagine if I upload an image to my OneDrive folder and for some reason the automated email doesn’t show up. I don’t want to waste time waiting, instead I go over to the Flow portal and discover that something went wrong with my flow. Now if only, I had been notified after the first image I uploaded that my flow was failing due to expired Outlook credentials – I wouldn’t have uploaded the other 10 images. Now with the recently released “Configure run-after” feature you can catch such errors and react to them programmatically.

For my flow, I am going to “configure run-after” on the last action, and if the last action doesn’t execute successfully – then I will send a push notification, notifying me of the flow not able to run successfully.

In the image below, you can see that I have configured my flow to send a push notification with a link to the run details page – this helps me quickly figure out what went wrong.

Now, in this case the “send email” action failed, but if any of the previous steps had failed, it will cause the penultimate action to be skipped and which in turn results in the last action (send notification) being executed.

           

 

 

That’s it for this time. If you have any questions, suggestions or feedback about flow, please feel free to post below in the comments, in our community, or reach out on Twitter.