Summary
The Workflow Server automatically removes completed workflows that are older than 30 days from the history of started workflow instances. You can manually execute the CleanupTracking stored procedure to delete completed workflows from the Search Instance table that are less than 30 days old.
Workaround 1
Modify the Laserfiche.Workflow.Service.exe.config file to change the default 30 day limit.
<setting name="SearchHistoryCutoff" serializeAs="String">
<value>1</value>
</setting>
Note: Set the value to the number of days you wish to keep completed workflows in the history.
Workaround 2
You can use the following SQL sample to execute the CleanupTracking stored procedure. Replace WorkflowDatabase with the name of your Workflow database and specify the desired cutoff date. All workflow instances completed before the cutoff date will be removed from the table.
DECLARE @RC int
DECLARE @cutoffdate datetime
EXECUTE @RC = [WorkflowDatabase].[dbo].[CleanupTracking]
@cutoffdate = 'yyyy-mm-dd'