Showing results for 
Search instead for 
Did you mean: 
Advocate IV
Advocate IV

Cancelling multiple running flows



is there any way to cancel all or a selection of running flows, if not yet via the GUI then at least using Powershell?



Frequent Visitor

You can select a specific From timestamp to bulk cancelling the flow runs with this website:



sign in with your account as go to Flow details page in its Dashboard 

Advocate II
Advocate II

For those who are looking for a solution, this post will help you

There are Microsoft 365 CLI command & Power Automate REST api endpoint to cancel a flow run

I just observed the same. Will take more care in the future, but it would be very useful to have that script work as well with Office UI Fabric announcer.

Tarjani, thank you so much. This is amazing. Just realized that I have over 100 flows that went with an API Webhook integration with Smartsheet I created just waiting and timing out. I'm fairly certain they have been running for over 14 days. 🤦‍♂️🤦‍♂️ 


I had never run a Javascript action from the browser before.


For anyone out there using Edge and a newbie to all this like I was, here's the steps to do this:

  1. Press F12 on your keyboard, approve the "Developer Tools" question.
  2. Then find the tab that says "Console" at the top. It's two tabs to the right of the "Welcome" tab.
  3. Within this, you should see a ">". This is where you'll paste in the code.
  4. Copy/paste in Tarjani's first bit of code above (starts with "var jq", ends with "noConflict()"). Press enter.
    1. I had to paste it twice; it threw some sort of error the first time. You'll see a red symbol if there's an error.
  5. Now copy/paste in David's code above that starts with "confirm" and ends with "5000);". 
  6. Press enter, and this will start working on its own.

Set it and forget it! I just have mine running in the background right now. 


The worst part is, I added an action for a Teams message to myself from the Flowbot within the flow that for some reason still ran though the Flow has been failing. So I've constantly been getting random messages that say "Webhook successfully created", sometimes at 2:00am! This is saving my sanity.


Thanks again!



@ashiqf Thanks for sharing this post. If applied policies in PowerShell do not allow execution of scripts the  following code works. Cancelled 1153 running flows in a timely fashion.

powershell.exe -ExecutionPolicy Bypass -File "C:\MyPath\cancelFlowRuns.ps1" flowEnvironmentId flowIdforcancellingruns  

Advocate I
Advocate I

Worth noting here that Microsoft have finally given us this functionality in the UI (well, partially at least). PRAISE THE GODS! First, a few weeks ago, it allowed up to 10 and now you can select up to 20 runs at a time to bulk cancel. you can also bulk re-submit in the same way. I guess I understand why they've placed a limit on to avoid accidently selecting and cancelling/re-submitting a whole page when you only meant to do the top one.

So if you're dealing with big numbers like @SandraSoniec with 1153, then the various code based solutions in this thread will probably still be useful to you, as that would still be lot of repetitive clicking. But if you have something more like 100 like @brettofthewild, then just doing it in 5 batches in the standard UI will now be quicker and easier.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,069)