Terminating Multiple Workflow Instances.

March 8, 2012 | KB: 1012103
Workflow Suite 8

Summary

An improperly configured starting rule may trigger a large number of workflow instances. This situation, coupled with an improperly configured Repeat activity in the triggered workflow, may result in an endless loop. If this happens, you may wish to manually edit the Workflow SQL database to terminate all started instances of that workflow instead of using the Workflow Designer to terminate instances one at a time.

Update for Workflow 8.3

The procedures described in this KB do not apply to Workflow 8.3. Instead, Workflow 8.3 offers a way to terminate workflow instances in the Workflow Designer or Workflow Administration Console. See the online help files for terminating workflows in the Workflow Designer or the online help files for terminating workflows in the Workflow Administration Console for more information. Editing the Workflow 8.3 SQL database to terminate instances is not supported and will not achieve the desired results.

More Information about editing the Workflow 8.0 SQL database

Before terminating the workflow instances, make sure that you have disabled the appropriate starting rule and reconfigured that starting rule so that no new instances are constantly being created.

Warning: Before modifying your Workflow database, make sure that you have a valid backup and understand how to restore the database if a problem occurs.

Run the following SQL query on your Workflow database to terminate all started instances of a specific workflow:

update [search instance status]
set [status] = 1
where [id] in
(select sis.[id]
from [search instance status] sis inner join [search instance] si
on sis.[id]=si.[id]
where si.[workflow name] = 'YourWorkflow'
and sis.[status]=0)

Setting the status to 1 marks the workflow instance as being "Completed." Setting the status to 3 marks the workflow instance as being "Terminated."

Note: The history for any workflow instances manually terminated in this manner may no longer be valid.