Power Automate: delete a deleted Flow

Why?

We can delete a Power Automate Flow in the Power Automate Portal. However it seems that the Flow is not really gone, so how can we delete a deleted Flow? 🤯

Even though we cannot find the Flow in the Power Automate Portal anymore, somewhere in Dataverse there is still a record of your Flow. That is probably why you can restore a deleted Flow by logging a ticket with Microsoft (as long as you can provide the GUID of the Flow). A shame that we cannot restore deleted Flows ourselves. Which reminds me: please vote on this idea: Recycle bin for deleted flows Power Platform Community (microsoft.com) 😁

What?

In our problem case, we deleted a Power Automate Flow. Our Power Automate Portal was very tidy:

No Flows showing, does not mean there are no Flows…

But from within the depths of Dataverse purgatory, it was still triggering new instances sending emails and Approvals we did not want. The Flow originally had an automated trigger on a Dataverse table, but apparently only deleting the Flow does not stop it from running… therefor from now on we will call this a Zombie Flow 🧟‍♂️

This post is my journey to find a Zombie Flow and stop it for good! 🎯🧠 #AimForTheBrain

How?

We created the Flow originally with the name: When a row is added, modified or deleted -> Create an approval.

1) Our first idea was to look at a Dataverse table called Process. Some other Flow-related journeys have led me here before, so it was worth to quickly check it out. This table contains an entity (when Dataverse was still the Common Data Service) called Workflows. The URL to this table looks something like:

https://make.powerapps.com/environments/[Environment GUID]/entities/[Environment GUID]/Workflow

A normal table like Account shows the Data Tab, so we can have a quick peek at its contents. However this table / entity does not show the Data Tab:

No Data Tab showing, does not mean there is no Data…

Very intriguing!
If there is a table, there could be data… if the data is hidden here, there could be another place to find the data 👨‍💻
In this table I checked the Views tab of the table and see if I could filter out the Flow using a filter on the Process Name column:

and there was the Zombie Flow! I wanted to have the GUID of the Flow because then, I could investigate further through some other not-so-friendly options. Unfortunately, none of the available columns would give me the Flow GUID…

2) The second thing to check was if the List Flows as Admin action of the Power Automate Management connector (Power Automate Management – Connectors | Microsoft Docs), would list this Zombie Flow.

Answer: No it does not! 😒

3) Next step was to see if we can use one of the Dataverse API’s to access the records in the Process table. It actually was a Citizen Developer of our customer: Jochem De Kruijff that discovered the light at the end of this tunnel through the link:

https://[OrgID].crm4.dynamics.com/api/data/v9.1/workflows

You can find this information in the Power Platform Admin Center (https://admin.powerplatform.microsoft.com/environments) after selecting an Environment you have access to:

Environment Information in Power Platform Admin Center

With this link we can get all workflows in the Process table 💪👍

Within a big array of results coming from this link, we found our Flow by its name. One of the properties was the workflowidunique. This property is the same as the Flow GUID (which is the record GUID of the Process table):

0b68711a-1c10-4406-a9c9-31179d5634c8

4) With this Flow GUID, I knew we could do great things! The ultimate goal was off course to delete the deleted flow for ever so it could never run again. Aside from logging a ticket with Microsoft to restore the Flow (so we could turn it off and delete it again), we tried the following options:

  • Just to verify that we could not use the Flow (display) name to turn it off, we used it in the Turn Off Flow action:

Error with code InvalidPowerFlowName: ❌“The provided flow name ‘When a row is added, modified or deleted -> Create an approval’ contains invalid characters.”

  • When we use the GUID of the Flow in the Turn Off Flow action:

a successful completed action indicated that the Zombie Flow was turned off!

  • We could even use the Delete Flow action with the GUID:

to delete the Zombie Flow from the Dataverse Process table forever!

And this is how we Turned Off and Deleted the deleted Zombie Flow (even from the API url)! 😎

9 thoughts on “Power Automate: delete a deleted Flow

  1. I have been looking all over the internet for this solution, and any time I query for information on how to delete a stranded flow in which I receive the error “Flow Does Not Exist” or “Could not find flow” from powerautomate, I hit brick walls. People on the powerautomate forums talking about how this is impossible (for example, https://powerusers.microsoft.com/t5/Building-Power-Apps/Could-not-find-flow-error/td-p/1822222) but I LOVE that with a little data scraping and scouring we are able to find a SOLUTION.

    I ended up using your example environment URL:

    https://admin.powerplatform.microsoft.com/environments/environment/%5BENV_URL%5D/hub?geo=Na

    …which I located within powerautomate itself:

    https://make.powerautomate.com/environments/%5BENV_URL%5D/flows/

    …and I was able to locate the ID I needed to create a manual button flow to trigger the zombie flow delete. I can NOT thank you enough! I am far too giddy over this but it has been something I have been looking to solve for over a year now. Thank you again 🙏

  2. Thanks much. We had a flow that was deleted, but still running each time the trigger was activated. We could find the flow in activity monitor, and navigate to it, but turning it off from gui failed, and no actions could be taken on it.
    Turning off the flow using the power automate management – “Turn off flow” and “Delete flow” worked, and now navigating to the flow shows no information, and that it’s been properly deleted.
    Thanks!

    1. Hi Kishor, do you get any kind of notification?
      I have verified in multiple environments that this endpoint in any browser works.
      Are you sure you have a Dataverse database installed in the Power Platform environment?
      Do you have the right permissions in the Power Platform environment? System Administrator would be the best Security Role to have using this back-end approach.

  3. Hi there, I am having the same issue. May I know what is the environment URL in step 3? How is like? is it the tenant ID?

    1. This post worked 100% for me. In my case my zombie flow kept triggering and its activity also kept appearing on the Monitor option on the left pane of Power Automate, I was even able to see the run history so while clicking on it I figure out the Flow ID from the URL.

      It is something like make.powerautomate.com/environments/[envID]/flows/[flowID]

      I used the [flowID] on the zombie killer flow and worked.

Leave a comment