web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to batch cancel fl...
Power Automate
Answered

How to batch cancel flow runs

(0) ShareShare
ReportReport
Posted on by 311

I have a cloud flow that has thousands of flow runs stuck in the "running" status.  I would like to cancel them all.  I've been trying to use PowerShell and the "m365 flow run list" command to get all running flows, loop thru them and cancel each.  The problem is "m365 flow run list" only returns 50 records.  If there's a way to get that command to return more records, or better, to filter the records to only status of "running", then I could work my way through it.

 

I also read that if I copy the flow and delete the original, it will also delete all the runs.  But this flow is part of a managed solution, so I can't delete it.  And I can't uninstall the entire solution as that would mess up a bunch of other flows.

 

Anyone have a suggestion for how I can cancel the "running" flow runs?

Categories:
I have the same question (0)
  • ArchitectMadhan Profile Picture
    1,584 on at

    Hi @tschopp ,

    Hope you would have not tried the Javascript and Flow to remove the running flow instances. Please refer the below link for further steps https://fredrikengseth.com/how-to-cancel-running-power-automate-flows-with-javascript/

     

  • tschopp Profile Picture
    311 on at

    I tried that idea and it didn't seem to do anything.

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at
  • garce Profile Picture
    26 on at

    I had the same issue, some 4k running flows

    • m365cli didn't work because I don't have permissions to install it
    • javascript didn't work and resulted in CORS error everytime

    I ended up using another flow to delete the running flows. The process

    • Obtain runid of flows you want to cancel
    • Save those runid on a csv file
    • Create a "Deleter" flow
      • parse through the csv file
      • Use power automate management connector and cancel flow running 

    The complicated part was obtaining the runid of the runs you want to stop.

    One good thing is that they are part of the url of the page. 

    1. Go to the running flow screen, filter by running

    2. Click more at the bottom. Tedious. Do this many times until you get to the bottom (or you made a lot of progress - maybe 30 times each)

    3. Save the page as html

    4. Open the page in word, you need to use some clever search and replace to delete everything except the runid

    5. Save as text

    6. Open in excel and save as csv 

    Note that there is a "download" option to download a csv with the runids but only works for 100 records.

    It took around 2.5hours to delete all 3-4k running flows

    Hope this helps somebody

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard