Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers 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
Search our website
We also send out useful tips in a monthly email newsletter ...
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:
Code | What it represents |
---|---|
Y | Year |
M | Month or minute, depending on context |
D | Day |
H | Hour |
M | See above |
S | Second |
In addition you can prefix codes with the following letters:
Letter | Meaning |
---|---|
P | Start of a code representing a date and (possibly) time duration |
T | 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 | PT1H |
Go on holiday for 2 weeks | P2W |
Spend the next 1 month, 2 weeks, 3 days, 4 hours and 5 minutes writing this blog | P1M2W3DT4H5M |
Wait one minute for an approval | PT1M |
Wait 29 days for an approval | P29D |
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:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.