local.WithLocalConfig(&local.LocalConfig{Engine: engine}) instead of the SDK-built default engine. You create and own the durable-go engine — required for AES-GCM payload encryption, journal MAC, and a step-token key that survives a process restart. Same split as temporal.WithTemporalClient.
Source: examples/agent_with_durable_engine/
What it demonstrates
durable.NewEnginewithWithPayloadCodec,WithJournalMACKey,WithStepTokenKeylocal.WithLocalConfig(&local.LocalConfig{Engine: engine})onNewAgent- Caller-owned engine lifecycle (
defer engine.Close()—a.Close()does not close it)
Run
Fromexamples/ (local runtime only — no Temporal or Restate):
dataDir:
Key code
Engine — see In-Process runtime.
Expected output
Learn more
In-Process Runtime
SDK-built knobs vs caller-owned Engine
Temporal Client
Same ownership pattern for Temporal