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.
- [Solved] SharePoint Access Denied error editing Document Name
- See actual SharePoint error exception modify web.config
- SharePoint 2010 DataForm Unable to display this Web Part System.StackOverflowException
- SharePoint List redirect user after submitting form NewForm.aspx
- How to retrieve all SharePoint Online List Items using Rest API
- SharePoint workflow Canceled - Coercion Failed: Unable to transform the input lookup data into the requested type
- SharePoint error cannot connect to the configuration database
- Not receiving email notification alert in SharePoint Online workflow - Power Automate, FLOW
- How to create SharePoint List Item programmatically
- SharePoint CAML query error - The XML source is not correct
- Sharepoint Server 2016 installation Prerequisites with download links
- Sharepoint errors were found when compiling the workflow
- Send Email with attachment using SharePoint PowerShell, SMTP server
- Sign in as different user missing in SharePoint 2013
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- SharePoint Managed Metadata Hidden Taxonomy List - TaxonomyHiddenList
- Changed AD user display name showing old name in SharePoint
- How to migrate SharePoint Designer 2010 workflow to Power Automate FLOW (Microsoft Office 365)
- SharePoint Server 2016 error Microsoft Office Online Server 2016 cant be installed on the same machine as a Microsoft SharePoint Server product
- Fix SharePoint 2019 installation error This product requires Visual C++ Redistributable Package for Visual Studio 2017
- Deploy SharePoint wsp solution package using PowerShell
- How to delete SharePoint List Item programmatically
- New-SPLogFile PowerShell - create new SharePoint log file
- SharePoint An unexpected error has occurred - Correlation ID and Merge-SPlogfile
- Change SharePoint search results FullTextSqlQuery RowLimit 10000
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed
- Bypass domain name for IIS site (SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help.
- 'Edit Document' Requires a Windows Sharepoint Services-compatible application and Microsoft Internet Explorer 6.0 or higher
- SharePoint list excel import error - Title is a required filed and can't be empty
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms..
- Cannot load PowerApps form in SharePoint Online due to repeated authentication
- How to hide quick launch in SharePoint
- How to exclude results from SharePoint Search
- SharePoint Designer Workflow error - Coercion Failed: Input cannot be null for this coercion
- Get-ADUser PowerShell - Get AD user details using email address
- PowerShell iterate and get all SharePoint sites and sub sites
- SharePoint Server 2016 IT Preview Deprecated Removed features
- SharePoint excel error - A problem occurred while connecting to the server. If the problem continues, contact your administrator.
- Merge-SPlogfile PowerShell - SharePoint Correlation ID error
- SharePoint Server 2016 IT Preview - new improved Features and Enhancements
- Recover SharePoint if the SQL Server IP changes
- SharePoint PowerShell Merge-SPLogFile filter by time using StartTime EndTime
- SharePoint formula - Calculated columns cannot contain volatile functions like Today and Me
- [Solved] SharePoint System.IO.FileNotFoundException was unhandled
- Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration - Android
- Get Wifi Details : Android Programming - Android
- JSON Syntax : JSON Tutorial - Json-Tutorial
- Word count in Notepad++ - NotepadPlusPlus
- SharePoint Server 2016 error - Failed to connect to the configuration database - SharePoint
- Android Alert Dialog with Checkboxes example - Android
- java.lang.NoClassDefFoundError android.support.v4.content.LocalBroadcastManager - Android
- [Notepad++] Remove CR Carriage Return and LF Line feed (CRLF) - NotepadPlusPlus
- Failed to install Android.apk on device 'emulator-5554': timeout - Android-Studio
- How to get Mobile Screen Resolution Width and Height programatically - Android
- Tomcat Manager Default Username and Password - Tomcat
- Turning Off Chat in Gmail - Google
- [Solved] SharePoint Illegal operation attempted on a registry key that has been marked for deletion - SharePoint
- Find Sum of two numbers - C-Program
- Struts 2 Hello World Example in Eclipse - Java