The SharePoint Workflow History maintains a record of each step within a workflow. Everything from approval activity (approve, denial), updates to a workflow, comments and even workflow errors. Workflow history list is created / deployed when you create or consume an out-of-box workflow or custom workflow. the workflow history list is not viewable in a site's All Site Content list but you can access it via the document library's workflow settings. NOTE: Even if a document library associated to a workflow is deleted, the workflow history remains in the site's designated workflow history list for
60 days (more on that in another article). Here's a quick sample function you can use within your custom Visual Studio workflow projects to add some comments to the workflow history list. During debugging on the development server, you can use this function to add debugging comments to the workflow history list or once in production this function can be used to add comments that will help approvers and auditors.
public void CreateWorkflowHistoryEntry(string Outcome, string Description, string OtherData) { SPWorkflow.CreateHistoryEvent(workflowProperties.Web, workflowProperties.WorkflowId, (int)SPWorkflowHistoryEventType.WorkflowComment, this.workflowProperties.OriginatorUser, new TimeSpan(1), Outcome, Description, OtherData); }
Additional Resources: