You can use the following SQL query to find workflows inside the Nintex Content database based on their state. Simply modify the "WHERE" argument to look for workflows in other states.
SELECT DISTINCT i.workflowname, i.webid, i.siteid, i.listid, p.CurrentActivityTitle, p.TimeStamp FROM dbo.workflowinstance i inner join WorkflowProgress P on I.InstanceID = P.InstanceID WHERE i.State = '2'
Here are the different states you can query:
when 2 then 'Running'
when 4 then 'Completed'
when 8 then 'Cancelled'
when 64 then 'Error'
Cheers,
Andrew Beals
Hi Andrew, thanks for the great post. I have had some issues with orphaned workflows. The problem is that I cannot terminate them because the list item was deleted. Thanks to your SQL explanation above and on another post I was able to track down the Workflow by instance ID in my NintexWorkflow database. I then changed the state to 8 which cancelled it.
Good work!