Issue
When publishing a workflow that contains User Defined Action (UDA), the following error might occur:
soap:ServerServer was unable to process request. --> Failed to publish workflow: Error in the application.
Error Code
Resolution
Increased the UserDefinedWorkflowMaximumComplexity using the following PowerShell script:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$new_limit = 50000;
$webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup('webApplicationURL)
$webapp.UserDefinedWorkflowMaximumComplexity = $new_limit
$webapp.Update()
Additional Information
Workflow library failed to compile because it exceeded UserDefinedWorkflowMaximumComplexity of 7000