๐ง Temporal Basic Architecture
Understanding Core Concepts with Visual Diagrams
This presentation helps students clearly understand the core concepts of Temporal: Workflow, Activity, Worker, and how they relate.
We'll simplify the internal architecture and illustrate the flow of execution.
๐ Core Definitions
Workflow
The main orchestrator. Defines what should happen and in what order.
- โ Durable
- โ Stateful
- โ Resumable
Activity
A unit of work that does the actual job (e.g., sending emails, processing payments).
- โ Stateless
- โ Retryable
- โ Can timeout
Core Definitions Continued
Worker
A process/service that hosts Workflow and Activity implementations and polls the Temporal server for tasks.
Temporal Server
Manages state, schedules tasks, handles retries and failures. Think of it as the brain behind the system.
๐ Architecture Diagram
๐ How to Read the Diagram
Step-by-step flow:
- Client initiates a Workflow using a stub (proxy)
- The Workflow code is executed by the Worker, but orchestrated by the Temporal Server
- The Workflow schedules Activities, which are picked up and executed by Workers
- Workers send back results to the Workflow
- The Workflow resumes or finishes
๐ก Key Concepts Comparison
Concept | Durable | Stateless | Retry/Timeout Logic | Hosted By |
---|---|---|---|---|
Workflow | โ | โ | Handled by Temporal | Worker |
Activity | โ | โ | Handled by Temporal | Worker |
Worker | N/A | N/A | N/A | You |
Key Insight: Temporal handles all the complex retry and state management for you!
โ Best Way to Remember
Mental Model Analogy:
- ๐ง Workflow = Brain (plans what to do)
- ๐คฒ Activity = Hands (do the actual work)
- ๐ค Worker = Robot (runs the brain and moves the hands)
- ๐ข Temporal Server = Mission Control (coordinates everything)
๐ฏ Why This Architecture Matters
Separation of Concerns:
- Orchestration logic (Workflow) vs Business logic (Activity)
- Stateful coordination vs Stateless execution
Reliability:
- Workflows survive crashes and resume where they left off
- Activities can be retried automatically
- Everything is durable and observable
๐ Ready for the Journey?
This basic understanding and mental model will make every following lesson click more easily.
Key Takeaway:
Think in flows, not functions!
Your mind is now prepared to tackle Temporal workflows with confidence.