Information Management Policy to clean up the Workflow History List?
I have several InfoPath 2007 forms (with workflows) that are heavily used in my MOSS 2007 environment, and the some of the Workflow History lists are very large need to be cleaned up. I'm trying to use an (Expiration) Information Management Policy to delete items in the Workflow History list that are Last Modified + X days , but haven't had much success. Has anyone else had success doing this? Thanks, Tim
November 15th, 2010 2:25pm

Hello Tim, Built-in expiration setting only allows "Date Occurred" to be specified for the time period. An alternative is to create a calculated column with formula “Modified + X days”, disable workflow history list “Hide from browser” via SharePoint Designer list properties settings and then create a SharePoint Designer workflow that associated with workflow history list and select "Automatically start this workflow when a new item is created" . Try to use “Pause until date” action in that workflow and specify the newly created calculated field for the time. BTW, SharePoint runs a daily Workflow Auto Cleanup job to permanently delete workflow instances and related task and history entries that still exist 60 days after a workflow is completed or cancelled. For details about Workflow Cleanup Job, please see: http://technet.microsoft.com/en-us/library/cc298800(office.12).aspx Hope it helps. Thanks & Regards. Lily Wu TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Lily Wu
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 9:43pm

Hello Tim, Built-in expiration setting only allows "Date Occurred" to be specified for the time period. An alternative is to create a calculated column with formula “Modified + X days”, disable workflow history list “Hide from browser” via SharePoint Designer list properties settings and then create a SharePoint Designer workflow that associated with workflow history list and select "Automatically start this workflow when a new item is created" . Try to use “Pause until date” action in that workflow and specify the newly created calculated field for the time. BTW, SharePoint runs a daily Workflow Auto Cleanup job to permanently delete workflow instances and related task and history entries that still exist 60 days after a workflow is completed or cancelled. For details about Workflow Cleanup Job, please see: http://technet.microsoft.com/en-us/library/cc298800(office.12).aspx Hope it helps. Thanks & Regards. Lily Wu TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Lily Wu
November 15th, 2010 9:43pm

Thanks for the reply Lily. "Built-in expiration setting only allows "Date Occurred" to be specified for the time period." I don't think that is correct. On a new install, at the top-level site, Site Settings > Modify Site Settings > Site Collection Policies > Create > Enable Expiration. I see 2 options: Last Modified + X days/months/years or Created Date + X days/months/years. I create the policy there and then apply it at the list level. "BTW, SharePoint runs a daily Workflow Auto Cleanup job to permanently delete workflow instances..." I know that's not correct - in the link you provided, look for " Workflow history items themselves are not deleted". The Workflow Auto Cleanup timer job does run daily, but it only deletes workflow associations (which also deletes tasks). It does not delete the items in the Workflow History list. I'm hoping to get feedback from someone who has tried (successfully or not) to clean up the Workflow History list.
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 10:54pm

Thanks for the reply Lily. "Built-in expiration setting only allows "Date Occurred" to be specified for the time period." I don't think that is correct. On a new install, at the top-level site, Site Settings > Modify Site Settings > Site Collection Policies > Create > Enable Expiration. I see 2 options: Last Modified + X days/months/years or Created Date + X days/months/years. I create the policy there and then apply it at the list level. "BTW, SharePoint runs a daily Workflow Auto Cleanup job to permanently delete workflow instances..." I know that's not correct - in the link you provided, look for " Workflow history items themselves are not deleted". The Workflow Auto Cleanup timer job does run daily, but it only deletes workflow associations (which also deletes tasks). It does not delete the items in the Workflow History list. I'm hoping to get feedback from someone who has tried (successfully or not) to clean up the Workflow History list.
November 15th, 2010 10:54pm

Thanks for correcting me, Tim. I forgot the policy at site collection level. What about using SPD workflow to clean up the workflow history list? Thanks & Regards. Lily Wu
Free Windows Admin Tool Kit Click here and download it now
November 16th, 2010 12:47am

Thanks for correcting me, Tim. I forgot the policy at site collection level. What about using SPD workflow to clean up the workflow history list? Thanks & Regards. Lily Wu
November 16th, 2010 12:47am

Hi Lily, If I used a workflow to cleanup the Workflow History list, that would create new items in the list I'm trying to clean up. Thanks, Tim
Free Windows Admin Tool Kit Click here and download it now
November 16th, 2010 7:34am

I ended up writing a console application that deletes the items from the Workflow History list, and then deletes them from the Recycle Bin. First I use it to get the list to a manageable size, then I run it on individual Workflow History lists each night to make sure they stay small. Reply to this thread with an email address if you would like a copy of it - I'll send the source code as well. Thanks, Tim
November 26th, 2010 6:43am

I ended up writing a console application that deletes the items from the Workflow History list, and then deletes them from the Recycle Bin. First I use it to get the list to a manageable size, then I run it on individual Workflow History lists each night to make sure they stay small. Reply to this thread with an email address if you would like a copy of it - I'll send the source code as well. Thanks, Tim
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 6:43am

You can download the console application and source code here: http://code.msdn.microsoft.com/CleanWorkflowHistory
January 28th, 2011 1:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics