Multi-tenant applications on Temporal: when one namespace is enough
One namespace is enough when your tenants can share a workload boundary, when your tenant count stays modest, and when no single customer's traffic can crowd out the others. Many SaaS platforms start this way: every tenant's workflows run in one namespace, and each workflow carries a tenant identifier in its ID, search attributes and payload. A namespace in the Temporal docs is the unit that groups workflow executions, task queues, retention and access control, so it is the boundary you reach for when you need separation. Choosing how many namespaces to run is therefore a decision about isolation, not about where workflow code lives. The workflow code itself is covered in the Temporal SDK and workflow design pages.
Three factors drive the choice. The first is tenant count, because every namespace is an extra configuration object to create, monitor and upgrade. The second is noisy neighbors: one tenant that starts a large batch of executions can consume frontend request budget and worker slots that other tenants need, so you must plan rate limits and task queue fairness before that happens. The third is data separation, since retention, visibility records and payload access are set per namespace, and a contractual requirement that one customer's data be isolated may settle the question on its own. The three patterns (one namespace with fair task queues, a task queue per tenant, and a namespace per tenant) are not mutually exclusive. Many platforms combine them, for example giving large or regulated tenants their own namespace while smaller tenants share one.
Before you commit, confirm the namespace limits and per-namespace controls for the Temporal Server version and deployment model you plan to run, and check the current guidance in the Temporal self-hosted deployment docs. Ask your team to write down the expected tenant count in two years, the largest tenant's peak start rate, and which tenants have contractual data isolation requirements. Those three answers will show whether one namespace is a sound starting point or whether a split is needed from the outset.
Three patterns for multi-tenant Temporal applications
Serving many tenants from one Temporal Service comes down to where you draw the isolation boundary: a shared namespace, shared namespace with dedicated task queues, or a namespace per tenant. Each option trades noisy-neighbor risk against the number of resources you run and the work needed to operate them, and a tiered hybrid lets you mix these by customer class.
Shared namespace with fair task queues
All tenants share one namespace, one set of task queues and one workflow ID space, so tenant identity lives in workflow IDs, search attributes and payload data. This gives the smallest operational footprint and the cheapest baseline, but isolation is weakest: one tenant that floods a task queue delays every other tenant's tasks. Check how your workers are sized, whether you can throttle submission per tenant in your own API layer, and how you would find out which tenant is causing a backlog. Shared fate is the risk to plan for.
Self-hosted deployment docsPer-tenant task queues in one namespace
Each tenant gets its own task queue inside a shared namespace, so workers can be assigned, scaled and monitored per tenant while the Temporal Service stays shared. Tasks from one tenant no longer sit behind another tenant's backlog in the same queue. The cost is more task queues to manage, more worker deployments if you isolate them, and a need to keep queue names, worker identities and tenant mapping consistent across your code and monitoring. Confirm that your worker pool can scale per queue before you promise tenant-level latency.
A namespace per tenant
Each tenant gets a separate namespace with its own workflow ID space, retention, search attributes and task queues, which gives the strongest logical separation inside one cluster. Namespace-level controls such as rate limits and authorization roles can be set per tenant, which matters for regulated customers. The trade-off is operational: every namespace adds configuration, monitoring and upgrade checks, and onboarding a tenant becomes a provisioning task. Ask how many namespaces your chosen persistence and visibility stores can carry before you commit to this model.
Hybrid model by tenant tier
A hybrid places standard tenants in a shared namespace with per-tenant task queues and gives large or regulated tenants their own namespace or cluster. It keeps the footprint of the shared model for most customers while offering stronger isolation where contracts require it. The main work is a tier model that defines which controls each tier gets, a routing layer that sends each tenant to the right namespace, and migration paths for tenants who move between tiers. Write the tier rules down early, because moving a live tenant's workflows between namespaces is harder than choosing correctly at onboarding.
Configuration options and when each fits
This table compares one shared namespace with task queue fairness, a task queue per tenant, and a namespace per tenant across isolation, workflow ID and visibility scope, limit settings, operational overhead and cost drivers. Read each row as a question to answer for your own tenant count and risk profile. The main takeaway is that moving toward namespace-per-tenant buys isolation and per-tenant limits at the price of more namespaces to configure, monitor and pay for.
| Factor | Shared namespace with task queue fairness | Task queue per tenant | Namespace per tenant |
|---|---|---|---|
| Isolation boundary | Tenants share history, visibility and the namespace rate budget | Tenants share history and namespace limits, but worker pools can be separated | Tenants have separate workflow histories, visibility and namespace-level settings |
| Workflow ID and visibility scope | Workflow IDs must include tenant context to avoid collisions; list queries span all tenants unless filtered | Same ID scheme as shared namespace; queries still span all tenants in the namespace | IDs are unique per namespace, so tenant data is naturally scoped; queries stay within one tenant |
| Rate limit and namespace settings | One set of namespace limits; noisy tenants can starve others unless you enforce fairness in workers | Limits still apply at namespace level; per-queue fairness helps only where workers are the bottleneck | Per-namespace limits can be set for each tenant; confirm the exact namespace RPS and global limit keys in your version |
| Operational overhead | Lowest: one namespace to register, monitor and back up | Moderate: many task queues, worker deployments and queue-level dashboards | Highest: namespace lifecycle, retention, search attributes and alerts per tenant |
| Cost drivers | Shared server capacity; one set of visibility storage | Extra worker capacity per queue and more polling load on matching | More namespace metadata, per-namespace storage and monitoring; confirm how your provider meters namespaces |
| Access control | Enforced in your application; Temporal roles apply to the whole namespace | Worker identity can be scoped by queue in your design; API access is still namespace-wide | Authorizer and ClaimMapper can grant roles per namespace; confirm the claim mapping you need |
| Best fit | Many small tenants with similar load and a strong application-layer tenancy model | Tenants with distinct workload shapes or data-residency worker placement | Few large tenants, regulated data separation or tenants needing independent limits |
How isolation and limits differ between shared and separate namespaces
The core difference is where each tenant's load, data and settings land. In a shared namespace, all tenants' workflows run under one set of frontend rate limits, one retention period and one visibility store. Frontend rate limits are applied per host and per namespace, so a tenant that submits a burst of starts or signals can consume capacity that other tenants in the same namespace need, and the server cannot tell tenants apart unless your code makes it do so. Separate namespaces give each tenant its own per-namespace limits and its own retention setting, which lets you size and throttle tenants independently. Confirm the current limit defaults and how the global namespace limit interacts with per-namespace values in the rate limit page of this group before you commit to a layout.
Data separation follows the same split. Workflow histories in a shared namespace sit side by side, and any tenant identifier must be carried in workflow IDs, search attributes or payload contents. Visibility queries run against the namespace, so a list query that omits a tenant filter can return other tenants' executions, and search attributes such as a TenantId keyword must be set consistently by every workflow start path. In a separate namespace, a visibility query cannot cross the boundary, which removes a class of data exposure errors but means cross-tenant reporting needs its own export or aggregation step. Payload encryption is configured per data converter or codec, so a shared namespace can use per-tenant keys only if your codec selects the key from the payload context, while separate namespaces let you assign different codec endpoints and keys to each tenant.
Authorization also changes shape. The ClaimMapper maps JWT or certificate claims to namespace roles, and the Authorizer decides whether a request may act on a given namespace. Without a configured Authorizer, the default allows every API request, so either model needs one. With separate namespaces, you can grant a tenant's service identity a role on its own namespace only, while in a shared namespace the role is broader and tenant separation depends on your application checks. Ask your team to confirm the exact claim and role mapping in the self-hosted security page before you write it into a design, and test that one tenant's credentials cannot read another tenant's workflows.
Choosing a pattern by tenant count, data sensitivity and noise
When you serve a large number of small tenants with similar, modest load, a shared design usually fits best. Most teams start with one namespace and separate tenants by workflow ID prefixes, search attributes and a shared task queue, which keeps the number of Temporal objects low and avoids provisioning work for every new customer. The trade-off is that one busy tenant can consume worker slots and frontend capacity that others depend on, so fairness has to be enforced in your application or worker configuration.
- Operating cost: One namespace and shared workers are the cheapest to run, and onboarding a tenant is a data change rather than an infrastructure task.
- Noise control: Plan per-tenant rate limiting at your API layer and watch schedule-to-start latency per tenant in your own metrics.
- Isolation: Logical only. Access control is applied at the namespace level, so every tenant shares the same data boundary.
- Visibility: Search attributes that carry the tenant identifier must be designed up front, or listing one tenant's executions becomes costly.
- Growth: Confirm how the design changes if a tenant later needs its own namespace, since moving running workflows is not a simple switch.
Before committing, confirm with your security team whether logical separation meets your contractual and audit expectations for every tenant, and load test the shared design with your largest expected tenant mix.
A few large or regulated tenants change the calculation. Their data residency, retention, key management or audit requirements often need a boundary that a shared namespace cannot express. A namespace per tenant, or a separate self-hosted cluster for the most sensitive tenants, gives each one its own history, visibility data and access policy, at the cost of more infrastructure to run and monitor. Temporal's self-hosted security controls, including the ClaimMapper and Authorizer, can scope roles to namespaces, which is what makes this boundary enforceable.
- Operating cost: Each namespace adds configuration, monitoring and upgrade verification, and dedicated workers add compute that sits idle between peaks.
- Isolation: Strongest within one cluster. Namespace-scoped roles and separate payload codec keys can apply per tenant.
- Access control: Authorization must be configured before any tenant data is written. The default noopAuthorizer allows every API request, so it cannot be left in place.
- Operational blast radius: A dedicated cluster limits the impact of an incident to one tenant, but it doubles upgrade and patching work.
- Evidence: Retention, deletion and access logs must be demonstrable per tenant for your auditors.
Before committing, confirm with your compliance team which controls the regulation requires at the tenant boundary, and confirm with your platform team how many clusters your staff can upgrade and monitor.
Many SaaS products run mixed tiers: a free or standard tier with shared capacity, and premium or enterprise tiers that buy isolation or guaranteed throughput. A hybrid design fits this case. Standard tenants share a namespace and task queue, while premium tenants get dedicated task queues or namespaces with their own worker pools. The tier then becomes an infrastructure attribute, which makes the cost of isolation visible in your pricing.
- Tier routing: Decide at workflow start which task queue or namespace a tenant uses, and document how a tenant moves between tiers.
- Operating cost: Dedicated pools for premium tenants add idle capacity, so price that cost into the tier.
- Noise containment: Shared-tier tenants still need per-tenant limits so one standard customer cannot slow others in the same tier.
- Upgrade path: Moving a tenant up a tier may require a migration of running workflows, which should be tested before it is sold.
- Consistency: Keep worker code identical across pools so that a bug fix or workflow versioning change reaches every tier together.
Before committing, confirm with your product and finance teams which isolation guarantees each tier promises, and ask your Temporal provider or internal team how tier moves are handled for workflows that are already running.
How tenant requests reach namespaces and task queues
The diagram starts at the tenant-facing application, which authenticates each request and decides which namespace and task queue the work belongs to. Two paths are shown: a shared namespace where tenants are separated by task queue, and dedicated namespaces per tenant. Both paths hand off to the Temporal Service frontend, then to workers, and finally to the persistence and visibility stores. Check where the trust boundary sits, because the frontend and stores are shared control plane components even when tenant code runs on separate workers.
Tenant requests route to shared task queues or dedicated namespaces before reaching the shared Temporal Service.
Setting up a multi-tenant Temporal design step by step
This sequence turns a tenant list into a working Temporal design, from isolation requirements through namespaces, queues, authorization, limits and a load test. Each step ends with a check so the design can be verified before tenants depend on it.
Define tenant classes and isolation requirements
The product owner, security lead and platform engineers group tenants into classes based on data sensitivity, contractual isolation terms, expected throughput and retention needs. For each class, they write down whether workflows must be invisible to other tenants, whether a noisy tenant may slow others, and which regulators or customer contracts apply. The output is a short table of classes with isolation and limit requirements. The step is done when every existing and planned tenant is assigned to a class and each class has a named owner who signs off on its requirements.
Pick the tenancy pattern for each class
Using the requirements table, the architecture team chooses one pattern per class: a shared namespace with task queue fairness, a dedicated task queue per tenant, or a dedicated namespace per tenant. They record the reason for each choice, including what they accept in exchange, such as weaker isolation for shared namespaces or more namespaces to operate for dedicated ones. Cost of ownership, operational overhead and the number of namespaces the cluster must carry all feed into this decision. The step is done when a decision record exists for each class and the team has checked that the chosen patterns do not conflict with the isolation requirements from the previous step.
Create namespaces and set retention
Platform engineers create the namespaces the chosen patterns require and set a workflow execution retention period for each one, based on the data retention terms of the tenant class. They confirm the persistence and visibility stores can hold the expected executions for the retention period, and they name a namespace owner who is accountable for changes. Namespace creation and retention are managed through the Temporal CLI or API, and the chosen settings should be captured in infrastructure as code so they can be reviewed. The step is done when each namespace shows the intended retention in describe output and the retention values match the requirements table.
Design task queue naming and worker pools
Platform and application engineers define a task queue naming convention that encodes the tenant or tenant class, for example one queue per tenant in a dedicated namespace or a tenant-scoped queue in a shared one. They decide which worker pools serve which queues, how pollers are sized, and whether a class with heavy load gets its own pool so it does not compete with smaller tenants. Workers should be deployed in the client's own infrastructure with their own identity and scaling policy. The step is done when a written naming standard exists, each queue has an assigned worker pool, and a test workflow started for each class lands on the queue and pool the design specifies.
Set authorization with ClaimMapper and Authorizer
The security team configures a ClaimMapper that maps JWT or certificate claims from the identity provider to namespace roles, and an Authorizer plugin that enforces those roles on each API request. Without a configured Authorizer, self-hosted Temporal falls back to the default noopAuthorizer, which allows every request, so this step must be complete before any tenant traffic reaches the cluster. Tenant identities should map only to the namespaces or queues that tenant owns. The step is done when a test identity for one tenant can start and read its own workflows, and requests against another tenant's namespace are denied and logged.
Configure per-tenant limits and monitoring
Platform engineers set frontend rate limits and any per-namespace request limits that the chosen version of Temporal supports, then build dashboards and alerts that break down request rates, latency and task backlog by namespace and task queue. Limits should match the class requirements so that a high-volume tenant cannot starve the others, and the team should confirm the exact configuration keys and defaults for the server version in use. Alert thresholds must be agreed with each tenant class owner. The step is done when a deliberate burst from a test tenant triggers the expected limit behavior and the alert fires on the correct namespace label.
Run a load test with tenants of different sizes
The performance team runs a load test that simulates several tenants at the sizes defined in the classes, including at least one large tenant and one that bursts. They use the load testing approach their organization has chosen, record schedule-to-start latency, error rates and backlog per namespace, and check that smaller tenants keep their expected latency while the large tenant runs at peak. Results are compared with the isolation and limit requirements, and any gap leads back to an earlier step. The step is done when the test report shows each class meeting its latency and isolation targets, and the owners have signed off the design for production use.
Security controls that keep tenants apart
Namespaces and task queues only separate tenants if the cluster also controls who can call the API, which identities map to which namespace, and who can read the traffic and payloads. The cards below cover the controls Temporal documents for self-hosted deployments and what to verify before any tenant data enters the cluster.
Configure an Authorizer before any tenant
If no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. In a multi-tenant design, that means any client that can reach the frontend can start, signal or read workflows in any namespace. Configure an Authorizer plugin before onboarding the first tenant, then test with a credential from one tenant that attempts to call another tenant's namespace and confirm the request is refused.
Security docsMap tenant claims to namespace roles
A ClaimMapper reads JWT or certificate claims and maps them to namespace roles, so the tenant identity from the caller determines which namespaces it can reach. Keep the mapping deterministic: each tenant's claim should resolve only to roles on its own namespace, with no wildcard or shared admin role. Review the mapping whenever a tenant is added, and verify it with a test identity for each tenant.
Require mTLS on frontend and internode traffic
Self-hosted Temporal supports mTLS with separate settings for internode and frontend traffic. Frontend mTLS controls which clients can open a session to the cluster, and internode mTLS stops a rogue process inside the network from joining the cluster as a service. Plan certificate issuance and rotation for every tenant-facing worker and client, and confirm which settings apply to each traffic path before relying on them for isolation.
mTLS settingsEncrypt payloads with custom codecs
Temporal supports payload encryption through custom codecs and a codec server. Workflow inputs, results and activity data are stored in the persistence layer and shown in the Web UI, so a database or UI reader can see other tenants' data unless payloads are encrypted per tenant. Decide whether keys are shared or per tenant, who holds them, and how the codec server authenticates before tenant data enters the system.
Limit Web UI access with OIDC
The Web UI can be protected with OIDC single sign-on, which keeps operators and tenant support staff from using shared or anonymous access. Map each identity provider group to the least role needed, and separate operator access from tenant-facing access. Confirm that the Web UI sign-in and the API authorization use the same identity source, so a user who is removed from a tenant cannot keep viewing its workflows.
Keep services off the public internet
Temporal's deployment guidance says services should run on hosts not reachable from the public internet, with network access restricted to trusted internal networks. For multi-tenant designs, this is the outer control that limits who can reach the frontend at all. Verify with a scan from outside the network that the frontend, internode and database ports are unreachable, and confirm that tenant workers connect over a private path.
Questions teams ask before designing multi-tenancy on Temporal
Is one Temporal namespace per tenant required?
No. Temporal does not require a namespace per tenant. Many teams serve several tenants from one namespace and separate them with workflow IDs, search attributes, task queues and application-level checks. A namespace per tenant gives stronger separation of workflow history, retention and access control, but it adds operational objects to manage. The right choice depends on how much isolation your tenants contractually or regulatorily need, how many tenants you expect, and how noisy any single tenant can be. Confirm the authorization model with your security team before deciding, because the self-hosted default Authorizer allows every API request until you configure one.
What drives the cost of each multi-tenant pattern?
Cost comes from four places: persistence, workers, operations and, on Temporal Cloud, action and storage charges. Separate namespaces multiply persistence and visibility load and create more objects for operators to watch. Per-tenant task queues multiply worker pools and polling. A shared namespace concentrates load, so cost depends on fairness controls and capacity headroom. On Temporal Cloud, pay-as-you-go pricing starts at 50 US dollars per million actions, with active storage at 0.042 US dollars per GB-hour and retained storage at 0.00105 US dollars per GB-hour, according to the Temporal pricing page. Ask any partner for a quote that breaks out one-time design work from recurring infrastructure and support, and state the tenant count and workflow volume it assumes.
How long does designing and rolling out multi-tenancy take?
The duration depends on the number of tenant classes, how many isolation levels you must support, the state of your existing workflow code, and how much load testing you need before production. Design work covers namespace and task queue layout, identity mapping, rate limits and tenant onboarding automation. Rollout covers infrastructure, worker deployment, migration of any existing tenants and verification under load. No figure is given here because it varies widely by environment. Ask a partner for a written scope with named deliverables and a timeline that lists which items depend on your infrastructure access and approvals.
What does the work need from our team?
Expect to supply people who own identity and access, the platform or infrastructure owners who run the Temporal Service, and the application teams whose workflows will run for each tenant. Identity owners define how JWT or certificate claims map to namespace roles through the ClaimMapper. Infrastructure owners provide hosts, persistence and network paths, which the Temporal deployment docs say should not be reachable from the public internet. Application engineers decide workflow IDs, task queue names and how each tenant's data is encrypted with custom codecs. Ask for a list of decisions you must make before build starts, because late decisions about isolation are the most expensive to change.
Can our in-house team design and run this without a partner?
Yes, if your team already runs production distributed systems, has Temporal experience and can staff on-call for the persistence and visibility stores. The harder parts are tenant isolation design, authorization, capacity testing and noisy-neighbor controls, which need security review and load testing as well as Temporal knowledge. A partner can shorten the design phase, run load tests and document the result, but the operating burden stays with your team unless you agree on a retainer. Check whether your team has done a load test with a documented method and whether it can keep upgrades current, since Temporal recommends moving one minor version at a time.
How do Temporal Cloud pricing and SLA differ from self-hosting?
Temporal Cloud is a managed service sold on usage, while self-hosting moves cost to your infrastructure and staff. Temporal Cloud pay-as-you-go pricing includes a 99.9% SLA, or 99.99% with high availability, and SAML SSO. Support add-ons start with Business at 500 US dollars per month, with a 2-hour P0 response in business hours, while Enterprise and Mission Critical are quoted by sales and include SCIM. A self-hosted service has no vendor SLA; availability is what your team builds and operates. Note that the self-hosted server is MIT licensed, so software licensing does not add cost either way. Compare the two using the same tenant count, workflow volume and support hours, and confirm current terms on the Temporal pricing page.
What should we confirm about tenant limits before we commit?
Confirm the per-namespace and per-host request rate limits, the workflow execution limits your design will reach, and the visibility backend's ability to serve your query patterns. Temporal documents these as configurable through dynamic config, and their defaults and key names change by release, so check the version you plan to run. Confirm that your persistence backend is in the supported list for your Temporal Server version, and that Elasticsearch or OpenSearch is used for visibility at your expected volume. Ask for a load test report that shows noisy-tenant behavior, because fairness claims are only proven under contention.
How DeployOpen scopes multi-tenant Temporal work
DeployOpen scopes multi-tenant Temporal work as a fixed-scope engagement, with the scope, deliverables and timeline agreed in writing before any build starts. For a multi-tenant design, the written scope usually has to settle the tenant model first: how tenants map to namespaces or task queues, which tenants are isolated from each other, and what each tenant may consume. Those choices then drive the namespace layout, the security configuration, the limits and the test plan, so they are fixed at the start rather than discovered during rollout.
The scope covers the parts of a self-hosted Temporal Service that carry tenant isolation. DeployOpen plans the namespace layout and the task queue naming scheme, configures the frontend authorization path (the Authorizer and ClaimMapper settings that map tenant identities to namespace roles), and sets the per-namespace and per-host rate limits that stop one tenant from starving others. It also covers payload encryption and codec handling for tenant data, the network exposure of the frontend and Web UI, and the operational runbooks for onboarding and offboarding a tenant. Each item is listed in the statement of work, so the client can see what is included and what sits outside the engagement.
Testing and documentation close the engagement. DeployOpen tests tenant isolation by attempting cross-namespace access with each tenant identity, runs load scenarios that show how a noisy tenant affects shared workers and history, and records the results with the configuration used. The client receives the design record, configuration files and runbooks. Ongoing support, upgrades and continuous testing for the cluster are available as a retainer, which is quoted separately from the fixed-scope work. To compare quotes, ask each provider for the named tenant isolation tests, the rate limit values they will set and tested, and who holds the keys for payload encryption.

