“Even though the Power Automate flow is not used very often, it must stay on, can I somehow turn it back on after I receive the turned off email?”
Once you work with Power Automate for more than 90 days, you might start getting some interesting emails. More specifically, an email telling you that your flow was turned off. It didn’t run for 90 days, meaning it’s not used, and as such it was turned off automatically. Yet often it’s not that simple. Some flows just don’t run very frequently but shouldn’t be turned off nevertheless!
How do you keep them on? Even during your holiday when you won’t read the “turn off” email to react?
Build a flow to turn them back on
Since you probably don’t want to turn on all suspended flows in your environment, you shouldn’t list all environments with all flows, and turn them on. You should turn on only the one that was disabled automatically and not by the users. The one mentioned in the “turn off” email.
Start from an automated flow with the trigger ‘When a new email arrives’. As you don’t want to process all emails, add a subject filter for these emails. It might differ based on your language settings, but in English it’s as below.
Alert! Your flow has been turned off since it was not running
As you can see on the email screenshot above, the email includes a link to the disabled flow that might look like:
https://eur.safelink.emails.azure.net/redirect/?destination=https%3A%2F%2Fflow.microsoft.com%2Fmanage%2Fenvironments%2FDefault-c3adda97-555b-44f6-9fbb-ecf0395f334b%2Fflows%2Fd3520074-bf29-4c01-bb34-1b8c9053dc30%2Fdetails%3Futm_source%3Dexceedrunquotaflowdisabled%26utm_medium%3Demail&p=bT0yOWI5MmE0Yy1jMzllLTRlMTQtYTczNy02OWEyYmM4N2M1NDkmdT1hZW8mbD1kZXRhaWxz
If you look properly, you’ll see some familiar information in the url – the environment id and the flow id.
These are the two values you’ll need to turn the flow back on. Extract them from the email body using an expression, e.g. split(…).
Environment id:
split(split(triggerOutputs()?['body/body'],'environments%2F')[1],'%2Fflows%2F')[0]
Flow id:
split(split(triggerOutputs()?['body/body'],'%2Fflows%2F')[1],'%2Fdetails%')[0]
Put these expressions in the ‘Enable Flow as Admin’ action to enable the flow again.
You might also consider adding an email at the end to let you know that the flow was successful.
Summary
As you can see, it’s quite a simple flow to turn on the disabled Power Automate flows based on the “turn off” email. You don’t need to list all environments and all the flows, and turn on even the flows that should stay disabled. The email gives you all the information you need, the environment id and the flow id, which you can extract to enable the flow again.
I like it given its annoying when flows disable.
However, won’t the rescue flow suffer from the same 90 day issue and disable itself just before the main flow disables? I wasn’t sure if the timings were a hard 90 days or it extended to the end of the 90th day.
Or, if the main flow runs once a year say, could be up to 180 days before the rescue flow runs.
Something to put in place alongside an out of office.
Hello Chris,
that’s a good point, the enabling flow could be disabled too… the first thought could be a scheduled flow that’d try to enable this flow every day, but maybe there’s a better solution.
I have implemented a recurring workflow set to run monthly, responsible for generating and subsequently removing placeholder items within SharePoint lists linked to automated processes. The workflow appends the term “Delete” to the Title column of each newly created item. In the associated automated flows, I’ve incorporated a conditional step utilizing the “Delete” keyword. This condition filters out the relevant automated flows and halts their execution before completion.