Temporal

Plan and implement Temporal durable execution: workflow design, determinism, worker versioning, a self-hosted or Temporal Cloud service, security and rollout.

On this page

What a Temporal workflow implementation involves

A Temporal workflow implementation turns multi-step business processes into durable code and runs it on workers you operate, backed by a Temporal Service you host or rent. Temporal is a durable execution platform whose server runs Workflows in a resilient way, handling intermittent failures and retrying failed operations.

Developers write workflows as ordinary code with an SDK, and the Temporal Service records each step in an Event History. If a worker crashes or a downstream system is down for an hour, the workflow resumes where it stopped, with timers, retries and waiting state preserved. It suits payment and order flows, onboarding, provisioning and other processes that span several systems.

Workflow code orchestrates. Activities do the work that touches the outside world, such as API calls and database writes. Workers, which you run, poll task queues and execute both. You can self-host the MIT-licensed Temporal Server, which originated as a fork of Uber's Cadence and is developed by Temporal Technologies. You can also use Temporal Cloud, where Temporal runs the service. Workers stay in your environment either way.

Release cadence belongs in the plan. The GitHub release list shows v1.32.2 published 2026-11-02, with v1.31.5 and v1.30.9 the same day, so several minor lines receive patches at once. The implementation work is mapping processes into workflow designs, writing replay-safe code, handling failure and compensation, versioning code while executions run, and operating workers and, when self-hosted, the service. To try Temporal locally, install the CLI with brew install temporal and run temporal server start-dev. The Web UI then serves on local port 8233.

Map the process before writing code

Discovery for a Temporal workflow design focuses on side effects, waiting, failure and history size.

External calls

Every call to another system becomes an Activity with its own timeouts and retry policy. Discovery lists each call, the system behind it and the errors it can return. The team then agrees which errors are retryable and which fail the step. Long calls get heartbeats as part of the same design, so each integration has its failure behavior written down.

Waiting on people and events

Approvals, callbacks and customer actions arrive as Signals or Updates. Deadlines become durable timers that survive restarts. Discovery records every point where a process waits, what ends the wait, and what should happen when nothing arrives. Each answer becomes a Signal handler, an Update or a timer in the design, with a defined outcome on expiry.

Side effects that must not repeat

An Activity can run more than once after a timeout or crash. Payments, emails and ledger postings therefore need idempotency keys that the downstream system honors. Discovery checks each target API for that support. Where an API has no such support, the gap is raised during design, before any workflow code depends on it.

Compensation

When a later step fails after earlier ones succeeded, the workflow runs undo steps such as refunds and cancellations. This saga compensation is defined per step during design. Each forward step gets a matching undo step, and undo steps are Activities too, with their own retry policy. Cancellation paths are designed alongside them.

Long-running entities

Per Workflow Execution, event history warns at 10,240 events or 10 MB and errors at 51,200 events or 50 MB, which terminates the execution (Temporal defaults). Workflows that run for months or loop indefinitely use Continue-As-New to start a fresh history. Payloads warn at 512 KB and error at 2 MB, so design keeps large data out of them.

Temporal workflow determinism and worker versioning

Temporal recovers a workflow by replaying its Event History through the workflow code. The code must issue the same commands in the same order on every replay, so it cannot read the system clock, generate random values or call the network directly. It uses the SDK's replay-safe APIs, and all I/O goes into Activities. A mismatch raises a non-determinism error and that execution stops progressing until the code is fixed.

Changing workflow code while executions are running needs a versioning plan. In Worker Versioning, a Worker Deployment groups similar Workers and the Build ID identifies a specific release of Worker code. A Pinned Workflow is guaranteed to complete on a single Worker Deployment Version. An Auto-Upgrade Workflow moves to the latest version automatically and must be kept replay-safe manually, for example with patching.

Worker Versioning needs minimum SDK versions: Go v1.35.0, Python v1.11, Java v1.29, TypeScript v1.12, .NET v1.7.0 and Ruby v0.5.0. Self-hosted use also needs Temporal Server v1.29.1, CLI v1.4.1 and UI v2.38.0. Check those against the SDKs and server in use before choosing a rollout model, then choose pinned or auto-upgrade per workflow type.

Replay tests catch these mistakes before deployment. We replay recorded histories against new code in CI and fail the build on any non-determinism error. Build IDs are wired into CI/CD, so each release of worker code is identified the same way in testing and in production.

What the build covers

Temporal work is mostly software engineering, done with your developers in their repositories and languages. The build covers workflow code, the Activities that reach your systems, tests and the workers that run them.

Workflow code

  • Workflow definitions with Signals, Queries and Updates.
  • Saga compensation and cancellation handling.
  • Continue-As-New for long-running entities.

Activities and integrations

  • Activities for core systems, payment providers and messaging.
  • Timeouts, retry policies and heartbeats for each call.
  • Idempotency keys passed to downstream APIs.

Testing

  • Unit tests with the SDK test environment.
  • Replay tests against recorded histories in CI.
  • Failure and load tests before rollout.

Workers

  • Container images per task queue with resource limits.
  • Concurrency and poller settings tuned under load.
  • Build IDs wired into CI/CD for Worker Versioning.

Migrate from Cadence to Temporal and from other orchestration

Home-grown orchestration often spreads one process across message consumers, scheduled jobs and a status column. Model it as one workflow, move each consumer's work into Activities, and send new requests to the workflow while existing ones finish on the old path. Start by listing every place the process keeps state, such as queue messages, cron timestamps and status values. Each of those maps to a step, a timer or a Signal in the workflow. The old consumers and jobs are retired once the last in-flight item completes.

Design a Temporal self-hosted service: Helm chart, Docker Compose and stores

Temporal Server runs four services on a persistence store and a visibility store, per the Temporal Server docs. Running each separately lets them scale independently. Hosts should be secured like a database and kept off the public internet, as the deployment guide advises.

ComponentRoleDesign notes
FrontendA stateless gateway for rate limiting, routing and authorizing that exposes a strongly typed Proto API. The default gRPC port is 7233.Place it behind a load balancer. Client mTLS and authorization apply here, and the port supports TCP or gRPC health checks.
HistoryMaintains mutable state, queues and timers. Each History Shard maps to a single persistence partition, so the shard count bounds concurrent database operations.The shard count cannot be changed once it is configured and the database is integrated, so size it during design. Temporal recommends starting with 1 History Service process per 500 shards.
MatchingHosts Task Queues and dispatches tasks to workers. The default gRPC port is 7235.It scales horizontally with task queues and polling load.
Worker serviceRuns internal background Workflows such as replication and system Workflows.Run more than one instance for availability. Upgrades call for at least two instances of each service.
PersistenceA Temporal Service requires a database such as Apache Cassandra, MySQL or PostgreSQL.Use a highly available database and keep credentials in secrets, since it holds all workflow state.
VisibilityLists and searches executions. Supported advanced Visibility stores are Elasticsearch v7 and v8, OpenSearch 2+ (server v1.30.1+), MySQL v8.0.17+, PostgreSQL v12+ and SQLite v3.31.0+.Cassandra is not supported for advanced Visibility. Use Elasticsearch or OpenSearch for high-volume workloads, per the Visibility docs. A small deployment can keep Persistence and Visibility in one PostgreSQL or MySQL server using separate databases.
Helm chart on KubernetesThe Helm chart deploys admintools, frontend, history, matching, worker and web pods plus an optional internal-frontend.It includes no database subcharts, so you supply the database and visibility store. Chart versions below 0.73.1 are not compatible with 1.30 and later images, which need chart 0.73.1 or later with server.configMapsToMount set to sprig and server.setConfigFilePath set to true. Use existingSecret and secretKey for database credentials, enable TLS through server.tls, and note that helm uninstall may remove all Temporal data depending on persistence.
Docker ComposeThe setup in the samples-server repository defaults to PostgreSQL and Elasticsearch and runs all four services in one process.It is not a high-availability setup. With the temporalio/server image you manage schema updates yourself using temporalio/admin-tools, and the archived docker-compose repository says to use temporalio/server rather than temporalio/auto-setup in production.

Secure the service: Temporal authorizer, claim mapper, JWT and mTLS

A self-hosted Temporal Server allows every API request until authorization is configured. If no Authorizer is set, Temporal uses noopAuthorizer, which allows every API request with no authentication or access control. Production needs a ClaimMapper and an Authorizer. The Authorizer has a single Authorize method invoked for each incoming API call, and the ClaimMapper extracts Claims from JSON Web Tokens or the subject of an mTLS certificate.

The default JWT ClaimMapper needs a public key to validate signatures. Permissions take the form <namespace>:<permission>, where the permission is read, write, worker or admin. That lets tokens from your identity provider grant different rights per namespace, and namespaces separate teams and environments, with retention set per namespace.

Enable mTLS for clients and workers on the frontend and for internode traffic. The TLS configuration has separate internode and frontend sections, so internal and external traffic can use different certificates. Accept client certificates only from your internal CA. Turn on SSO for the Web UI by setting TEMPORAL_AUTH_ENABLED=true with the client ID, client secret, provider URL and callback URL variables.

Event Histories store workflow inputs and Activity results. For personal or financial data, add a custom Payload Codec in the SDK Data Converter so the worker encodes payloads. The docs warn to consider all security implications of remote data encoding before using a Codec Server, so treat any Codec Server that decrypts data for the UI as a privileged system.

Temporal upgrade, backup and monitoring practice

How do we upgrade the Temporal server version?

Move one minor version at a time. Go to the latest patch of the current minor, then the latest patch of the next minor, and read the release notes for every version on the path, as the upgrade guide says. Run at least two instances of each service during upgrades and roll out one service at a time. Skipped versions are not part of the runbook we write.

How are schema updates handled during an upgrade?

Update the persistence and Visibility schemas before rolling out the new binary on every upgrade step. Use temporal-cassandra-tool, temporal-elasticsearch-tool or temporal-sql-tool from the target version. With the temporalio/server image you run these updates yourself, using temporalio/admin-tools. The runbook lists the exact commands for each step and who runs them, so the schema step is treated as part of the release.

How do we roll back a bad server upgrade?

Roll back the binary only, one minor version at a time. Leave the schema at its upgraded version, because the schema tools only move forward. That makes the pre-upgrade backup of the persistence database the real safety net for a bad upgrade. It is also why the restore procedure is rehearsed before any production upgrade rather than after a failure.

How do upgrades work with multi-cluster replication?

Upgrade the passive service first, wait for replication lag to return to normal, then upgrade the active service. The Worker Service runs replication as one of its internal background Workflows, so its instances belong in the upgrade plan. Watch lag between each step and hold the next step until it settles, so the two clusters never differ by more than the plan allows.

What do we back up?

The persistence database holds all workflow state, so its backups and point-in-time recovery are the recovery plan. Back up the visibility store too, keep server and namespace configuration in version control, and rehearse a restore. Restore runbooks are part of handover, with named owners for the service, so the person on call knows which steps to run and in what order.

What do we monitor?

Prometheus must be enabled in both the SDK application code and the Temporal Service configuration, and the Frontend on port 7233 supports TCP or gRPC health checks (monitoring docs). Dashboards track schedule-to-start latency, workflow task failures, persistence latency and worker resource use. Those signals show whether workers keep up, whether code is failing and whether the database is the bottleneck.

Temporal cloud vs self hosted and other implementation questions

Should we self-host Temporal or use Temporal Cloud?

In Temporal Cloud, Temporal runs the Temporal Service while your Workers run in your own environment. It is available on AWS, GCP and Azure, with AWS and GCP generally available and Azure in Public Preview in Central US and Australia East. Self-hosting gives full control of data location and network paths, and your team runs the databases, services, upgrades and on-call. Workflow code is the same for both.

Can we use the Temporal Helm chart on Kubernetes in production?

The chart installs the server components and expects you to provide the databases, because it has no database subcharts. Persistence, visibility, certificates and authorization sit outside the chart and need their own design. Chart version also matters: 1.30 and later images need chart 0.73.1 or later with the sprig config settings. Check how persistence is configured before any helm uninstall.

Can we run Temporal with Docker Compose in production?

The Docker Compose setup in the samples-server repository runs all four services in one process, so it is not a high-availability setup. It suits development and evaluation. For production, the archived docker-compose repository says to use the temporalio/server image rather than temporalio/auto-setup. You then manage schema updates yourself with temporalio/admin-tools, so the production design needs its own database, visibility store and upgrade procedure.

When do we need Continue-As-New?

Use it when a workflow runs for months or loops indefinitely. Event history warns at 10,240 events or 10 MB and errors at 51,200 events or 50 MB, which terminates the execution. Continue-As-New closes the current run and starts a fresh history with carried-over state. Design decides the point at which a long-running entity rolls over, before the history approaches those limits.

How do we implement saga compensation in Temporal?

Define an undo step for each forward step during design, such as a refund for a charge or a cancellation for a booking. When a later step fails after earlier ones succeeded, the workflow runs the undo steps. Compensations are Activities with their own timeouts and retry policy, and they use idempotency keys like any other side effect. Cancellation handling is written and tested alongside the failure paths.

Does Temporal Cloud help with security and audit requirements?

Temporal Cloud authenticates Namespaces with mTLS certificates or API keys, uses TLS 1.2 or higher, and encrypts data at rest with AES-256-GCM. It lists SOC 2 Type 2, GDPR and HIPAA compliance, and supports audit log export. DeployOpen can assess the deployment against your requirements. We do not issue audit reports or certifications.

What does Temporal consulting from DeployOpen cover?

DeployOpen maps processes into workflow designs, builds workflows, Activities and tests with your developers, and deploys and hardens the Temporal service or connects workers to Temporal Cloud. It also sets up mTLS, authorization, SSO and payload encryption, and runs the rollout. Effort depends on the number of workflow types, the systems Activities call, how much existing orchestration is replaced, the hosting choice and availability targets.

Scope and handover for a Temporal implementation

Effort depends on the number of workflow types, the systems Activities call, how much existing orchestration is replaced, self-hosting or Temporal Cloud, availability targets and the languages in use. Those factors are settled in discovery, before workflow code is written.

DeployOpen maps processes into workflow designs and builds workflows, Activities and tests with your developers. We deploy and harden the Temporal service or connect workers to Temporal Cloud, set up mTLS, authorization, SSO and payload encryption, and run the rollout.

Handover includes code in your repositories, replay test suites, versioning guidelines, cluster configuration, upgrade and restore runbooks, dashboards and named owners for workflows, workers and the service. Your team keeps the code and the runbooks and knows who owns each part.

Sources and further reading

More on Temporal

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.