How temporalio/temporal works
Temporal is a server-side durable execution platform: clients submit workflow operations, the server coordinates persistent workflow state and task dispatch, and workers perform application logic before reporting results. The source map identifies frontend, history, matching, CHASM, visibility, and persistence as major runtime areas; the README also highlights retries and resilient execution. Several implementation paths are documented by sampled references, but unsampled runtime handoffs are shown only as unverified dashed links or omitted.
Main entry points: workflow_handler.go Frontend API · history_engine.go History engine · matching_engine.go Matching engine · visibility_manager_impl.go Visibility manager
Components 20
Client-facing services
- Frontend API
service/frontend/workflow_handler.go
Durable execution
- History engine
service/history/history_engine.go - CHASM engine
service/history/chasm_engine.go - CHASM framework
chasm/engine.go - Workflow runtime
chasm/lib/workflow/workflow.go - Activity runtime
chasm/lib/activity/activity.go - Schedules
chasm/lib/scheduler/scheduler.go - Callbacks
chasm/lib/callback/component.go - Nexus operations
chasm/lib/nexusoperation/operation.go
Task dispatch
- Matching engine
service/matching/matching_engine.go - Worker queries
service/matching/workers/worker_query_engine.go
State and operations
- Namespace replication
common/namespace/nsreplication/transmission_task_handler.go - Worker versioning
common/worker_versioning/worker_versioning.go - Visibility manager
common/persistence/visibility/visibility_manager_impl.go - Search attributes
common/searchattribute/manager.go - Execution persistence
common/persistence/execution_manager.go
Other components
- Temporal clients
- Application workers
- Persistence database
- Nexus endpoint
Connections 20
- Temporal clients → Frontend API: submits requests
- Frontend API → History engine: routes operations
- History engine → CHASM engine: delegates CHASM
- CHASM engine → CHASM framework: uses framework
service/history/chasm_engine.go - History engine → Workflow runtime: uses runtime
service/history/history_engine.go - Frontend API → Activity runtime: integrates activity
service/frontend/workflow_handler.go - Frontend API → Schedules: integrates schedules
service/frontend/workflow_handler.go - Frontend API → Nexus operations: integrates operations
service/frontend/workflow_handler.go - Frontend API → Namespace replication: integrates replication
service/frontend/workflow_handler.go - History engine → Matching engine: requests matching
service/history/history_engine.go - Matching engine → Application workers: dispatches tasks
- Application workers → Matching engine: polls tasks
- Matching engine → Worker queries: evaluates filters
- Matching engine → Worker versioning: uses routing data
service/matching/matching_engine.go - History engine → Execution persistence: persists executions
- Execution persistence → Persistence database: reads and writes
- Visibility manager → Search attributes: maps attributes
common/persistence/visibility/visibility_manager_impl.go - Visibility manager → Persistence database: stores visibility
- Nexus operations → Nexus endpoint: invokes endpoint
- History engine → Namespace replication: coordinates replication