locked
Canceling running instances of a workflow vs deleting workflow entirely? RRS feed

  • Question

  • I've got a SPD workflow associated with a list and is is currently running several dozen instances.   How do I cancel those instances without deleting the workflow itself from the list?   I.E., I'd like new list items to spawn instances of the workflow, just remove the currently running ones...
    Wednesday, February 3, 2016 6:43 PM

Answers

  • Hi scifiguy20904,

    Without using PowerShell, you should cancel the workflow instance for items one by one.

    An article about how to cancel a workflow instance on a list or library for your reference:

    https://technet.microsoft.com/en-us/library/cc298693(v=office.14).aspx

    Best Regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Wednesday, February 17, 2016 2:02 AM
    • Marked as answer by Victoria Xia Tuesday, February 23, 2016 3:14 PM
    Thursday, February 4, 2016 8:34 AM

All replies

  • #Cancel all workflows in a specific list
    $web = Get-SPWeb "[site URL]";
    $web.AllowUnsafeUpdates = $true;
    $list = $web.Lists["[list name]"];
    foreach ($item in $list.Items) {
      foreach ($wf in $item.Workflows) {
        [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf);      
      }
    }
    $web.Dispose();

    Wednesday, February 3, 2016 7:49 PM
  • sorry, i should have been more specific. i have to use an interface rather than code.  can i do it in SP Designer or in SP?
    Wednesday, February 3, 2016 8:25 PM
  • Hi scifiguy20904,

    Without using PowerShell, you should cancel the workflow instance for items one by one.

    An article about how to cancel a workflow instance on a list or library for your reference:

    https://technet.microsoft.com/en-us/library/cc298693(v=office.14).aspx

    Best Regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Wednesday, February 17, 2016 2:02 AM
    • Marked as answer by Victoria Xia Tuesday, February 23, 2016 3:14 PM
    Thursday, February 4, 2016 8:34 AM
  • scifiguy,

    You can click on an item and select "Workflows".  Then click on the workflow in progress and click on the "Terminate workflow" link.  You will need to do this for each item with a running workflow.

    Ken

    Friday, February 5, 2016 6:06 PM