Article ID: 2557533 - View products that this article applies to.
When attempting to publish a SharePoint Designer 2010 workflow that is large or uses multiple Start Approval Process actions, an error indicating that the workflow cannot be published will be displayed.
In SharePoint 2010 RTM:
After installing the February 2011 CU:
This problem is caused by the large number of Types that are created during workflow compilation, for workflows with many local workflow variables. It is more common for workflows with multiple Approval Process actions, as each preconfigured Approval Process Action comes with a large set of local variables, for the different configurable property of the Approval Process.
Prior to the February 2011 CU, limits on the complexity of the workflow definition were enforced by the Microsoft .NET 3.0 workflow compiler. With the February 2011 CU, SharePoint uses the SPWebApplication UserDefinedWorkflowMaximumComplexity property to enforce a maximum number of Types in the workflow definition, and prevent compilation in these cases.
First, make sure SharePoint Farm is at February CU or later build, the following property will be made available:
Please refer to the link below for more information:
By installing a CU that includes the server February 2011 CU, SharePoint administrators are now able to prevent compilation of workflows whose compilation would affect the performance of the farm. The default value of the property is 7000, but can be changed based on the needs and profile of the SharePoint farm.
The following PowerShell script can be used to adjust the value per SPWebApplication:
$new_limit = 5000;
$webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(http://WebAppURL)
$webapp.UserDefinedWorkflowMaximumComplexity = $new_limit
To give context to the default 7,000 value a Start Approval Process action contains 1176 nodes, a Start Feedback Process action contains 1010 and an empty Start Custom Task Process contains 13 nodes.
Please note, up to certain number, roughly 10000, the compliation will be restricted by Microsoft .NET 3.0 workflow complier so the workflow size still has a ceiling.
At that point, the larger workflows need to be restructured to either have more reusable pieces, or be broken out into smaller individual small workflows.
Some ways in which the complexity of larger workflows can be reduced include:
(http://go.microsoft.com/fwlink/?LinkId=151500)for other considerations.
Article ID: 2557533 - Last Review: December 27, 2012 - Revision: 7.0