I know you can clean up running workflow instances for deleted items/lists using the SyncTerminatedWorkflows. But I have an issue with another category of running instances....
I'm using the following query to give me running instances:
select siteid, webid, listid,itemid,workflowid,workflowinstanceid
from dbo.workflowinstanceview
where state = 2 and convert(varchar(19),lastactiondate,120) <= @lastactivitydateutc
Using this query, I found a lot of running instances for WEBS which don't exist anymore.
How do you terminate those?
Seems unlikely to me that you can use SyncTerminatedWorkflows for that since I only have a WebID. I don't even have the URL of the web. Is there a way to clean up these instances. I have several thousands of them.