Temporal workflow PoC — retries, signals, sagas in action
No orders yet. Place one above.
Each pizza workflow step maps to a core Temporal feature. This reference explains what each concept is and where it appears.
The top-level orchestrator. A durable function — if the worker crashes, Temporal replays event history and resumes exactly where it left off.
Math.random(), no I/ONon-deterministic side-effect functions that do actual work (HTTP calls, DB writes). Run in the worker's Node.js process, outside the sandbox.
proxyActivitiesWhen addSauce or bakeInOven throw (33% chance), Temporal waits then retries with exponential backoff.
External async messages sent into a running workflow to modify state mid-execution.
isRushed = true → timers shortenedSynchronous read-only requests to a running workflow. Return immediately, don't modify state or appear in event history.
GET /orders/:id → handle.query()curl localhost:3000/orders/<id> while runningsleep() is a durable timer persisted in event history — not setTimeout.
Starts another workflow as a child with its own ID, event history, and independent query/signal capabilities.
quality-check-* child workflows in Temporal UIWorkflow runs inside CancellationScope.cancellable(). Cancel triggers saga compensation:
refundOrderreleaseIngredientsLong-running activities heartbeat to tell Temporal "I'm alive". Missing heartbeats trigger rescheduling to another worker.
"baking 75%") enables resumeWorkers poll a named task queue for work. The worker is a separate process from NestJS — decoupled execution.