Remove Nintex Running Task and Workflows for deleted list or items

  • 30 January 2017
  • 6 replies
  • 282 views

Badge +4

I have deleted (even from recycle bin) the list or items, which had approval tasks. Now those task are either hanging on Nintex mobile, or is showing on Nintex web part report.as running instance.

webpart

So far i have:

  1. Removed task for deleted item from web part.tasks
  2. I cannot terminate by using the URL: http://xxxxx/xxxxxxx/_layouts/NintexWorkflow/Preview.aspx?&InstanceId=f3651ee6%2D4f40%2D4c87%2D9764%2Defc6bb0351d4  since the list/ item has been deleted already
  3. Purged list data from site settings using various filters:purge from site settings
  4. Used the power shell to terminate and sync: NWAdmin.exe -o SyncTerminatedWorkflows -url teamsiteurl [-preScan] [-verbose] [-confirm] [-showMissingItems] [-terminateDeletedItems]
  5. Removed old published instances of workflow: WorkflowOrphan01.pngWorkflowOrphan02.png
  6. Purged data using power shell: 

          NWAdmin.exe –o PurgeHistoryListData -siteUrl http://yoursite.com/ -lastActivityBefore 2014-07-01 00:00 -state       SELECT       STATE    NWAdmin.exe -o PurgeWorkflowData -state All -url http://yoursite.com -lastActivityBeforeLocal    2014-07-01T00:00:00 -state SELECT STATE

  7. However i am not comfortable using:
    DECLARE @return_value int EXEC @return_value = [dbo].[PurgeWorkflowData] @SiteID='YOUR SITE COLLECTION GUID', --Update to your Site Collection ID @LastActivityDate = '2014-07-01' --Setting lastworkflowactivity time, this is actions executed older than the date specified SELECT 'Return Value' = @return_value GO 
    May be above query is my last resort.

 

Is there any other solution that i am missing?


6 replies

Userlevel 7
Badge +17

Hi ‌. Have you found a solution for your problem that you could share with us?

Regards,

Tomasz

Badge +4

No i have not Tomasz.

Badge +9

Tomasz Poszytek‌ The solution that nintex gave me was to expand nintex database, find dbo.WorkflowInstance table, right click and select top 1000 rows, scroll to the bottom of the result and copy/note the site id, go to SharePoint ca server, find your problematic site id using power shell, match both site id's, if does not match we can assume that the site has been deleted/moved, enter: NWAdmin.exe -o PurgeWorkflowData -deletedSites and confirm with yes. It kinda of solved some of the hanging task problems.

Badge +9

Below removed tasks if list/ list item was deleted prior to task completion.

## -url = use subsite to cancel tasks if workflow is created in subsite else use site collection if workflow created in site collection.

NWAdmin.exe -o SyncTerminatedWorkflows -url http://portal.mockcompany.com/sites/department/hr -terminateDeletedItems

Hope this helps someone!

Badge +1

Hi, 

I ran the above command, and there was a site workflow running, which was cancelled. Would this command cause a site workflow to cancel? 

Thanks

Badge +9

It may I am not sure. Initially you would run this command if the lis item has been deleted prior to completing the workflow task, which in return will sync the tasks that are assigned to users and not show tasks for items that are already deleted.

Reply