Embedding the Temporal server for tests

Running Temporal in-process with SQLite gives Go teams fast, disposable integration tests and local tooling. It is a development and testing tool, not a production deployment, and the boundary needs to be drawn before the test suite depends on it.

On this page

Why teams embed the Temporal server for tests

A Go team that wants workflow integration tests to run in CI without a standing Temporal cluster needs an embedded server. The fit is an in-process server based on the Temporal CLI dev server, backed by SQLite, which starts with the test, runs workflows and workers against a real Temporal API, and shuts down when the test ends. The same setup suits local tooling, such as a developer running a workflow end to end on a laptop. Teams usually need it when their tests otherwise depend on a shared environment that other people change, or when they want each CI job to start from an empty, known state.

The Temporal persistence docs state that SQLite is meant only for development and testing, and this is the main constraint to design around. The embedded server is a test harness, not a smaller production deployment. It has no replication, no high availability and no operational tooling, and it does not stand in for the database, visibility store or service topology you will run in production. Confirm the current embedded server support and any Go package requirements with the Temporal SDK documentation for your language and version, because the supported entry points change between releases. Do not copy the embedded setup into a production Helm chart, Docker Compose file or binary deployment.

Before you adopt it, decide which behaviors the tests must prove. Workflow determinism, retry policies, timers and signal handling depend on the SDK and the workflow code more than on the database, so an embedded server is usually enough for those checks. Behaviors tied to persistence limits, visibility queries or multi-node failover need a test against the stores and topology you actually run, which means a separate environment. Plan that split early so your CI pipeline does not treat a passing SQLite test as evidence about production.

Where the embedded server sits in a test run

The test binary starts first and launches an embedded Temporal server backed by SQLite inside the same process. A test worker then registers workflows and activities on a task queue, and the test client starts workflows and asserts on their results against that local server. Teardown stops the server and removes the local state. The production Temporal Service sits in a separate environment with no connection to the test process, so test runs never touch production namespaces, data or credentials.

Test process with an embedded server, isolated from any production Temporal Service.

Which test setup fits which need

This table compares four ways to run Temporal under tests: the embedded SQLite server, the CLI dev server as a separate process, a Docker Compose stack, and a shared self-hosted or Temporal Cloud test namespace. Read each row to see how a setup trades startup cost, isolation and production fidelity against each other. The main takeaway is that fast in-process tests suit unit and workflow logic checks, while persistence and visibility behavior needs a stack closer to production.

CriterionEmbedded SQLite serverCLI dev server (separate process)Docker Compose stackShared self-hosted or Cloud namespace
Startup costStarts inside the test process with no external service to install or manageStarted as a separate local process before the test run, which adds a setup step to the test harnessRequires container images and a running stack, so startup is slower and the stack must be kept healthyNo server to start, but tests depend on network access, credentials and a namespace that someone else administers
IsolationEach test can get its own server instance, so state does not leak between testsTests can share one dev server, so workflows from one test can affect another unless namespaces or IDs are separatedStack can be reset between runs, but parallel suites often share one stack and need careful cleanupWeakest isolation: many engineers and pipelines write to the same namespace, so tests need unique workflow IDs and cleanup
Visibility supportLimited to what the embedded server provides, so visibility queries may not match a production storeIncludes the dev server's visibility behavior, which may differ from Elasticsearch or OpenSearch in productionCan run the visibility store you choose, so queries can be checked against a chosen backendMatches the visibility store the environment runs, which is the closest to production
Persistence fidelityUses SQLite, which the Temporal persistence docs say is meant only for development and testingUses the dev server's local storage, which is also not a production persistence storeCan use PostgreSQL or MySQL, the production-tested persistence options, so schema and query behavior are closer to productionUses the persistence the environment was built on, which is closest to production if it matches the production stores
Fits unit and workflow logic checksYes, for fast checks of workflow and activity logic in GoYes, for manual exploration and local toolingPossible, but usually more than a unit check needsNot suited to fast unit checks
Fits integration tests of retries, timeouts and signalsPartly, if the test does not depend on production persistence or visibility behaviorPartly, for exercising the server through the CLI or SDKsYes, when the test must reflect the persistence and visibility stores used in productionYes for end-to-end checks, provided tests are isolated and cleaned up
Fits production-like verificationNo, because the embedded server is not for productionNo, for the same reason as the embedded serverPartly, depending on how closely the stack mirrors production settingsYes, if the namespace runs on the same service configuration and access controls as production
Main riskBehavior that passes here may differ on the real persistence and visibility storesShared state between tests and differences from production storesStack drift from production versions and configuration over timeFlaky tests, shared-state failures, and test traffic that reaches production-adjacent systems
Ask your team or vendorConfirm the embedded server package version matches the Temporal Server version you run in productionConfirm the dev server version and which settings differ from your production configurationConfirm which persistence and visibility versions the stack uses and who keeps them in step with productionConfirm the test namespace's retention, access controls and cleanup policy, and what Temporal Cloud pricing applies if it is hosted there

Setting up an embedded Temporal server in a Go test suite

This sequence gives a Go test suite its own short-lived Temporal server, a worker on a test task queue and a client, so each test runs real workflows and asserts on their results. The result is a repeatable setup and teardown that stays inside the test process.

  1. Add the server package to the Go module

    A developer adds the Temporal server package and the matching SDK client packages to the module that holds the workflow code, then pins the versions in go.mod. Pin the server package to the release line you run in production, and confirm the exact import path and API names against the current Temporal release notes before you write any test code. The step is done when go build and go test compile the test package with the new dependencies and the module file records the pinned versions.

  2. Start the embedded server with SQLite

    In the suite's setup function, the developer starts an in-process Temporal server configured to use SQLite for persistence, with the frontend listening on a local address chosen for the test run. SQLite is intended only for development and testing, so this server must never be pointed at production data or reused outside the test harness. The step is done when the server reports that it has started and the frontend address is known to the test code.

  3. Confirm the frontend answers and the namespace exists

    Before any workflow is started, the setup code calls the frontend to confirm it responds, then checks that the namespace the tests use is available. If the suite relies on the default namespace, the check confirms that it is present; otherwise the developer registers the test namespace through the API and verifies it. The step is done when a describe-namespace call returns the expected namespace, and the setup fails fast with a clear message if it does not.

  4. Register workflows and activities on a test worker

    The developer creates a worker connected to the embedded frontend address and the namespace, listens on a dedicated test task queue, and registers the same workflow and activity functions that production uses. Activities that call external systems should be replaced with test doubles at this point, while the workflow code stays unchanged. The step is done when the worker starts polling without errors and the logs show it is listening on the test task queue.

  5. Run workflows through a client on the embedded address

    A client is created against the embedded frontend address and the test namespace, and the test starts a workflow on the test task queue with the input it needs. Each test should use a unique workflow ID so runs do not collide when tests execute in parallel or are retried. The step is done when the start call returns a run ID and the workflow is visible through the client.

  6. Wait for completion before asserting

    The test waits for the workflow result with a bounded timeout and only then checks the output, the activity results and any side effects recorded by test doubles. Assertions made before completion can pass or fail by accident, so the wait is part of the test, not an optional step. The step is done when the workflow returns a result or the test fails with the workflow status and history reference in the error message.

  7. Shut down the worker and server in teardown

    The teardown stops the worker, closes the client connections and then stops the embedded server so the SQLite files and listening ports are released. Stopping in this order prevents the worker from polling a server that has already gone away. The step is done when the test process exits without leaked goroutines or open ports, and a second test run on the same machine starts cleanly.

  8. Confirm the setup matches your production versions

    Before relying on the suite, the team checks the pinned server package version against the production Temporal Server release, reviews the current release notes for any change to the embedded API, and confirms that the workflow code runs the same way under the embedded server. Because SQLite and the development server are not production configurations, persistence, visibility and authorization behavior can differ, so these tests verify workflow logic rather than production operations. The step is done when the team has written down the pinned versions and the differences it accepts.

Keeping the test server aligned with the server version you run

Keep the test server on the same Temporal Server minor line that runs in production. A workflow that passes against a different minor version can behave differently once it reaches a real cluster, so the version you embed in tests should be the one your platform team has chosen for production, not whatever the Go module resolver pulls in next. Record the exact server version in your dependency files and treat it as part of the service's release contract. At the time this page was written, the current references in the release notes were Temporal Server v1.32.1 and the patch releases v1.31.4 and v1.30.8, so confirm which minor line your production cluster runs before you pin anything.

Upgrade one minor version at a time. Temporal documents backward compatibility only between two successive minor versions, and it recommends moving to the latest patch of the current minor first. Apply the same rule to the embedded test server and to the SDK and library versions that travel with it. Schema upgrades must run before server upgrades when the release notes call for them, so check whether the test fixture needs any schema step before it is bumped. Each bump should be a deliberate change, reviewed in its own pull request, with the team reading the release notes for that version and running the full integration suite before merging.

Assign one owner for test dependency changes and make the review step explicit. Ask the owner to confirm three things before each bump: the production version, the target version in the release notes, and any breaking or deprecated behavior that affects your workflows and activities. If production has not moved yet, expect the test server to be ahead or behind for a short period and document that gap so no one mistakes a passing test for proof of production behavior. Revisit the pin whenever production upgrades, so the two versions do not drift apart silently.

Where the embedded approach stops working

The embedded server is a fast way to exercise workflow code, but it runs a different storage, visibility and security setup from production. Each card below marks a gap that tests cannot close, along with the check to run before trusting a result from this setup.

Persistence behavior differs from production

The embedded server stores state in SQLite, which the Temporal persistence documentation describes as meant only for development and testing. Concurrency, locking and failover behave differently from PostgreSQL, MySQL or Cassandra, so a test that passes here does not show how history writes behave under contention. Confirm which production database you will run and test the failure paths your workflows depend on against it.

Persistence docs

Visibility results may not match

Search attributes and List Workflow queries depend on the visibility store. The embedded setup does not use the Elasticsearch or OpenSearch backend that the visibility documentation recommends beyond a few workflow executions, so result ordering, indexing delay and query support can differ. Confirm the visibility store your production service uses and keep any test that depends on search results against that store.

Visibility docs

Security settings are not exercised

The test server does not run your production TLS, mTLS, ClaimMapper or Authorizer configuration. Self-hosted Temporal allows every API request when no Authorizer is configured, so a test client that connects without credentials proves little about access control. Check that namespace roles, certificate rotation and OIDC sign-in are tested on a server configured like production.

Security docs

Topology and shard count are not representative

The embedded server runs all services in one process with a fixed history shard setup, so it does not reflect the numHistoryShards value, service counts or network hops of a production deployment. Shard ownership, cross-service latency and rebalancing during restarts cannot be observed. Record the production shard count and service layout in your test plan, and list which behaviors need a multi-node environment to verify.

Timing hides load problems

Tests on a single developer machine run with little contention, so timeouts, retry intervals and task queue latency often look fine. Load-related issues such as task backlog, worker cache pressure and schedule drift appear only at production volume. Use the embedded server for logic checks, and plan separate load tests against a production-like Temporal Service before setting timeout values.

Feature support must be confirmed

Not every Temporal feature behaves the same in the embedded server as in a self-hosted service or Temporal Cloud. Before relying on a feature in tests, such as a specific search attribute type, a version-specific API or an update flow, confirm in the release notes and SDK documentation for your server version that the embedded server supports it. Record each confirmed feature in a short matrix kept with the test suite.

Temporal releases

Questions teams ask before embedding Temporal in tests

Can an embedded Temporal server replace a shared test cluster?

Only partly. An in-process server with SQLite is useful for fast integration tests of workflow and activity logic, but it is meant for development and testing, not for production-like behavior. Persistence on SQLite is not one of the stores Temporal tests for production. Keep the embedded server for unit-level and integration checks that do not depend on scale, multi-service topology, authentication, or the visibility behavior your operators rely on. Keep a shared environment for tests that depend on the production persistence store, Elasticsearch or OpenSearch visibility, TLS, authorization, or load. List the features your tests must cover first, then decide which environment owns each test.

How much effort does an embedded Temporal test setup take?

The effort depends on four drivers: the SDK and server version you pin, the design of your test harness, the number of workflows under test, and how many of them use long timers. Pinning versions and making the harness start, reset and stop the server cleanly is the largest one-time task. Long timers and many workflows increase test runtime, so you may need time skipping or shorter test durations to keep CI fast. Ask any partner for a written breakdown of these four drivers against your codebase, and ask whether the quote covers the harness, CI wiring and documentation, or only a proof of concept.

Can our own team set up embedded Temporal for tests?

Yes, if your team has Go test expertise and time to pin and maintain versions. The work is mostly ordinary Go test engineering: starting the in-process server, creating namespaces and task queues per test, registering workers, and tearing everything down reliably. The risks are version drift between the server package and your SDK, flaky tests caused by shared state, and CI runners that run tests in parallel against one local port. Your team should also decide who updates the pinned versions when Temporal releases new minor or patch versions, and check the upgrade documentation before each bump.

What do we need to provide for an embedded test engagement?

You need read access to the repository that holds the workflow and activity code, access to the CI configuration so the test job can run, and a written list of the features the tests must cover. The feature list is the most important input because it decides which tests can run embedded and which need a shared environment. Also provide the Go and SDK versions in use, the test run time budget in CI, and any constraints on network access or container images in your build runners. In return, expect a set of test harness code, a list of what the embedded setup does not cover, and a short handover on how to run and update it.

How does an embedded server differ from Temporal Cloud test namespaces?

The embedded server runs inside your test process on your machine or CI runner, and you do not pay Temporal for it. Temporal Cloud is a managed service that Temporal Technologies sells, so a test namespace there is a billed resource with its own terms. The Temporal pricing page lists pay-as-you-go rates starting at 50 US dollars per million actions, with active storage at 0.042 dollars per GB-hour and retained storage at 0.00105 dollars per GB-hour. Actual test costs depend on how many actions your suite produces and how long data is retained, so estimate your action volume from a test run before comparing. Cloud namespaces test against the managed service's behavior, which is closer to production for some teams but adds a network dependency and recurring cost.

When should we move tests to a Docker Compose or Kubernetes staging environment?

Move tests to a staging environment when they need behavior the embedded server does not provide: production persistence such as PostgreSQL or MySQL, Elasticsearch or OpenSearch visibility, mTLS and authorization settings, multiple Temporal services, or load and failover checks. Docker Compose suits small teams that need a realistic single-host stack, while Kubernetes suits teams already running the Helm chart in production-like clusters. Helm chart versions below 0.73.1 do not work with server images 1.30 and later, so pin chart and image versions together. Ask a partner to show which of your tests move, what the staging environment costs to run, and who patches it.

Is the embedded server safe to use in production?

No. Temporal's guidance is that SQLite is meant only for development and testing, and the CLI dev server and in-process embedded server are for local tooling and tests. They do not provide the persistence, visibility, authorization, or high-availability features that a production deployment needs. Self-hosted Temporal with no configured Authorizer uses the default noopAuthorizer, which allows every API request without authentication, so production must have authorization, TLS and network restrictions in place. Use the self-hosted deployment guides and production checks for live systems, and keep the embedded server out of any deployed service image.

What to confirm before relying on an embedded test server

Before a team relies on an embedded Temporal server for tests, it should confirm the versions it pins: the Temporal server package, the Temporal SDK, the SQLite driver and the Go toolchain. Each pin should be recorded in the repository and matched to the production Temporal Server version it is meant to stand in for. Check the current Temporal GitHub releases and release notes for each pinned version, because a test server that is a minor version behind production can pass tests that production would fail. The same check applies to the import path used to embed the server. Confirm in the current Temporal documentation that the package path and constructor the team uses still exist, rather than copying an example from an older blog post or a previous project.

Next, list the visibility features the tests actually exercise. Search attributes, list workflow queries and schedules can behave differently depending on the visibility store, and the embedded server's SQLite-backed visibility is not the store a production cluster will use. The Temporal visibility documentation describes which stores are supported for advanced visibility and which are meant only for development and testing. If a test asserts on query results, ordering or pagination, write that assertion down and check it against a production-equivalent environment before trusting it. Tests that depend on persistence behavior should be identified in the same way. Any test that relies on SQLite-specific semantics, such as locking, transaction timing or limits, should be marked as a test of the embedded setup, not of production behavior.

Finally, decide which results from the embedded server will be trusted as evidence and which will be rechecked in a shared, production-like environment. The Temporal persistence documentation states that SQLite is meant only for development and testing, so the team should not assume that a passing test on SQLite proves the same workflow will run correctly on PostgreSQL, MySQL or Cassandra. Ask the owners of the workflow code to name the behaviors that must be verified against the production stack, and schedule those checks before each upgrade. Recheck these assumptions whenever Temporal Server or the SDK changes, and treat the vendor's current docs and release notes as the authority, not the behavior observed in a previous test run.

How DeployOpen scopes Temporal test infrastructure

DeployOpen plans the test harness around your workflow code, your CI pipeline and the Temporal features your tests must exercise. We agree the scope in writing before work starts, so the boundary between in-process test servers and the real self-hosted service is explicit from the first day.

How we scope

  • We list which workflows, activities and Temporal features the embedded test server must exercise, and which need a real self-hosted service.
  • We confirm the Go version, SDK version and CI runners, then agree the Temporal server version the tests will track.
  • We record which behaviors are excluded from embedded tests, such as visibility queries, multi-cluster paths and production persistence.

How we build

  • We write a test helper that starts the dev server in-process with SQLite, sets namespaces and task queues, and tears down cleanly per test.
  • We separate fast in-process tests from slower integration runs against a self-hosted environment that uses production-like persistence.
  • We wire the suite into your CI pipeline with pinned versions, so test results stay reproducible when the server library is upgraded.

How we hand over

  • We deliver the test helpers, the scope document and a README that explains which tests run embedded and which need external services.
  • We walk your engineers through adding a new workflow test and through the upgrade steps for the embedded server version.
  • We document the known differences between the embedded dev server and production Temporal Server so teams know what a green run does not prove.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, covering the embedded server version and the test helpers.
  • Retainer work can include reviewing test coverage as workflow code changes and as new Temporal releases are adopted.
  • Each engagement is fixed-scope, so any extension to the test harness is agreed in writing before it starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.