Products: Nintex Workflow 2013
Â
Â
A common request we see is "How do I cancel/terminate a group of list item workflows that are in a state of 'Error Occurred'?" This article provides instructions on how to accomplish this.
Â
Â
Run the below (attached as well as a *.txt file for your convenience) PowerShell script (PowerShell ISE works well) from a SharePoint Server:
Â
Â
PowerShell Script |
---|
 Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue function Cancel-SPWorkflow(){ } function Get-SPWorkflow(){ } $(Get-SPWeb http://contoso.com).Listse"DocumentLibrary"].Items | Get-SPWorkflow | where {aString]$_.StatusText -match [String]"Error"} | Cancel-SPWorkflow |
Â
To use the script, replace http://contoso.com and DocumentLibrary with the URL of the site and list title you wish to execute the script against.
Â
For the Site Workflow version of this article go here: How to bulk cancel site workflows with a status of "Error Occurred"