SharePoint 2007 Workflow Persistence Service

Yesterday a friend asked me about the Windows Workflow (WF) Persistence Service in SharePoint 2007. As you might know SharePoint persists the state of workflows when it hits a persistent point. However the SharePoint WF host does not use the default Persistence Service provided by WF. In other words, you won’t see the Persistence Service database as part of the SharePoint 2007 installation. In that case how does SharePoint 2007 persists the state of long running workflows?

The WF persistence service of SharePoint 2007 is implemented as part of the SPWinOePersistenceService class of the Microsoft.SharePoint.Workflows namespace. This class implements the SaveWorkflowInstanceState and the LoadWorkflowInstanceState of the WorkflowPersistenceService class. The implementation of those two operations calls the SaveInstanceData and LoadInstanceData methods of the SPWinOeHostServices class which in turns calls the methods with the same signature in the SPWorkflowManager class. The following diagram illustrates the calls cycle.

 

Where is the data stored? The data is stored as a compressed binary representation in the Workflows table of the SharePoint content database. The column InstanceData represents the current workflow instance state.

 

6 Comments

Comments have been disabled for this content.