A SharePoint 2010 farm has a Web Front End Server with the “Microsoft SharePoint Foundation Web Application” service running and a separate Application Server with the “Microsoft SharePoint Foundation Workflow Timer Service” running (The server does not have the Web Application service running). A workflow has been queued for resumption and the Application server with the Workflow Timer Service tries to resume the workflow but fails.
In this scenario the application server fails to resume the Workflow timer service and the workflow gets stuck in "In progress" status. The Workflow History list shows "workflow failed to run." message
SharePoint ULS log entries may include the following:
OWSTIMER.EXE (0x0E5C) 0x2184 SharePoint Foundation Workflow Infrastructure 72fu Unexpected Load Workflow Class: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Workflow.SPWinOeHostServices.EnsurePluggableServices(SPSite site, SPWorkflowExternalDataExchangeServiceCollection services, ExternalDataExchangeService existingServices) at Microsoft.SharePoint.Workflow.SPWinOeHostServices..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine)
OWSTIMER.EXE (0x0E5C) 0x2184 SharePoint Foundation Workflow Infrastructure 98d8 Unexpected System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Workflow.SPWinOeHostServices.EnsurePluggableServices(SPSite site, SPWorkflowExternalDataExchangeServiceCollection services, ExternalDataExchangeService existingServices) at Microsoft.SharePoint.Workflow.SPWinOeHostServices..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine)
OWSTIMER.EXE (0x0D64) 0x0E98 SharePoint Foundation Workflow Infrastructure frg9 Medium Workflow could not be run because SPWebApplication.UpdateWorkflowConfigurationSettings was not previously called, and the Web Application service has been disabled on this server. Call UpdateWorkflowConfigurationSettings or turn on the Web Application service for this server.
The Workflow Timer Service tries to read the workflow batchsize settings from the web.config or configuration database for a web application. By default, the batchsize setting is in web.config file if the server is running the Web Application service.
If the Web Application service is not running on the same server and script in Method 1 (under the 'Resolution' section) has not been run, the batchsize setting is neither in the web.config file nor in the configuration database, then the operation fails.
Locate one Web Front End server which has Web Application service running, run the following PowerShell command to copy workflow-related configuration from the web.config to the configuration database so it will be available from every server in the Farm.
Start the Web Application Service on all servers that have the Workflow Timer Service running.
Disable the Workflow Timer Service on servers that are not running the Web Application service.
A SharePoint workflow is put in a “dehydrated” state when a pause occurs or gets postponed due to the WorkflowPostponeThreshold. SharePoint 2010 uses a queuing system to control workflow-related stress on farm resources and the content database. By using this system, when the number of workflows executing against a database reaches an administrator-configured threshold, successive workflow operations are added to the queue to be run by the Workflow Timer service. By default, this service receives a batch of workflow work items every minute.
Several farm administrator settings directly and indirectly related to the queuing mechanism affect the performance and scaling for workflow. The following sections describe what these settings do and how to adjust them to meet performance requirements.
The maximum number of workflows that can execute against a single content database before additional requests and operations are queued. Queued workflows show a status of Starting. This is a farm-wide setting that has a default value of 15. This represents the number of workflow operations that are being processed at a time, not the maximum number of workflows that can be in progress. As workflow operations are completed, successive operations will be able to run.
The Workflow Timer service is an exception to the postpone threshold limit and will retrieve batches of items from the queue and execute them one at a time. These batches can be larger than the postpone threshold. The number of work items that the service receives per run is set by using the BatchSize property. The BatchSize property can be set one time per Web Application service instance. The default value is 100. When running on application servers that are not configured to be front-end servers, the Workflow Timer service requires workflow configuration settings in Web.config to be set in the configuration database. This must be done through a script that calls UpdateWorkflowConfigurationSettings() on the SPWebApplication object, which will copy the Web.config settings from a front-end server.