I am creating a WCF WorkflowService and the client is making an async call to the service. The workflow is quite long running, once the client disconnects the connection (i.e. closes the application the request was made from), the workflow continues and doesn’t stop. How does this work? Once the cleint disconnect, doesn’t the service instance gets destroyed, and the workflow should stop?
Why is it by default behaving as “fire and forget”, i.e. one-way?
Edit: Well, i thought, once the client gets disconnected, the service instance is destroyed, and the workflow aborts
A workflow engine models long-running asynchronous processes. Such processes can span second, hours, weeks and even years and may involve one or many participants. It is therefore unreasonable and undesirable to require a connection to be kept open.
A Windows Workflow Service saves its state to some data store, usually a database, so that if nothing happens in that workflow for a specified amount of time, it can be saved to the database and unloaded from memory. In the future, when someone calls one of the WCF operations related to that workflow instance, it is revived from the database and execution continues as if it was always loaded in memory. This allows a great many workflow instances to exist at any single point in time where only a small part of them are actually taking up computer resources.
Durability is also an important feature of a workflow service. If there is a workflow that has been going on for a long time, the last thing you want is all its state and data to be lost and that, if at all possible, you’ll need to start it all over again. This is why the state information of a workflow does not rely on something as fragile as a network connection.