I am experiencing a very weird behavior: After using SPListItem.Update() the OnWorkflowItemChanged is triggered (so the title is misleading), but sends the workflow into a sleep state it never wakes up from...
I have a list workflow running on a list item. It actually is a test workflow containing only a OnWorkflowItemChanged Activity as well as a Code Activity:

Within the code activity is only a breakpoint so I can tell when it is being hit.
I go ahead and associatiate the workflow to a custom item list and manually start the workflow on one item.
Here comes the funny part:
- When going via the UI, making any change to my item (e.g. change the
Titlefrom "Goodbye" to "Hello") and saving, the workflow continues as it should --> it hits the breakpoint and afterwards finishes gracefully. - When using the Object model to update the item the workflow gets stuck in the "queued" state (Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time.) --> the breakpoint never gets hit
I run the following code in a seperate console app to update the item:
using (SPSite spSite = new SPSite("http://SP2010"))
{
using (SPWeb spWeb = spSite.RootWeb)
{
SPList list = spWeb.GetList("/Lists/TestList");
var listItem = list.GetItemByUniqueId(new Guid("<myguid>"));
listItem["Title"] = "Hello";
listItem.Update();
}
}
The list item is actually updated (the title changes) and the workflow is "triggered" as in it goes into the queued state - but it never moves forward and never comes out of its sleeping beauty state. There is no way to revive the workflow by e.g. changing the list item again via the UI - it's just dead.
Is there anything I'm doing wrong by just calling listItem.Update()? I already tried list.Update() and listItem.SystemUpdate() but besides that I don't know why the workflow goes into this weird state for such a simple thing.
Update: I tried giving the
OnWorkflowItemChanged a method invoked - even a breakpoint in that method is not being hit (of course it is being hit when using the UI to update the item).