Sharepoint: Errors were found when compiling the workflow. The workflow files were saved but cannot be run. Unexpected error on server associating the workflow.
If you have a LARGE (even just few Approval processes) SharePoint Designer 2010 workflow, sometimes an error occurs stating that the workflow cannot be published.
If you have a LARGE (even just few Approval processes) SharePoint Designer 2010 workflow, sometimes an error occurs stating that the workflow cannot be published. "Errors were found when compiling the workflow. The workflow files were saved but cannot be run. Unexpected error on server associating the workflow" Wow !! "Unexpected Error" ... I bet this wont provide any further details which are helpful for troubleshooting. This error keeps popping whenever you try to publish the workflow.
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 reconfigured 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.
Make sure the February 2011 CU is installed - this will make available the UserDefinedWorkflowMaximumComplexity property.
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 -
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $new_limit = XXXX (Set the limit here as a number); $webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup("http://WebAppURL") $webapp.UserDefinedWorkflowMaximumComplexity = $new_limit $webapp.Update()
Try publishing the workflow now, will get through ! - but takes some time due to heavy workflow (heavy for SPD)
⚡️ Recommendation - For larger workflows, try to restructure to either have more reusable pieces, or be broken out into smaller individual small workflows.
- Setup synonyms or alias or thesaurus in SharePoint
- How to redirect SharePoint Site Collection to different URL
- How to hide quick launch in SharePoint
- SharePoint 2010 DataForm Unable to display this Web Part System.StackOverflowException
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly.
- How to delete SharePoint List Item programmatically
- SharePoint Server 2016 IT Preview Deprecated Removed features
- Create SharePoint Site Collection using PowerShell New-SPSite
- How to create SharePoint List Item programmatically
- See actual SharePoint error exception modify web.config
- SharePoint Server 2016 installation System Hardware requirements
- [Solved] SharePoint Illegal operation attempted on a registry key that has been marked for deletion
- SharePoint Designer Workflow error - Coercion Failed: Input cannot be null for this coercion
- [Solved] SharePoint Access Denied error editing Document Name
- SharePoint 2016 error - Could not find file ManageUserProfileServiceApplicationTenantSimplified.xml
- Bypass domain name for IIS site (SharePoint)
- SharePoint PowerShell Merge-SPLogFile filter by time using StartTime EndTime
- Recover SharePoint if the SQL Server IP changes
- SharePoint CAML query error - The XML source is not correct
- How to enable disable SharePoint Developer Dashboard for tracing troubleshooting
- Change SharePoint search results FullTextSqlQuery RowLimit 10000
- Update Created By (Author) column of SharePoint document using PowerShell
- SharePoint Server 2016 error - Failed to connect to the configuration database
- The service instance
- SharePoint Managed Metadata Hidden Taxonomy List - TaxonomyHiddenList
- Force android app to run in Landscape mode programatically - Android
- Type R is already defined error : Android Error - Android
- Call PHP function on Button click using jquery ajax - PHP
- Can't Run SDK Manager find_java.bat issue - Android
- 10 FTP SFTP Clients and Alternatives - FTP
- auth_client_using_bad_version_title : Error Android Lint - Android
- Delete file using PHP code : unlink() - PHP
- Stop android adb service from command prompt or terminal - Android
- How to add Date and Time to Windows Notepad File - NotepadPlusPlus
- Mac OS X Taking Screen Capture using Terminal - Mac-OS-X
- Create SharePoint Site Collection using PowerShell New-SPSite - SharePoint
- SharePoint workflow Canceled - Coercion Failed: Unable to transform the input lookup data into the requested type - SharePoint
- Android : Prevent App for rotation landscape or portrait - Android
- MySQL 1005 Error : SQLSTATE: HY000 (ER_CANT_CREATE_TABLE) Message: Can't create table '%s' (errno: 150) - MySQL
- How to change Android EditText Cursor Color - Android