Do you want to re-enable flows that were suspended automatically? Have you noticed that flows that aren’t running are automatically switched off?
Switched off flows
Table of Contents
This can be very annoying! you have a flow that doesn’t run very often and after 30 days these flows are being switched off!
I’ve never understood this feature and even wore, as far as I know there is no way of disabling the disabling of the flows.
So, how do we stop this or avoid flows not running and being stopped?
Re-enable flows
I was thinking that we could just create a flow. Actually, maybe we should create two flows to re-enable flows that have been stopped.
Why two?
Well, what if my flow doesn’t run for 30 days? Alternatively I can schedule my re-enable flow to run daily and I will not have a problem.
Building the Re-enable flow
I’m going to create a scheduled flow that will run daily.

Then I’m going to collect all the flows that I’ve got using the Get Environments and the List Flows as Admin actions.

From the output we can now see some of the details of my flows.

Ok, that is good but that gives me a lot of data to process. A typical mistake to now make id to extend that apply to each with another apply to each so that we nest our apply to each steps. Unless you want to make a lot of coffees, you better use the Pieter’s method.
We will only need the flow name, the environment name and the status. Using the select I’m just going to create records for these three properties.
Looking in the run mode this will give us an array of just the properties that we want.

However we are not interested in the started flows, we just want to ones that have been suspended. Flows that have a stopped status were stopped by someone suspended flows are flows that were stopped by Microsoft because they didn’t run or they caused too many failures.
To get just the suspended flows I’m going to add a filter, just before the select action.

All we need to add in the Compose is the following code:
outputs('Select')
Note that you will have to type this as the dynamic content will not show the out of scope content.
Ok, I could still transform my json from that compose a bit, but I’m going to be lazy this time. Just a nested apply to each to process the flows for each environment and switch them back on.
The flow part of this will look like this. Using the turn on flow action

There are 4 pieces of code here. in the Apply to each 2:
outputs('Compose')
In the apply to each 3 :
items('Apply_to_each_2')?['body']
In the Turn On flow:
items('Apply_to_each_3')?['environment']
and for the Flow :
items('Apply_to_each_3')?['name']
And as a result all my flows have been re-enabled within a minute.
More thoughts
You could of course also add an email telling the users that the flow was suspended by accident and that they can ignore that email that was sent out to them.
Discover more from SharePains
Subscribe to get the latest posts sent to your email.
I just started receiving notifications this week that some of my manual flows have been turned off because they hadnโt been run. This info came at the right time for sure. Thank you!
Hi Pieter. Thank you for sharing this!
However Iโm getting a forbidden error on โTurn On Flowโ action. Like this:
{โcodeโ:โConnectionAuthorizationFailedโ,โmessageโ:โThe caller with object id โ63ec116a-6408-4330-bc28-b5e3ff689011โฒ does not have permission for connection โceb4cd77-d6ae-4c12-b3ef-ff49e89a3f4cโ under Api โshared_logicflowsโ.โ}
I have Power Platform admin and Power BI Administrator roles.
Hi Arthur, Does that happen on all flows ?
Actually we have only one suspended flow in our environment. And this flow is created by another user, not me.
Can you add yourself as an owner and see if that makes a difference.
I did and now started to get another error:
{“error”:{“code”:”MissingAdequateQuotaPolicy”,”message”:”The user ’63ec116a-6408-4330-bc28-b5e3ff689011′ does not have a service plan adequate for the non-Standard connection. https://go.microsoft.com/fwlink/?linkid=2123710“}}
That sounds like a premium licence is required to do this. Can you start a premium trial if you haven’t got a premium licence.
But the purpose of this flow is to re-enable flows suspended by Microsoft for users running under Microsoft 365 license. If I buy Power Automate license, my flows will not be suspended anyway.
I meant it more as a test to identify the issues
I did and the flow has been re-enabled. So what’s your suggestion now?
It looks like you would need premium to do this. I would need to look into that ownership thing. Potentially if the flow can take ownership of other flows then that might work.
This solution is great if you want ALL of your suspended flows to be re-enabled. I create a lot of โproof of conceptโ type flows which โ if suspended โ I wouldnโt want to re-enable. What I ended up doing was creating a list in MS Lists to โinventoryโ all of my flows and track their status. I have a yes/no column in that list labeled โMission Criticalโ which I set to Yes for โproductionโ flows. This lets me run a daily check of only those flows and re-enable them if they are suspended.
The only piece of data I canโt seem to find a way to get is the timestamp of the last run of a flow (it would be useful to have in that list). This isnโt included in the โGet flowโ output. Iโve suggested adding it in the Flow Ideas forum in the Power Automate Community, but who knows if itโll ever get picked up.
It would be useful if run data could be enabled. I am quite sure that John Liu’s tools to manage flows will get the run details. So that must mean that the APIs can be used to develop what you want.
Hi Pieter, I want to achieve similar functionality but the difference is- for a particular solution in a particular environment. Can you please suggest something if it is feasible? Thanks.
Hi Kanika,
Yes, you would just have a to filter the process by environment and filter it by specific flows.
Hi Pieter, Thankyou for sharing this.
I have a similar requirement but the difference is I want to do it for the flows in particular solution & particular Environment. I am still learning Power automate, so not sure if this is feasible.
Can you please shed some light on this if this is achievable. Thanks.
Yes, you would just have a to filter the process by environment and filter it by specific flows.
Dear Pieter, thank you for sharing this wonderful process! I have implemented exactly the same way and the flow is running successfully. In first run, it enabled one suspended flow as well. However some flows suspended after that, didn’t get enable. Any idea why is that? they are in other users account..
HI Arjun,
Does the flow find the disabled flows and is it failing to enable them or does the flow not find the flows?
Hi Pieter, thanks for the prompt reply! The flow finds the flows available only in selected connection account (which is a Global Admin account). I am assuming that, since we are using ‘List flows as an Admin’ action, it will list all the flows in our environment. Correct me if I am wrong ๐
Do I need to assign any specific license to this account? it has a per-user plan of power automate.
Hi Arjun, that should give you all the flows with the environment.
Hi Pieter
Does this work with Flows which are of part of a solution ?
Thanks
Nigel
Hi Nigel,
I haven’t tried that. I will keep an eye on my flows inside solutions to see what happens with them.
Hi Pieter, I have it working up to the Apply to Each 3 loop. The error is:
ExpressionEvaluationFailed. The execution of template action ‘Apply_to_each_3’ failed: the result of the evaluation of ‘foreach’ expression ‘@items(‘Apply_to_each_2’)?[‘body’]’ is of type ‘Null’. The result must be a valid array.
Hi Steve,
What is the source of data in the Apply to each 2 set to? most likely there is something wrong there. To debug it I would probably add some compose actions before each apply to each set to the source data identical to the apply to each.
I got it to work Pieter. Great resource, as always.
I do see that it will list out flows that are in a solution with their status, however; I don’t see Environment Name being output as a choice to filter on. It appears environment is its own section in the json output. I think I will probably have a need for this with a few of our clients having flows that trigger off of, let’s say an import entity that they only do every 6 months kind of deal. Have this filter on just that environment, just that flow name, and where the status is Suspended, and then turn it on. Not sure if it’ll work though as the turn on flow option doesn’t see flows in a solution, but the list flows does.
Do you mean they are not in the drop down? If you add a custom value and supply the flow GUID does it then fail?
When I filter for Suspended flows, I’m getting flows that I can’t find. Anyone else experiencing this? I’m using List My Flows and not List Flows as Admin. They are not under “Shared with me” either. The FIow names look familiar – perhaps they are deleted flows?
In the output from the List My flows there is a field “id” this gives you the url of the flow. Once you open the flow you might be bale to find out where they come from, who owns them etc.
Thanks for the quick reply! My mistake – I missed the “Show More” at the bottom of the flows list and there they were.
Hi Pieter,
Thank you for sharing this solution. Iโve tried following your steps to recreate this but canโt seem to get it right (for example cannot find Output expressions (Output(โฆ)? in expresssion section.
I know its a bit much to ask but could you share these instructions in a video?
I think that you are looking for outputs not output
Hi Pieter,
Yes it was outputs that I was searching for but the one you had Outputs(…) wasn’t there.
I just tried and I’m getting outputs appear in the suggestions:
Hi Pieter, I can get to this stage too by clicking on the word “outputs” to select it, then shows outputs in the expression field as above. Clicking on Okay then gives me the message “The Expression is invalid”. This is where I’ve been getting stuck.
Can you post the full expression that you are typing? The outputs expects the name of the action that you want to collect the data from with the spaces of names replaced by an underscore ( _ )
Oh okay. I was following your instructions and going by the screenshots you provided and didn’t see anything about typing in any action names.
Maybe this is too complicated for a newbie to follow without deeper understanding of those commands.
We managed to figure out the step above for Compose. It was to put in outputs(‘Select’) which worked.
We are stuck now at the last steps to enable to suspended flows.
You mentioned you in your procedure to create “Apply to each 2” and use outputs(‘Compose’). Is this an extra step below to previous Compose? Looking at the screenshot you provided the Outputs is from the Dynamic content and not an expression.
I can see before that I have 1 suspended flow that needs to be enabled.
My flow is failing at “Apply to each 2” with error “ActionFailed. An action failed. No dependent actions succeeded.”
Hi Pieter,
I am continually receiving the following message in the ‘Apply to each 2’ loop:
The execution of template action ‘Apply_to_each_2’ failed: the result of the evaluation of ‘foreach’ expression ‘@outputs(‘Compose’)’ is of type ‘Object’. The result must be a valid array.
I’m thinking there must be an issue with what I’ve entered for the compose step, but I can’t seem to figure it out. In the compose section, I’m clicking the ‘outputs(actionName)’ expression under the Referencing functions and entering ‘Select’ in the action name. The complete expression ends up being: outputs(‘Select’). In the ‘Apply to each 2’ loop, I’m using: outputs(‘Compose’) as the expression. What am I missing?
Hi Pieter,
As a follow up to my previous comment, I was able to figure out what I was doing wrong. I had incorrectly embedded the ‘Apply to each 2’ loop into the original ‘Apply to each’ loop by adding it as an action after the ‘Compose’ step rather than adding it as a ‘New Step’. Adding the same content as a ‘New Step’ resolved the issue. Thank you for your help with this, works perfectly now.
Great to hear that you resolved the issue
Pieter,
Excellent resource for users. My question is if there is a way to be proactive about the ‘suspended issue’? My situation is that flows during our migration process, and some flows in general, may not be used/accessed in a 90 day period for reasonable reasons (testing on hold, application only runs every 60 – 180 days, etc…). Rather than have users get the suspended message I would like to ensure that a flow never becomes suspended at all. What would be your suggestion? Thanks, Greg
I haven’t really found a better way. I do think that it is perfectly fine for a flow not to run for a long period of time.
Appreciate the response. Many thanks. Greg
Thanks for the guide! This is exactly what I need.
You are welcome
Hi Pieter, thanks for your article. I’m trying to create this flow, however when running it, it fails at the “List Flows as Admin” action, stating “You are not permitted to make flows in this ‘mycompanyname (default)’. Please switch to the default environment, or to one of your own environment(s), where you have maker permissions.”
I have checked the Power Platform admin center and the account I am using to set this flow up has Environment Maker permissions (is listed in the users there). We only have 1 Environment (and it’s the one with (default) ).
Do you have any ideas?
What if our scheduled flow get turn off automatically?
How frequently does that flow run?
Is it stopped because it fails too often?
After running successfully for a very long time, this flow reports it has failed. But not all is as it seems. We started receiving a second simultaneous and identical notice of flows being turned off for not running in x days. At its scheduled time your flow turns the stopped flow back on OK, yet the run history reports it failed to complete.
The latest run history shows that ‘Apply to each’ containing ‘Turn on Flow’ ran 4 iterations. The first time it reported “ActionFailed. An action failed. No dependent actions succeeded.” yet they did succeed. In subsequent iterations, ‘Turn on Flow’ also reported “Forbidden”, and subsequent actions failed.
Any ideas?
Can you send screenshots of the flow runs on the chat? The apply to each error means that something inside the apply to each steps. You will need to find the failing step inside
My screenshots won’t paste here for some reason. However I’ve made some progress with troubleshooting. The error occurs in the ‘Turn on flow’ step. ‘Apply to each 3’ had 4 iterations today. Only the first was successful. The others return a Forbidden notification. Downloaded output finishes with “Connection ‘…….’ to ‘shared_logicflows’ cannot be used to activate this flow, either because this is not a valid connection or because it is not a connection you have access permission for. Either replace the connection with a valid connection you can access or have the connection owner activate the flow, so the connection is shared with you in the context of this flow.”
Going to the Connections panel I confirm that I am the owner and that all 4 connections have a green tick. Selecting Manage Connections shows there is a Power Automate Management connection that can’t sign in. Fix connection does not fix it.
What are the repercussions of deleting it? Will I need to go through every flow individually to check whether they are affected, and create a new connection?
Hi David,
Screenshots you can send me through the chat on this site.
On the actual issue, you are trying to activate a flow that uses a connection that was create by a different user account. That user account can give you access to that connection. Alternatively, you could create a new connection and then make sure that your flow uses that connection.
Thanks Pieter. I have checked all 33 flows and confirmed that I am the owner or co-owner, that the flow runs on the owner’s plan, every connection is ticked green, and is mine apart from system connections such as Translate, Mail, etc. A few flows had other connections not being used. I have deleted them. Unfortunately, none of them was the offending connection.
In Manage Connections, one connection had Status “Can’t sign in”. It is a Power Automate Management connection in my name. Fix connection opens the dialog to pick an account. I select the correct user, the dialog closes, but the problem is not fixed. Going into details, Update password fails.
One flow is named as using the connection. Connections in use in that flow do not show a Power Automate Management connection so I deleted the connection and the named flow still ran successfully. The Re-enable flow still fails at ‘Turn on flow’. I’ll try again to put the outputs in chat.
HI David,
It isn’t always about being the owner of the flow. It can also be about who the owner is on the connections used by the steps.
Hi Pieter. Puzzling about how your question was different from my earlier answer led me to the short-term solution. There was one other person using flows, and he had 3 that were inactivated. Deleting them lets the re-enable flow run error free.
What if we had been part of a larger organisation with lots of people who had created flows? I couldnโt have guessed who might have the problem connections.
Your original flow listed enough flow attributes to identify and re-enable suspended flows. Are there additional attributes available, such as owner, that could help in troubleshooting?
Thanks for your help.
You might want to install the center of excellence https://learn.microsoft.com/en-us/power-platform/guidance/coe/starter-kit
This will monitor all your flows and apps and alert you towards these kind of issues.
If you need help installing it then please feel free to open a chat.