SharePoint 2007 Lacks Workflow Auditing

I have been working on an interface to our workflows.  One of our system requirements is to facilitate viewing workflow history on a per user basis.  Specifically, I need to be able to generate a list of all current and past workflows a user, or their team members, has initiated.  Then they need to be able to view a detailed history of the workflow. This has lead me to find some frustrating things about MOSS workflow auditing.  I have discovered there really no reliable way out of the box to audit workflows within MOSS.

Workflow History

When we associate a workflow with a list, we specify a workflow history list for instances of that workflow.  There are some problems with the implementation of this feature.  By default, history items are made unavailable after 60 days.  This is done by a timer job that deletes the association between the history item and the workflow, and you can work around this in a number of ways.  The job can be disabled or you can programmatically set the AutoCleanUpDays setting on the SPWorkflowAssociation to 9999 days, among others.  However, If anything happens to the workflow template, such as redeployment or item deletion then the history is lost as well. 

There are other issues with workflow history such as the possibility of users with sufficient permissions to alter history.  I have read in other blogs, but have not direct documentation, that Microsoft has not intended this to be a permanent record and is more like a log file that gets purged periodically.

WSS Audit Log

MOSS can make use of the WSS auditing features.  There is plenty documentation on how to turn this on at the site, list or item levels.  We can turn this on, and we can even write custom entries into the Audit Log.  However, a log entry is only associated with a site collection, list or item.  This means we can not specifically search for a workflow instance without extra lifting.  It is possible to store XML data in the EventData property of the SPAuditEntry class, but this is not an efficient way to search if we just want a list of all workflows a user has initiated.  

Custom Solution

At this point I have come to the conclusion that a custom solution is in order.  I plan to create an audit database outside of MOSS that my workflows will write to and my workflow interface will read.  This is not the solution I would like to have, but this is what I believe will be the most efficient and straight-forward way of meeting my requirements.

This post is lacking in lots of specifics and details.  I suggest you read through the following blog entries for the full story:





Comments

Juan said…
I came up with a solution. Ping me if you want to try it out.


http://www.imaginets.com/cs/blogs/juanl/archive/2008/09/24/workflow-audit-solution.aspx
Juan said…
SharePoint Workflow Audit available for download!

http://www.imaginets.com/cs/blogs/juanl/archive/2008/10/27/sharepoint-workflow-audit-solution-trial-download.aspx


Juan
Kevin said…
Regarding your sentence:

"I have read in other blogs, but have not direct documentation, that Microsoft has not intended this to be a permanent record and is more like a log file that gets purged periodically."I would like to quote the following notes from Microsoft Technet:

"Workflow history is not intended to be used as a means of auditing workflow events and is not necessarily secure." (http://technet.microsoft.com/en-us/library/cc298800.aspx)
Kevin said…
Thanks for your article. This is a really useful and informative primer on the current SharePoint 2007 Workflow limitations!

Popular posts from this blog

SharePoint 2007

It's Been a While!