Temporal is an open-source durable execution platform that lets developers write reliable, long-running workflows as ordinary code, automatically persisting state and retrying failures across process crashes and hardware outages. It solves the distributed-systems reliability problem β error handling, retries, timeouts, and state management β so application code can focus on business logic rather than fault-tolerance plumbing. The key mental model: a Temporal Workflow is a crash-proof function that can run for seconds or years, while Activities are the side-effectful steps (API calls, database writes) that the Workflow orchestrates and that can be retried independently.
What This Cheat Sheet Covers
This topic spans 17 focused tables and 130 indexed concepts, 121 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Core Architecture and Components
Temporal's architecture separates the coordination plane (the Temporal Service) from the execution plane (Workers). Understanding how these three roles β Service, Worker, and Client β interact is the foundation for everything else in the platform.
| Concept | Example | Description | |
|---|---|---|---|
Temporal Cloud or self-hosted cluster | β’ The central coordination layer that persists Event History, schedules Tasks, and manages Namespace state β’ Workers and Clients connect to it via gRPC | ||
w := temporal.NewWorker(c, "my-queue", opts) | A long-running process that polls Task Queues for Workflow and Activity Tasks, executes them, and reports results back to the Service. | ||
c, _ := client.Dial(client.Options{}) | SDK object used by application code to start Workflow Executions, send Signals, issue Queries, and run Updates against the Temporal Service. | ||
A running instance of OrderWorkflow for order #42 | β’ The durable, stateful execution unit β uniquely identified by Namespace + Workflow ID + Run ID β’ survives Worker crashes by replaying Event History | ||
executeActivity(chargeCard, input, opts) | β’ A single invocation of an Activity function β’ encapsulates side-effectful, non-deterministic code (API calls, DB writes) outside the replay path | ||
WorkflowExecutionStarted β ActivityTaskScheduled β ActivityTaskCompletedβ¦ | β’ An append-only log of every Command and Event in a Workflow Execution β’ the source of truth used to replay and reconstruct state after any failure | ||
Worker pulls a PollWorkflowTaskQueue response | β’ A unit of work dispatched to a Worker to advance a Workflow Execution β’ the Worker re-executes Workflow code (replay) and emits new Commands | ||
Worker pulls a PollActivityTaskQueue response | β’ A unit of work dispatched to a Worker to execute a single Activity function β’ persisted in the Task Queue until a Worker picks it up | ||
temporal operator namespace create --retention 30d my-ns | β’ An isolation boundary for Workflow Executions, Task Queues, and Search Attributes β’ enforces data retention and access control independently | ||
temporal workflow start --type OrderWorkflow --task-queue orders | β’ Command-line tool for managing Workflows, Namespaces, Schedules, and Search Attributes β’ also used to run a local dev server |