Open-Source Wikis

/

Temporal

/

Services

temporalio/temporal

Services

The Temporal cluster runs four cooperating gRPC services, all built from this repository and started from the same temporal-server binary (cmd/server/main.go). The list of valid services is defined in temporal/server.go:

Services = []string{
    string(primitives.FrontendService),
    string(primitives.InternalFrontendService),
    string(primitives.HistoryService),
    string(primitives.MatchingService),
    string(primitives.WorkerService),
}
Service Source Sharded by Stateful? Page
Frontend service/frontend none no Frontend
History service/history shard ID yes History
Matching service/matching task-queue name partial Matching
Internal Worker service/worker none no Internal Worker

The Internal Frontend is a variant of Frontend optionally enabled for in-cluster traffic; it shares the implementation under service/frontend/.

How they fit together

graph LR
    SDK[SDK / CLI / UI]
    FE[Frontend]
    H[History shards]
    M[Matching partitions]
    W[Internal Worker]

    SDK -->|public gRPC + HTTP| FE
    FE -->|client.HistoryClient| H
    FE -->|client.MatchingClient| M
    FE -->|client.AdminClient| H
    H -->|client.MatchingClient| M
    M -->|client.HistoryClient| H
    W -->|internal SDK<br/>via FE| FE

Inter-service calls go through the typed clients in client/. The clients are wrapped with retry, metrics, rate-limit, and (in tests) fault-injection by code generated from cmd/tools/genrpcwrappers/.

Service lifecycle

Each service is wired by an fx module:

Top-level wiring lives in temporal/fx.go, which composes per-service modules with shared providers from common/. Lifecycle is managed via fx.Lifecycle; services start and stop in dependency order.

The Architecture overview shows a single workflow's lifecycle threading through all four.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Services – Temporal wiki | Factory