cancel
Showing results for 
Search instead for 
Did you mean: 

How to cancel all workflows on a list

Workflow Hero
5 1 2,650

Sometimes I needed to cancel all workflow on a specific list.
The following powershell script will help you to do this.


#Site URL
$web = Get-SPWeb "http://urlforsite.com";
$web.AllowUnsafeUpdates = $true;
#List Name
$list = $web.Lists["ListName"];
# Iterate through all Items in List and all Workflows on Items.        
foreach ($item in $list.Items)
{
foreach ($wf in $item.Workflows)
{
#Cancel Workflows       
[Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf);     
}
}
$web.Dispose();

1 Comment
Workflow Hero

This really should be a ui option on the list. Cancel all errored workflows.