This is an obscure error:
Error in commiting pending workflow batch items: System.InvalidOperationException: The event receiver context for Workflow is invalid.
CommitNewSubscriptions(Transaction txn, IList`1 erds)
ProcessWorkItemBatch(Transaction transaction, Work method, IList`1 workItemBatch)
Commit(Transaction transaction, ICollection items)
Let’s skip over wondering what an
erd is (event receiver definition maybe?)- the solution to this is simple, but not obvious. Check you have created properties for TaskID, TaskProperties and Correlation Token. I found this solution at Robert Bogue’s blog. As a side note it is a REAL pain in the ass that setting up TaskIDs and TaskProperties is so manual – or at the very least that tasks with unassigned values for these do not appear with the red ‘warning’ exclamation mark in Visual Studio.