cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How do you terminate a workflow for an item that no longer exists?

Jump to solution

Through the Nintex Report web part, I can see a number of workflows that are in progress, but the item no longer exists.  When I try to terminate them I get an error that says "Server was unable to process request. ---> Item does not exist.  It may have been deleted by another user."  Anyone know how you can terminate these workflows?

Labels: (1)
Tags (1)
Reply
27 Replies
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

You could use the NWAdmin operation of SyncTerminatedWorkflows. This is to sync Nintex with SharePoint on the workflows status. But it also has an option to "terminateDeletedItems"

When specified, if a list item is not found, the workflow is treated as if it was cancelled. SharePoint does not cancel a workflow when an item is deleted, so the workflow can still display in reports. This option will tell Nintex Workflow to treat the workflow as cancelled.

Note: Security can cause this command to treat an item as deleted.

Note: Items in the site recycle bin will be treated as deleted.

Usage

NWAdmin.exe -o SyncTerminatedWorkflows -url teamsiteurl [-preScan] [-verbose] [-confirm] [-showMissingItems] [-terminateDeletedItems]

Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

I don't have NWAdmin access.  Is there another alternative for someone with only Site Collection access?

0 Kudos
Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

That's too bad. Another alternative I was going to mention was to use PowerShell to access the WorkflowManager and close them that way. This could be performed using javascript as well as WorkflowManager is available in the COM.

But, before all that, go to Purge Workflow Data from site settings. If you query for something that can find them, such as Last activity is before today, It will show a list of all workflow instances, and a link to the Workflow Instance of each. You can terminate workflows from there. But i'm not sure if it will show the orphaned ones. Well, thinking about this, you will probably get the same result.

I can't think of other non-code ways

Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

And it looks like the Workflow web service does not have a method to end workflows

0 Kudos
Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

You can terminate a Nintex workflow, even when the item no longer exists.

 

Before terminating the workflow, modfiy the URL by removing all the querystring (ListId, ItemId,WorkflowId,Source) and only have the InstanceId in the querystring...

 

Example : Your URL will look something like below,

 

http://xxxxx/xxxxxxx/_layouts/NintexWorkflow/Preview.aspx?&InstanceId=f3651ee6%2D4f40%2D4c87%2D9764%...

 

Now, click terminate workflow and it should work....

 

Hope that helps.

Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

That's so cool!

That's the same URL you get from going to the instance from View Reports that Brendan went to and also from Purge Workflow History.

So just go to the View Reports page, go to workflows in progress, select any workflow and modify the URL as he says just leaving instanceID and it actually works. I ran a test and confirmed in my environment.

Adding that to the bag of tricks.

0 Kudos
Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

Did this answer your question?

0 Kudos
Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

Yes, that worked.  Wish there was a little easier way, since I have a lot of workflows to cancel, but this works.

0 Kudos
Reply
Workflow Hero

Re: How do you terminate a workflow for an item that no longer exists?

Jump to solution

I tried that, but it doesn't seem to work.  It seems that it doesn't show any in progress workflows.

0 Kudos
Reply