“I just noticed that one of my Power Automate flows wasn’t running for weeks, how can I make sure they keep turned on?”
Didn’t your flow trigger for some time? It’ll be turned off. Did it fail too many times? Turned off! Power Automate just doesn’t like problematic or not used flows. Once it identifies such a flow it’ll send an email and turn it off. But it’s just one email, and only to the main flow owner. Something that’s so easy to overlook… Maybe there’s some flow that’s not running for months and you didn’t even notice!
It’s a risk that I believe is not worth taking, especially if you can build a very simple flow to make sure that it doesn’t happen. Or at least not without you knowing.
Note: there’s some problem with connector icons in the designer at this moment, that’s why they’re missing on the screenshots.
List all the flows on your environment
To recognise whether there’re some disabled flows, you must list them all. The first steps are the same as in the flow backup flow – use recurrent trigger and list all the flows.
Depending on your account role you can use either the ‘List Flows as Admin’ action or ‘List My Flows’.
The first one will give you all the flows on the environment, including some “system” flows. It has also a limit on 20 flows by default – if you want list more than that you must turn on pagination. And as the action name suggests, you must be administrator of the Power Platform environment.
The other one will return only your flows. Which might be enough if you use the same account for all your flows.
Nevertheless, no matter which one you use, the output will have similar format – list of flows with some basic information. On the example below you can see the flow id (name), displayName, environment it’s running and much more.
There’s also the property “state”, the one that’s relevant for this solution. If the state is Stopped, the flow is turned off; if it’s Started the flow is on.
Filter only the disabled flows
Since the ‘List Flows…’ actions don’t have any filter, and you don’t want to loop through all the flows, use the ‘Filter array’ action. Out of all the flows keep only the ones in state Stopped.
Start them again
Once you have the disabled flows, go back to the ‘Power Automate Management’ group of actions and add ‘Turn On Flow’.
Place it into a loop as you want to process all the stopped flows one by one, and extract the inputs from the JSON you received before.
Environment: item()?['properties']?['environment']?['name']
Flow id: item()?['name']
Now, if you run the flow, it’ll find all stopped flows and turn them on.
But maybe that’s a bit too many flows! There might be some that should be off, that were turned off by you or other users on purpose.
Define which flows should stay on
Since you probably don’t want to turn on all the flows, you’ll need a list of the relevant ones. It can be a SharePoint list or a Dataverse table, that’s up to you, but it should contain at least the names of the flows.
Once ready, add a comparison between the turned off flows and flows in this list in your flow. It’s the same approach as explained in the previous article in more detail.
Load the list into your flow before you turn on all the flows…
…’Select’ only the flow names…
…and use the names to find overlaps with the stopped flows.
Change the input of the ‘Apply to each’ to turn on only the overlapping flows.
That’s it. Every time this flows run, let it be daily or less often, it’ll find the stopped flows, check if some of them should be running, and if so it’ll turn them on again. No more surprises with disabled flows.
Summary
As you can see, it’s not complicated to build a Power Automate flow that’ll keep the other flows turned on all the time. A few steps that can add to your peace of mind, that can help you avoid surprise in form of a disabled flow. This flow and a proper error handling and your processes should keep delivering.
Love the idea but in a environment where you have a flow in multiple environments Dev, UAT, Prod, etc would the SharePoint list be better built by Display Name to work over all environments? Your example appears to use the GUIDs which will be different in each environment.