Microsoft Flow – Handle trigger failures

Quite a few of my posts recently have been about handling errors in Microsoft Flow. So far I’ve only handled errors once my flow has got started, but what do you do when your trigger fails?

I hear you say: “How can a trigger fail and the flow still start?” I’m glad that you asked!

One example is the below, Error from ASE:token exchange failure

When I searched for the above message I quite quickly found a post telling me that there is something wrong with a connection:

This of course is a worrying issue if the flow has been working before and it has been working since the failure.

Then I found another failure on the same trigger.

BadRequest. Http request failed: the timeout was reached.

I guess that this could happen when the connector is overloaded or when SharePoint Online is unavailable. I’ve done some tests flooding flow, but I didn’t get to see these kind of failures. So I’m assuming that this happens when SharePoint Online is struggling for some other reason.

So how do we handle these problems?

The obvious answer would be to set the configure run after the trigger. But this option is not available

I’ll get started by stating that these failures are often difficult or impossible to reproduce. I decided to use the When a new email arrives trigger as it allows me to specify an invalid email folder and save the flow.

I now created two scope steps after my trigger ( hoping that the first one would be skipped and therefore the second one could run on failure of the previous scope. But this will not work as the next step is not skipped. The flow is simply terminated on the failed trigger.

So what do we do?

When I looked at my flow history, I was surprised not to see my flow run. It looks like when testing a flow ( using the test option in the flow editor) and a trigger fails there is no flow history created.

This could be down to the way the flow is triggered. Where before something did actually trigger the flows and in this case I’m starting the flow myself and the triggering object doesn’t really exist.

As All my flows run using the same account, I should be notified

And even when looking at the Show all activity screens I’m not getting any alerts. Well at least not the ones that are caused by the trigger failures.

So far the only place I’ve seen where you can find out about trigger failures seemed to be the Analytics part of Microsoft Flow. Although that has an 1 hour delay.

As you can see from the above screenshot I have seen the following failures on my trigger:

  • BadRequest. Http request failed: the timeout was reached.
  • BadGateway
  • Internal server error
  • Error from ASE:token exchange failure.
  • The underlying connection was closed: An unexpected error occurred on a receive.
  • Http request failed: the timeout was reached.

When checking a while later, notifications did appear:

It looks like the notifications are updated at the same interval as the Analytics reports in Flow.

I’ve created an idea to improve this on the flow community site. Please upvote the flow trigger error handling idea




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: