You may come into work one day and find that your workflows are failing.  Examining the workflow details will reveal “Failed On Start” errors.  Most likely this is due to a patch.  The fix for the patch is to manually add several lines to  the web.config file of your SharePoint web application servers.  In my case, I was replacing our SharePoint 2010 servers that were running Windows Server 2008 R2 with servers running Windows Server 2012 R2.  All patches were applied before the server was added to the SharePoint farm.  As such, the relevant web.config modifications were not in the web.config file.  The end result was the same, workflows failing to start on the new 2012 R2 front end servers.

Cause & Solution

Workflow Foundation (WF) will only run workflows when all the dependent types and assemblies are authorized in the .NET config file (or added explicitly via code) under this tree:

The above authorized types are the lines necessary to make SharePoint 2007 and 2010 start running workflows correctly again.  They should be applied to every SharePoint farm server that is running the Microsoft SharePoint Foundation Web Application service.

Post Fix

Once you’ve fixed your SharePoint farm servers, the next step is to find all the workflows that have failed on start.  The following PowerShell script will crawl your entire portal and report back on “Failed On Start” workflows

Modify the following lines to fit your organization: