Workflow Tracking DB Monitor

A sample console application that lists workflows information from the WorkflowTracking database:

Workflow Tracking DB Monitor Project

Advertisements

Remove Workflow Instance from WorkflowTracking & WorkflowPersistence

To remove from WorkflowTracking:

declare @guid uniqueidentifier
set @guid = 'd37ef09d-fd95-4550-aac7-7d467286f3f3';
declare @id bigint;

set @id =
	(select workflowinstanceinternalid from workflowinstance
	where workflowinstanceid = @guid)

delete from workflowinstance
	where workflowinstanceinternalid = @id

delete from workflowinstanceevent
	where workflowinstanceinternalid = @id

delete from userevent
	where workflowinstanceinternalid = @id

delete from activityinstance
	where workflowinstanceinternalid = @id

delete from activityexecutionstatusevent
	where workflowinstanceinternalid = @id

To remove from WorkflowPersistence:

declare @guid uniqueidentifier
set @guid = 'd37ef09d-fd95-4550-aac7-7d467286f3f3';

DELETE FROM [WorkflowPersistence].[dbo].[InstanceState]
      WHERE uidInstanceID = @guid;