Advanced~26 minHazelJS
Workers, Stores, and Process Model
Deploy AgentRuntime with durable stores and worker identities—concrete process sketch.
- Authors
- editorial-team
- Published
- Last reviewed
Progress is stored locally in this browser.
Direct answer
Prefer the same DI app as your HTTP API for most agents. Add durable SQL run stores and workerId leases when multiple instances process runs. Avoid in-memory stores in production.
Topology sketch
text
[Client] → [HTTP API: AgentRuntime.execute]
│
▼
[SQL durable run store]
▲
│
[Worker N: workerId=...] ← reclaimExpired leases
typescript
const runtime = new AgentRuntime({
llmProvider,
runRepository: sqlStore.runRepository,
checkpointService: sqlStore.checkpointService,
humanTaskService: sqlStore.humanTaskService,
durableSuspend: true,
workerId: process.env.POD_NAME ?? 'local',
});
Serverless: ensure HITL/resume can outlive a single invocation via the durable store—not process RAM.
Artifact: Deployment sketch: API process + worker + SQL run store