In the past I wrote quite a few posts about error handling in Microsoft Flow. In general, error handling means that you need to deal with something that has gone wrong. Timeouts however can be more complicated as your flow may sometimes work and sometimes fail. This can become your worst nightmare.
Handling the timeout can be done by setting the run after settings
This could then result in something like this:
In my above example I’m sending emails when a timeout has occurred or when a HTTP call has failed. Depending on what the call was doing you might need to redo or correct something. This is where timeout handling becomes potentially complicated.
Rather than trying to correct the Timeout it is better to avoid the timeouts all together. Within the HTTP request there is a Timeout setting. This timeout setting can be increased so that timeouts are less likely, however when you run HTTP requests that take a long time, you might want to fix the issues within the API that you’re calling.
Splitting a long running function into smaller tasks is a lot easier to handle than the timeouts within Flow. There are a number of ways that you can split your jobs.
Split data into smaller chunks
Imagine that you wanted to update 100000 records and this is taking too long. You could now consider splitting the data into smaller chunks and deal with 1000 records at a time.
Split large tasks into smaller tasks
Imagine if you created many list items in SharePoint then update SQL database records and then finally update SharePoint list items again. Rather than a single job it might be possible to do this in 3 steps.
Finally it is also possible to combine both of the above options.
Have you got any timeout issues in Microsoft Flow? Please leave a comment below. I’m interested in hearing about your issues.
8 thoughts on “Microsoft Flow – Is timeout handling your worst nightmare?”
What is the best way to split larger data in to smaller chunks / batches?
It all depends the data and what you want to do with it. Feel free to hit the chat on the site and we can discuss this further.
Do you know a way to mark a timeout as success?
I want to do an action if a user has not replied to an ‘Email with Options’, but the timeout marks the whole flow as failed. Even though it has the desired behaviour.
The best way is to use run after setting on the action after the failed action.
You will find a good example in the post below:
In the above post I put scope actions around a whole section of the flow. If you wanted to, you could also use the run after settings of just the next action and set it to include the failed/timeout option. Then the action will run even though the previous action has failed and the overall flow will then be marked successful.
I have used the runafter settings of the action after the one that fails (timeout). That action does indeed execute. But the fail seems to bubble up and the flow is marked failed once again.
That must mean that there isbanothrr failure.
If you just want to ignore the failures can you implement the try catch finally pattern aroubd your existing flow? Then flows never fail.
I have now implemented a flow terminate which returns that the flow has succeeded. I dont think it is the best solution, but it works for now. If I come across a better way, I will update.
This is the better way