Recovery
With the haematite backend, the server reopens stored histories and recovers active workflows and durable timers. The memory backend loses those records when the process exits.
Replay runs workflow code from the start. At each recorded command it checks the expected operation and returns its stored result. A changed command sequence produces a non-determinism error and stops replay.
Put side effects in activities
A workflow’s code must be deterministic. Network calls, filesystem work and provider requests belong in activities. A worker reports the activity result or a classified failure to the server.
An activity can finish its external work and lose its connection before the completion is durably recorded. Recovery can dispatch that work again. Use an idempotency key that the external system actually enforces. The external system must deduplicate repeated requests.
Time and randomness
The workflow clock is the recorded event timestamp. Randomness is deterministic from workflow and run identity. Use the SDK’s time and random functions, not ambient clocks or entropy.
A timer or signal wait preserves workflow progress without keeping a worker busy. The server recovers the recorded wait after restart.
Versions remain pinned
A package is immutable and addressed by content hash. New starts use the routed version; existing runs keep their pinned version. Retain code required by every live or reopenable run.
Read deployment and routing and backups before operating important runs.