I was talking exactly about this some days ago and, after a bit searching, here's the solution (thanks to Zhisheng Huang). 
Windows Workflow comes with SQL persistence as the way to persistence a workflow instance, but sometimes having a simple file-based persistence could be interesting. This solution does exactly this...
To use it, simply add the service to the runtime.
FileWorkFlowPersistenceService fServ = new FileWorkFlowPersistenceService(".");
workflowRuntime.AddService(fServ);
UnloadOnIdle returns true always in the implementation. So you can see that the workflow is persisted after each call when it becomes idled if you hook up the appropriate event:
workflowRuntime.WorkflowPersisted += delegate
{
Console.WriteLine("Workflow persisted");
};
Attachment(s): FileWorkFlowPersistenceService.cs