SP Causes Workflow “Failed to Start” Error

Problem

I have some rather complex SPD workflows built. Complex meaning multiple approval levels and multiple tasks. Recently we applied SP1 to our SharePoint Server 2010 environment as well as a recent Cumulative Update (CU). After the update 2 of the workflows began showing this error:

FailedToStart

 

Cause

Running ULS Viewer showed me:

Workflow dll  failed to compile because it exceeded UserDefinedWorkflowMaximumComplexity of 5000

ULSViewer Error

 

I then remembered having to change this setting a 18 months ago when I first built the workflows.

Solution

To modify the UserDefinedWorkflowMaximumComplexity setting, use the following PowerShell:

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) 

$new_limit = 15000;

$webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(http://WebAppURL) 
$webapp.UserDefinedWorkflowMaximumComplexity = $new_limit 
$webapp.Update()

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *