559 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
|How to cope with flows timing out? Don't let it happen!|
|On a recent course I was asked what happens when a Power Automate flow times out. After a bit of research, the obvious answer is to avoid this happening by changing the flow's time-out setting and then handling this in another action.|
So you've written a flow which waits for an approval:
The last action will only execute when someone approves the flow.
You've read somewhere that this approval will only be pending for 30 days (which is true), after which time ... what? You suspect that one answer might be to manually wait for an approval using a combination of these two actions:
How to manually wait for an approval.
However there is a really good way to solve this problem by tweaking your action's time-out settings, and then responding to a time-out event.
I got the idea for this blog from this LinkedIn page from Petter Skodvin-Hvammen (a name I can only envy, being called Andy Brown).
So the first thing to do is to change the settings of your approval action:
Click on the 3 dots to the right of your approval action to change its settings.
You can then choose Settings:
Choose this option.
You can now type a new time-out setting into this box:
See below for some things that you could type in.
The durations come from the ISO 8601 international standard for representing dates and times (what do you mean, you don't know this convention?). These are the abbreviations that you can use:
What it represents
Month or minute, depending on context
In addition you can prefix codes with the following letters:
Start of a code representing a date and (possibly) time duration
Start of the time part of a code
Here are some examples of how you could represent durations of time, using these codes:
What I want to do
How I would say it
Go shopping for an hour
Go on holiday for 2 weeks
Spend the next 1 month, 2 weeks, 3 days, 4 hours and 5 minutes writing this blog
Wait one minute for an approval
Wait 29 days for an approval
I'm going to use this setting initially for testing:
This will wait just one minute - I'll need to remember to change this afterwards, probably to P29D (or 29 days).
The second part of our jigsaw is to add a group of actions which will run only if our approval times out. First add a Scope action in a parallel branch:
A Scope action will allow you to run a group of actions if the approval times out.
You can now configure this Scope action to run after the approval times out:
Choose this option to configure your scope.
Specify that the actions inside your scope should run when the approval action times out:
Choose this option.
You could now add actions within your scope:
Typically you might send an email to yourself warning you that one of your approvals has timed out.
You can now test your flow. Initially you'll see something like this:
To begin with the flow is waiting for an approval ...
But after a matter of a minute or so, this should change to something like this:
My flow timed out!
When your flow is working to your satisfaction you should remember to change the duration from 1 minute to (say) 29 days (P29D). You now have complete control over the approval process!
A further refinement might be to call a subflow within your Scope action on time-out, although to do this you will first have to put your flows into a solution. The advantage of this approach would be that it would allow you to standardise your handling of all approval time-out events.
Some other pages relevant to the above blog include:
25 Aytoun Street