Temporal
Temporal logoTemporal · Feature trail

Durable Execution

120 posts · Sep 2020 – Sep 2026

What this trail covers

Temporal Workflows provide a durable orchestration layer for complex business processes and event-driven systems. This post defines Durable Execution as 'crash-proof execution', emphasizing its benefits in improving reliability, simplifying code by focusing on goals over potential problems, and accelerating development by eliminating complex error-handling logic. It details the four key characteristics: virtualization of execution across processes/machines, no time limitation for execution, automatic preservation of application state, and hardware agnosticism. The post highlights how Durable Execution abstracts away failures, allowing developers to focus on application logic rather than anticipating and handling every possible failure mode.

All Temporal trails
  1. When the human is the Workflow: Durable Execution in harsh physical field operationsThis post details the application of Temporal's Durable Execution to harsh physical field operations, specifically for construction and facilities management. The core contribution is modeling each shift as a single Temporal Workflow, addressed by a deterministic ID derived from the schedule. This design decision simplifies the mobile app's interaction by issuing Updates against the Workflow, leveraging Temporal's single-instance semantics. Key technical patterns highlighted include: 1. Replacing GPS with BLE beacons for reliable location tracking in unreliable environments. 2. Implementing idempotency using `workflowIdConflictPolicy: WorkflowIdConflictPolicy.USE_EXISTING` and `workflowIdReusePolicy: WorkflowIdReusePolicy.ALLOW_DUPLICATE_FAILED_ONLY` for duplicate requests. 3. Utilizing the `Signal-With-Start` pattern to handle offline-first operations and ensure events are processed even if the initial 'start shift' signal is lost. 4. Employing an in-workflow request queue with sequence numbers and `latestWins` logic for ordering and deduplication of Updates, serving as an audit trail. 5. Implementing compliance-as-code with Update validators to enforce business rules before state mutation. The post also contrasts this approach with conventional methods, emphasizing the deletion of 'sediment' like cron jobs and reconciliation logic in favor of a durable workflow as the source of truth.