SharePoint 2013 Enterprise, on premise with Nintex Workflow 2013.
We have a workflow on a list, that sometimes hangs on wait events. Users do not really know that the workflow has stopped, and continue editing the item properties until it is complete. The user does not know that the workflow is completed, and one of the last steps of the workflow is to declare the item as a record.
I need to be able to loop through all the items in the list, find those that are completed (a specific field will have one of two values), and check to see if a specific workflow is either still running (hung waiting for a change that has already occurred) or errored. When I identify an item that meets these conditions, I need to kill the specified workflow if it is running, and declare the item as a record.
Any ideas would be most appreciated.