Workflow State Persistence
Definition. Storing a workflow instance's state durably so that it survives process restarts, deployments and failures, and can be resumed. Without persistence, a long-running workflow cannot survive a restart, and every deployment becomes a risk to in-flight work.
How it works. Persist state after every step, with a checkpoint identifier. Store enough to resume: the current step, the accumulated data and the completed step list. Make the store durable and consistent with the side effects, or accept that a crash may require idempotent replay. Test resumption by killing a process mid-workflow and confirming it resumes correctly.
Example. A workflow runs for 40 minutes across several steps. A deployment restarts the process, and without persistence all 340 in-flight instances are lost, requiring customers to resubmit. With state persistence, instances resume from their last checkpoint after the restart, and the deployment causes no visible disruption. The test that kills a process mid-workflow is added to the suite.
Use case. State persistence is required for any long-running workflow, and it is the property that makes deployment safe. It is also the basis for resumption and for audit.
Warnings. Persisting state without making steps idempotent means a resume can duplicate side effects. Never store state only in memory for a long-running workflow. And never assume a restart is rare, since deployments are frequent.
Limitations. Persistence adds write load and storage, and it requires a schema that captures everything needed to resume. It also introduces a consistency problem between the state store and external side effects.