Open-Source Wikis

/

Temporal

/

By the numbers

temporalio/temporal

By the numbers

A quantitative snapshot of the codebase. Data collected on 2026-04-30 from main at commit 458f2238b.

Size

xychart-beta horizontal
    title "Lines of code by language (millions of lines)"
    x-axis ["Go", "proto", "yaml", "md", "sql"]
    y-axis "Thousands of lines" 0 --> 900
    bar [891, 9, 4, 7, 4]
Language Files Lines (approx.)
Go (sources) 1,732 ~891k
Go (tests) 784 (subset of above)
Protobuf 73 9.2k
YAML (many) 3.6k
SQL schema (few) 3.6k
Markdown / docs (few) 6.9k

The biggest single Go file is generated: api/historyservice/v1/request_response.pb.go at ~507k bytes. The biggest hand-written file is service/history/workflow/mutable_state_impl.go at ~357k bytes — see Cleanup opportunities below.

Top-level layout

Directory Go files What it contains
common/ 1,126 Shared infrastructure: persistence, rpc, dynamicconfig, metrics
service/ 831 The four services
chasm/ 207 CHASM state-machine framework
tests/ 137 Functional / E2E test cases
api/ 118 Generated Go for internal proto services
tools/ 100 Operator CLI, codegen tools, schema utilities
client/ 44 Inter-service gRPC clients
components/ 31 Concrete CHASM components (callbacks, nexusoperations)
cmd/ 25 Server + tools main packages
temporal/ 12 Top-level fx wiring
temporaltest/ 5 Embeddable in-memory test cluster

Within service/:

Service Go files
history/ 592
worker/ 107
matching/ 93
frontend/ 38

Activity

xychart-beta horizontal
    title "Commits per calendar year"
    x-axis ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026 YTD"]
    y-axis "Commits" 0 --> 1500
    bar [34, 343, 501, 954, 954, 838, 995, 1019, 1306, 1290, 727]
  • 8,961 commits since the repository's "new beginning" commit on 2016-10-24.
  • 326 unique committer email addresses across the project's lifetime.
  • 541 commits in the last 90 days (well over five per workday).

Recent churn hotspots (last 90 days)

Directory Commits
service/history 640
chasm/lib 571
service/matching 213
common/persistence 164
service/frontend 159
service/worker 146
proto/internal 119
common/rpc 77
common/dynamicconfig 67
tests/testcore 65
.github/workflows 63
common/metrics 45
components/nexusoperations 42
common/namespace 42

CHASM (chasm/lib) and the History service dominate recent activity — consistent with the multi-quarter effort to migrate workflow execution to the CHASM framework.

Bot-attributed commits

A scan of trailers in the project's git history did not find any structured bot co-authorship (Co-authored-by: …[bot]). The CI tooling under .github/workflows/ auto-formats code via make fmt-imports and runs make lint-code, but those changes are pushed by the developer in their own commit. This is a lower bound on AI-assisted work — IDE-resident assistants (Copilot, Cursor) leave no trace in the history.

Complexity

The single largest hand-maintained source files in the repository:

File Bytes Notes
service/history/workflow/mutable_state_impl.go 357k The MutableState implementation
service/history/history_engine_test.go 296k The largest unit test suite
tests/versioning_3_test.go 292k Worker versioning v3 functional tests
service/history/workflow/mutable_state_impl_test.go 291k MutableState tests
service/frontend/workflow_handler.go 260k Frontend gRPC handler
tests/standalone_activity_test.go 246k Standalone activity tests
tests/worker_deployment_test.go 172k Worker-deployment tests
service/matching/matching_engine.go 149k The Matching engine core

mutable_state_impl.go and workflow_handler.go in particular show up regularly in PRs and would benefit from the same kind of decomposition that CHASM has already brought to other parts of the engine.

Tests

  • 784 *_test.go files in the repo.
  • Three test layers (make unit-test, make integration-test, make functional-test) with separate Make targets — see Getting started → Testing.
  • The tests/ directory holds 137 functional test files (~3.5MB of Go) that drive an in-process cluster.
  • Many integration tests run a separate fault-injection persistence wrapper from common/persistence/faultinjection/.

External dependencies

The server pulls in roughly 40 direct Go dependencies (see go.mod). The most important runtime dependencies are:

  • go.temporal.io/api — public proto definitions.
  • go.temporal.io/sdk — Go SDK, used internally by the Worker service.
  • github.com/temporalio/ringpop-go — gossip ring for membership.
  • github.com/gocql/gocql — Cassandra driver.
  • github.com/jackc/pgx/v5, github.com/go-sql-driver/mysql, modernc.org/sqlite — SQL drivers.
  • github.com/olivere/elastic/v7 — Elasticsearch client.
  • go.uber.org/fx — dependency-injection framework that wires every service.
  • go.uber.org/zap — structured logging.
  • go.opentelemetry.io/otel — distributed tracing.

Further suggestions

  • Several files crossing 200kB hand-written code are obvious refactor candidates (see the table above).
  • The number of indirect dependencies is large, partly because of cloud.google.com/go/storage for the GCS archiver. Operators that don't use the GCS archiver can skip its initialisation by configuration but the binary size is paid regardless.

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

By the numbers – Temporal wiki | Factory