Tuesday, October 16, 2007

Huge Issue: the Workflow Data is Purged From the SharePoint Database After 60 Days

Last week we’ve found a strange issue on one of our SharePoint servers – workflow histories on documents that were approved more than 2 months ago were missing! After some Googling I came across the following post on MSDN: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2272887&SiteID=1&mode=1.
It contains an in-detail description of this behavior. Briefly, SharePoint provides the Workflow Auto Cleanup timer job, which is enabled by default. This job performs workflow cleanup – removes references between workflow instances and list items (documents) from the database. Workflow execution history information though is not affected by cleanup procedure. It is stored in the history list for the specified workflow, which is a simple SharePoint list. Microsoft describes that this behavior is by design and by performance reasons.

However, if this behavior is not expected in your solution, you may disable Workflow Auto Cleanup job on the server. To do this, go to Central Administration -> Operations -> Timer Job Definitions. This will prevent any deletions of your workflow data.