Let us consider the following scenario.
- You have a Microsoft Office SharePoint Server 2007 site that includes a document library. This document library contains a document for which the Approval workflow and the Collect Feedback workflow are created.
- You save the site as a template.
- You create a new site that uses the saved template.
In this scenario, two instances of the Approval workflow and of the Collect Feedback workflow are displayed in the document library on the new site.
A workaround to this problem is available at http://support.microsoft.com/kb/951654. But, what about the sites created earlier as described in the scenario. How to remove OOB duplicate workflows for existing sites. You can either remove the duplicate workflows from SharePoint UI, “Document library” > Settings > Workflow settings > Remove Workflows or programmatically remove them. The advantage of the later method is that it can loop through entire farm and fix the problem for all sites in a single shot.
Here is the sample code to remove duplicate workflows at the web application level.
Also, after removing the duplicate workflows, when we run any OOB workflow ( like Approval, Collect Feedback) or custom workflow, we will see this error message “The workflow failed to start due to an internal error”. The reason being "Office SharePoint Server Workflow Task" content type is missing. In order to create this content type the OffWFCommon FEATURE needs to be activated. This can be done using the following command:
stsadm -o activatefeature -url http://server/sites/SiteName -force -name OffWFCommon