R – How to persist the workflow when server system is crashed

workflowworkflow-foundation

I have a problem with Workflow persistence. i.e., in my Workflow i used Listen Activity, in that one branch having Handle External Activity and other branch having delay Activity(with 3 Days Time Out).

So, Problem is with in 3 days of time handle External Activity is not fired. so the Delay Activity is fires when it time comes(means delay Activity should fired).

Before Either Handle External Activity or delay Activity Fires still it(workflow) is Idle State. In 3 days of time System(means Server which my workflow is executing) was Crashed.(before handle external Activity or delay Activity Fires).

It is possible "if system is again is started(after repairing the System) the workflow is start from last point."

please provide me solution.

Best Answer

If you add a SqlWorkflowPersistenceService to the workflow runtime and set unloadOnIdle to true this will persist all you workflows to disk as soon as they become idle. When the server crashes and it is restarted it is able to start the workflow as it last was saved.