I have a simple Windows Workflow 4.5 workflow (screen snapshot at end of post) hosted as a WCF service in IIS. I've set up persistence using the SQL Server store provided by Microsoft.
The workflow accepts a document ID and a boolean indicating if it needs to pause and wait on human activity (review by a human). If the workflow needs to wait, it has a Receive() activity that correlates on the document ID and pauses (which creates a bookmark behind the scenes). Else it runs to completion and routes the document.
Everything works perfectly as long as we don't reboot the server or do anything like recycling the app pool for the service. As I understand persistence, the workflow should be persisted after the configurable "Time to idle" period, such as encountered WHEN WAITING TO RECEIVE A MESSAGE... I've set this value to a a very aggressive one second.
However, in cases you'd expect in the real world for a long-running workflow, if we simulate a server crash by rebooting or recycling the app pool, the workflows waiting with Receive() never respond. Are we supposed to be doing something special to "rehydrate" the workflow after the server comes back up? Does correlation not work for workflows that are persisted?
The Receive() that never fires after the server reboot is highlighted in yellow in the workflow below: