Skip to content

Commit ee23425

Browse files
committed
Cleanup
2 parents 9dcefb0 + 9cc85c1 commit ee23425

34 files changed

Lines changed: 1403 additions & 182 deletions

File tree

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
cooldown:
8+
default-days: 14
9+
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: weekly
14+
cooldown:
15+
default-days: 14

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npmMinimalAgeGate: "14d"

docs/best-practices/cloud-access-control.mdx

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ Temporal Cloud supports two secure authentication methods for Workers:
2222

2323
Both options help secure communication between workers and Temporal Cloud. Choosing the right method and managing it properly is key to maintaining security and minimizing downtime.
2424

25+
Use this page to define your operating model for machine access to Temporal Cloud. For setup steps and product-specific
26+
mechanics, see [Manage API keys](/cloud/api-keys) and [Manage service accounts](/cloud/service-accounts).
27+
28+
Related guidance:
29+
- [Namespace best practices](/best-practices/managing-namespace)
30+
- [Multi-tenant application patterns](/production-deployment/multi-tenant-patterns)
31+
2532
The high-level end-to-end rotation process is:
2633

2734
1. **Generate new credentials**: Create new certificates or API keys in Temporal Cloud before the current ones expire
@@ -45,17 +52,64 @@ In the case that you are using multiple certificates signed by the same CA, and
4552

4653
One convention is to give certificates a common name that matches the namespace. If you do this when using the same CA for dev and prod, then you can leverage Certificate Filters to prevent access to production environments. This is described in detail under the [authorization section](https://docs.temporal.io/cloud/certificates#control-authorization) of the documentation.
4754

48-
## Best practices:
49-
#### 1. Establish clear guidelines on authentication methods: Teams should standardize on either [mTLS certificates](https://docs.temporal.io/cloud/certificates) or [API keys](https://docs.temporal.io/cloud/api-keys) for the following operations:
55+
## Best practices
56+
57+
### Establish clear guidelines on authentication methods
58+
59+
Teams should standardize on either [mTLS certificates](https://docs.temporal.io/cloud/certificates) or
60+
[API keys](https://docs.temporal.io/cloud/api-keys) for the following operations:
5061
- Connect Temporal clients to Temporal Cloud (e.g. Worker processes)
5162
- Automation (e.g. Temporal Cloud [Operations API](https://docs.temporal.io/ops), [Terraform provider](https://docs.temporal.io/cloud/terraform-provider), [Temporal CLI](https://docs.temporal.io/cli/setup-cli))
5263

53-
By default, it is recommended for teams to use API keys and [service accounts](https://docs.temporal.io/cloud/service-accounts) for both operations because API keys are easier to manage and rotate for most teams. In addition, you can control account-level and namespace-level roles for service accounts.
64+
By default, teams should use API keys with [service accounts](/cloud/service-accounts) for both operations. API keys
65+
are generally easier to set up and rotate than mTLS certificates, and service accounts let you assign account-level and
66+
namespace-level roles.
67+
68+
If your organization requires mutual authentication and stronger cryptographic guarantees, use
69+
[mTLS certificates](/cloud/certificates) to authenticate Temporal clients to Temporal Cloud and use API keys for
70+
automation, because the Temporal Cloud [Operations API](/ops) and [Terraform provider](/cloud/terraform-provider) only
71+
support API key authentication. Unlike API keys tied to users or service accounts, mTLS certificate authentication is
72+
not tied to Temporal Cloud RBAC identities. Namespace access is based on CA trust, with optional
73+
[Certificate Filters](/cloud/certificates#manage-certificate-filters) to narrow access by Common Name.
74+
75+
### Default operating model for service accounts and API keys
76+
77+
For most organizations, use the following defaults:
78+
79+
- Create one Service Account per service or worker deployment, not one shared Service Account for an entire team
80+
- Use account-level Service Accounts only when a service genuinely needs cross-Namespace or account-wide access
81+
- Prefer Namespace-scoped Service Accounts when a service should only access one Namespace
82+
- Grant Service Accounts namespace-level access only to the specific Namespaces they need
83+
84+
This approach gives you cleaner ownership, easier rotation, and better auditability than sharing a single machine
85+
identity across multiple services.
86+
87+
### Use access boundaries that match your Namespace boundaries
88+
89+
The way you partition Namespaces should usually match the way you partition machine identities.
90+
91+
- If multiple services share a Namespace, you may still want one Service Account per service so that each deployment can
92+
rotate credentials independently.
93+
- If you split workloads into separate Namespaces for security, capacity, or team ownership reasons, those Namespaces
94+
should usually have separate Service Accounts and API keys as well.
95+
- If you use Namespace-per-tenant isolation, expect your credential model and RBAC model to become correspondingly more
96+
granular.
97+
98+
For more on topology tradeoffs, see [Namespace best practices](/best-practices/managing-namespace) and
99+
[Multi-tenant application patterns](/production-deployment/multi-tenant-patterns).
100+
101+
### Rotate credentials without downtime
102+
103+
Use the following sequence when rotating credentials:
54104

55-
If your organization requires mutual authentication and stronger cryptographic guarantees, then it is encouraged for your teams to use mTLS certificates to authenticate Temporal clients to Temporal Cloud and use API keys for automation (because Temporal Cloud [Operations API](https://docs.temporal.io/ops) and [Terraform provider](https://docs.temporal.io/cloud/terraform-provider) only supports API key for authentication)
105+
1. Create the replacement credential before the existing one expires.
106+
2. For API keys, create the new valid key while the old key still works, then roll your Workers and clients to use the new key.
107+
3. For client certificates, stage the new certificate before removing the old one when your deployment process supports that transition.
108+
4. Validate connectivity and normal Workflow execution using the new credential.
109+
5. Remove the old credential only after all clients and Workers have switched.
56110

57-
#### 2. Use Certificate Filters to restrict access when using shared CAs (e.g., `dev` vs `prod`):
111+
### Use Certificate Filters to restrict access when using shared CAs (e.g., `dev` vs `prod`)
58112

59-
Certificate Filters are an additional way of validating using the client certificate presented during client authentication. Give certificates a common name that matches the namespace. This is not a requirement.
113+
Certificate Filters are an additional way of validating using the client certificate presented during client authentication. Give certificates a common name that matches the namespace. This is not a requirement.
60114

61-
If you do this when using the same CA for dev and prod environments, then you can leverage Certificate Filters to prevent access to production.
115+
If you do this when using the same CA for dev and prod environments, then you can leverage Certificate Filters to prevent access to production.

docs/best-practices/managing-aps-limits.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ An APS limit is set per Namespace, so multiple use cases with multiple traffic p
175175

176176
#### How to Mitigate
177177

178-
Plan for a set of Namespaces (one per environment) per use case. See [Managing a Namespace](/best-practices/managing-namespace) for more details.
178+
Plan for a set of Namespaces (one per environment) per use case. This gives each use case its own APS envelope and
179+
reduces the blast radius when one workload spikes or misbehaves.
180+
181+
If you are deciding whether to split by use case, service, or domain, see
182+
[Managing a Namespace](/best-practices/managing-namespace) for a topology decision framework.
179183

180184
## Provisioned Capacity and TRUs
181185

docs/best-practices/managing-namespace.mdx

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ For reference documentation, see:
2727
A [Namespace](/namespaces) is a unit of isolation within the Temporal Platform.
2828
It ensures that Workflow Executions, Task Queues, and resources are logically separated, preventing conflicts and enabling safe multi-tenant usage.
2929

30+
Use this page to decide how many Namespaces you need and where to draw boundaries between environments, services,
31+
domains, and tenants. For Cloud-specific namespace mechanics such as creation, tagging, and gRPC endpoints, see
32+
[Namespaces (Temporal Cloud)](/cloud/namespaces).
33+
34+
Related guidance:
35+
- [Managing Temporal Cloud access control](/best-practices/cloud-access-control)
36+
- [Multi-tenant application patterns](/production-deployment/multi-tenant-patterns)
37+
- [Managing Actions per Second (APS) limits in Temporal Cloud](/best-practices/managing-aps-limits)
38+
3039
## Naming Conventions
3140

3241
### Use lowercase and hyphens
@@ -66,30 +75,72 @@ If you need to include region, use short codes (e.g., `aps1`, `use1`).
6675

6776
## Organizational Patterns
6877

78+
### Choose your Namespace boundary intentionally
79+
80+
Start with the smallest number of Namespaces that gives you clear ownership and safe isolation.
81+
In Temporal Cloud, a Namespace boundary affects:
82+
83+
- [APS limits](/cloud/limits#actions-per-second) and rate limiting
84+
- access control and credential scope
85+
- blast radius for misconfigured or overloaded Workers
86+
- observability boundaries for dashboards and alerts
87+
- operational overhead for provisioning, tagging, and lifecycle management
88+
89+
Use the following decision table as a starting point:
90+
91+
| If you need... | Prefer... | Why |
92+
|---|---|---|
93+
| Basic environment isolation for a single application or use case | Namespace per use case and environment | This is the simplest pattern and works well for most initial deployments |
94+
| Separate operational ownership for services within the same use case | Namespace per use case, service, and environment | This isolates credentials, limits, and operational changes per service |
95+
| Stronger boundaries across teams, domains, or business capabilities | Namespace per use case, domain, and environment | This reduces blast radius and lets teams own their own Namespace contracts |
96+
| Tenant-specific credentials, rate limits, or compliance boundaries | Namespace per tenant | Use this only for a small number of high-value tenants because of the operational overhead |
97+
98+
As a default, start with one Namespace per use case and environment. Split later when APS pressure, security
99+
requirements, ownership boundaries, or troubleshooting needs justify the extra operational cost.
100+
69101
### Pattern 1: Namespace per use case and environment
70102

71103
For simple configurations without multiple services or team boundaries.
72104

73-
**Naming convention**: `<use-case>_<environment>`
105+
**Naming convention**: `<use-case>-<environment>`
106+
107+
**Example**: `payments-prd`, `orders-dev`
74108

75-
**Example**: `payments_prod`, `orders_dev`
109+
Choose this pattern when:
110+
111+
- one team owns the use case
112+
- environments need clean separation
113+
- workload volume and criticality do not yet require further isolation
76114

77115
### Pattern 2: Namespace per use case, service, and environment
78116

79117
When multiple services that are part of the same use case communicate externally to Temporal via API (HTTP/gRPC).
80118

81-
**Naming convention**: `<use-case>_<service>_<environment>`
119+
**Naming convention**: `<use-case>-<service>-<environment>`
120+
121+
**Example**: `payments-gateway-prd`, `payments-processor-prd`
122+
123+
Choose this pattern when:
82124

83-
**Example**: `payments_gateway_prod`, `payments_processor_prod`
125+
- services need separate credentials or access policies
126+
- one service can exhaust APS or operational limits independently of the others
127+
- teams want separate ownership of deployment, alerting, or on-call boundaries
84128

85129
### Pattern 3: Namespace per use case, domain, and environment
86130

87131
When multiple services need to communicate with each other, use [Temporal Nexus](/nexus) to connect Workflows across Namespace boundaries.
88132
This provides better security, fault isolation, and modularity than sharing a Namespace.
89133

90-
**Naming convention**: `<use-case>_<domain>_<environment>`
134+
**Naming convention**: `<use-case>-<domain>-<environment>`
91135

92-
**Example**: `payments_checkout_prod`, `payments_refunds_prod`
136+
**Example**: `payments-checkout-prd`, `payments-refunds-prd`
137+
138+
Choose this pattern when:
139+
140+
- multiple teams or domains need independent release cadence and ownership
141+
- failures in one domain should not affect the others
142+
- you want a stronger permission boundary between capabilities
143+
- you plan to expose cross-Namespace contracts through Nexus
93144

94145
For systems without Nexus, services can communicate via [Signals](/sending-messages#sending-signals) or [Child Workflows](/child-workflows) within the same Namespace.
95146

@@ -98,6 +149,33 @@ When multiple teams share a Namespace, prefix each Workflow ID with a service-sp
98149
Task Queue names must also be unique within the Namespace.
99150
:::
100151

152+
### Pattern 4: Namespace per tenant
153+
154+
Use a separate [Namespace](/namespaces) per tenant only when each tenant needs a true isolation boundary.
155+
156+
This is usually appropriate only for a small number of high-value tenants that require:
157+
158+
- dedicated credentials and access control
159+
- tenant-specific rate limits or capacity decisions
160+
- strict compliance or data-isolation boundaries
161+
- independent debugging, alerting, and operational ownership
162+
163+
For most SaaS use cases, a shared Namespace with per-tenant [Task Queues](/task-queue) is simpler and more scalable.
164+
See [Multi-tenant application patterns](/production-deployment/multi-tenant-patterns) for those designs.
165+
166+
### What should cause you to split a Namespace later?
167+
168+
Revisit your topology when one or more of the following becomes true:
169+
170+
- one workload is consuming enough APS that it regularly threatens others in the same Namespace
171+
- one team needs tighter access controls or dedicated credentials
172+
- production troubleshooting requires clearer dashboards, alerts, or ownership boundaries
173+
- one application or domain is business-critical enough that its blast radius must be reduced
174+
- a tenant or regulated workload needs stronger separation than Task Queue isolation can provide
175+
176+
Splitting a Namespace increases safety, but it also adds overhead for provisioning, tagging, credentials, and cross-Namespace coordination.
177+
Use [Nexus](/nexus) where possible instead of sharing Temporal primitives across team or domain boundaries.
178+
101179
## Production Safeguards
102180

103181
### Use an Authorizer (open source only) {#authorizer}

docs/cloud/billing-and-usage/billing-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ For public preview, reports can be generated with hourly, daily and monthly gran
5151

5252
Date ranges must use billing-month boundaries (MM/YYYY).
5353
Requests may include the current billing month.
54-
The data in finalized reports includes usage up to `current_time` \- 24 hours (rounded up to nearest hour).
54+
The data in finalized reports includes usage up to `current_time` \- 24 hours (rounded down to the granularity level).
5555

5656
## Rate limits and concurrency
5757

docs/cloud/get-started/api-keys.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ The authentication process follows this pathway:
5757
unexpected or unauthorized activity.
5858
- **Use a Key Management System (KMS)**: Employ a Key Management System to minimize the risk of key leaks.
5959

60+
For guidance on which identities should own API keys, when to use Namespace-scoped Service Accounts, and how to align
61+
API keys with your Namespace topology, see [Managing Temporal Cloud access control](/best-practices/cloud-access-control).
62+
6063
### API key use cases
6164

6265
API keys are used for the following scenarios:
@@ -223,6 +226,9 @@ Temporal API keys automatically expire based on the specified expiration time. F
223226
1. Switch clients to load the new key and start using it.
224227
1. Delete the old key after it is no longer in use.
225228

229+
For a broader machine-identity rotation strategy across API keys and Service Accounts, see
230+
[Managing Temporal Cloud access control](/best-practices/cloud-access-control).
231+
226232
## Manage API keys for Service Accounts {#serviceaccount-api-keys}
227233

228234
Global Administrators and Account Owners can manage and generate API keys for _all_ Service Accounts in their account.

0 commit comments

Comments
 (0)