Hello,
is there any way to cancel all or a selection of running flows, if not yet via the GUI then at least using Powershell?
Thanks
Hi @ Cologne_Claret,
Microsoft flow support to cancel one running flows on the run history.
Cancelling multiple running flows is not supported in Microsoft flow currently.
You could submit an idea to Flow Ideas Forum if you would like this feature to be added in Microsoft Flow,:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
Regards,
Alice Zhang
Thanks Alice 🙂
If the moderator agrees I'll leave this topic open until it hopefully is.
A workaround could be to make a copy of the running flow and then delete the flow with running tasks.
Hello, @Cologne_Claret!
Have you had an opportunity to apply @Spångberg‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
This worked for me. Thank you!
Hello Spangberg,
thanks for the suggestion but this isn't a solution here.
When you have a flow running a number of times where you are waiting for approvals you cannot simply delete the flow as it would kill all those ongoing approvals where you may be modifying the list contents too. based on approval status.
In this case you need to be able to kill individual Flow executions rather than deleting the Flow.
Regards
Cologne_Claret
This was so helpful. Thank you.
My experience (in chrome) was that this successfully cancelled all the running instances on the first page, and the very first one after pressing 'see more', but no more after that. I borrowed and adapted the same idea, and used this script on the 'running' screen instead of 'all runs':
confirm = function () {return true;};
setInterval(function () {
$(".fl-StatusInCell:contains('Running')").parent().parent().find('.ms-DetailsRow-cell').first().click();
$(".fl-StatusInCell:contains('Running')").parent().parent().find('.ms-DetailsRow-cell').last().click();
$(".fl-StatusInCell:contains('Running')").parent().parent().find('.ms-DetailsRow-cell').first().click();
$('button[name="Cancel"]').click();
},5000);
... no need to click 'see more' as it always just cancels the first running instance and relies on the fact that the list automatically reloads after cancelling. Without selecting the last row then reselecting the first it doesn't work for some reason. This successfully cancelled all running instances.
Thanks again, I never would have had any idea where to even start with this without reading your method.
Is there any option to end all instances like we have terminate workflow instances in Nintex? please suggest
Hi
We used the script listed by @DavidBaker85 (thank you for adding it here!) and also found we had to reference the jquery library. It is worth noting that we had to paste it twice. If it has been sitting, the first time it comes up with an error, but is good after the second paste. From there we added the script that David has noted.
Very very helpful!!! Thanks so much for this. 😁
Is there a similar script to 'resubmit' multiple flow instances, seems in case of resubmit, it redirects to a new page and breaks the script in the console after executing the first instance only? Thanks!
var jq = document.createElement('script');
jq.src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict()
confirm = function () {return true;};
setInterval(function () {
$(".fl-StatusInCell:contains('Cancelled')").parent().parent().find('.ms-DetailsRow-cell').first().click();
$(".fl-StatusInCell:contains('Cancelled')").parent().parent().find('.ms-DetailsRow-cell').last().click();
$(".fl-StatusInCell:contains('Cancelled')").parent().parent().find('.ms-DetailsRow-cell').first().click();
$('button[name="Resubmit"]').click();
},5000);
Hello @Anonymous
it give me this error "Uncaught ReferenceError: $ is not defined" how can i solve it...? because i am facing the same problem
Thanks & regards
Yash
Believe it or not, STILL useful suggestion! Thank you!
For those who can't afford to simply delete the old flow, check out Power Automate : Cancel All Running Flows – James Hall's Dynamics 365 Blog (dynamicscrm.blog). He uses a javascript bookmark button. If you're brave enough to trust it 😜
Tarjani,
Thanks for this. This has helped multiple times, most recently today after a database update and failing to turn on the flow block we built. That said, I am seeing a new error and not sure if a rewrite might be needed for a future version:
common.2ae306e926d628c1fb28.2.js:163 Warning: The Announcer component will soon be deprecated in a future release.
Please use the Announced component from Office UI Fabric instead.
Thanks for sharing this script. Saved me a lot of time!
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |
User | Count |
---|---|
49 | |
30 | |
23 | |
20 | |
19 |