Recently a client of mine contacted me about issues when creating workflows in SharePoint 2010. It wasn’t too complex with only 6-7 steps. While they were designing, it started throwing the following error when publishing: Unexpected error on server associating the workflow.
First, I used the following PowerShell script under the SharePoint management console to increase the UserDefinedWorkflowCompexity limit.
$app = get-spwebapplication http://sharepointurl/ $app.UserDefinedWorkflowMaximumComplexity = 40000 $app.Update()
After running the script, the executionTimeout was changed under the site’s web.config file.
<httpRuntime maxRequestLength="51200" executionTimeout="300" />
Finally, when finished, issue an IISRESET.