I have created a SharePoint 2013 Workflow in Visual Studio 2012. This workflow is activated when a list item is modified.
Once the list item modified, the workflow shows as the started. But on clicking "started" or "workflow name", it throws an error:
The given key was not present in the dictionary.
[KeyNotFoundException: The given key was not present in the dictionary.] System.Collections.Generic.Dictionary`2.get_Item(TKey key) +14122715 Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.GetRetryMessage(WorkflowInstance instance) +936 Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.GetInstance(Guid instanceId) +463 Microsoft.SharePoint.WorkflowServices.ApplicationPages.WrkStatPage.OnLoad(EventArgs e) +611 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Edit: Prior to the above error, an http 401 error (Token contains invalid signature) was thrown on workflow initiation. After following the steps mentioned here, it started throwing the above error.