Skip to content

Commit 8e91302

Browse files
Merge branch 'main' into gmt/java-standalone-activities-guide
2 parents 9a82e58 + e5eb9c1 commit 8e91302

6 files changed

Lines changed: 103 additions & 96 deletions

File tree

docs/cloud/capacity-modes.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@ This means that your default limit would be 800 APS.
133133

134134
## Provisioned Capacity {#provisioned-capacity}
135135

136-
:::tip Support, stability, and dependency info
137-
138-
Provisioned Capacity is currently in [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
139-
140-
:::
141-
142136
Provisioned Capacity provides an alternative to On-Demand Capacity by allowing you to control the limits on your Namespace based on your specific need.
143137

144138
| | Actions Per Second | Requests Per Second | Operations Per Second|

docs/develop/go/best-practices/data-handling/external-storage.mdx

Lines changed: 46 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -41,58 +41,43 @@ The Go SDK includes an S3 storage driver. Follow these steps to set it up:
4141
1. Load your AWS configuration and create the S3 storage driver. The driver uses your standard [AWS credentials](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-gosdk.html) from the environment (environment variables, IAM role, or AWS config file):
4242

4343
<!--SNIPSTART go-s3-driver-create-->
44+
[features/snippets/external_storage/s3_setup/s3_driver_create.go](https://github.com/temporalio/features/blob/main/features/snippets/external_storage/s3_setup/s3_driver_create.go)
45+
```go
46+
cfg, err := config.LoadDefaultConfig(context.Background(),
47+
config.WithRegion("us-east-2"),
48+
)
49+
if err != nil {
50+
log.Fatalf("load AWS config: %v", err)
51+
}
4452

45-
```go
46-
import (
47-
"github.com/aws/aws-sdk-go-v2/config"
48-
"github.com/aws/aws-sdk-go-v2/service/s3"
49-
"go.temporal.io/sdk/contrib/aws/s3driver"
50-
"go.temporal.io/sdk/contrib/aws/s3driver/awssdkv2"
51-
)
52-
53-
cfg, err := config.LoadDefaultConfig(context.Background(),
54-
config.WithRegion("us-east-2"),
55-
)
56-
if err != nil {
57-
log.Fatalf("load AWS config: %v", err)
58-
}
59-
60-
driver, err := s3driver.NewDriver(s3driver.Options{
61-
Client: awssdkv2.NewClient(s3.NewFromConfig(cfg)),
62-
Bucket: s3driver.StaticBucket("my-temporal-payloads"),
63-
})
64-
if err != nil {
65-
log.Fatalf("create S3 driver: %v", err)
66-
}
67-
```
68-
53+
driver, err := s3driver.NewDriver(s3driver.Options{
54+
Client: awssdkv2.NewClient(s3.NewFromConfig(cfg)),
55+
Bucket: s3driver.StaticBucket("my-temporal-payloads"),
56+
})
57+
if err != nil {
58+
log.Fatalf("create S3 driver: %v", err)
59+
}
60+
```
6961
<!--SNIPEND-->
7062

7163
2. Configure the driver on `ExternalStorage` and pass it in your Client options:
7264

7365
<!--SNIPSTART go-s3-external-storage-setup-->
66+
[features/snippets/external_storage/s3_setup/s3_external_storage_setup.go](https://github.com/temporalio/features/blob/main/features/snippets/external_storage/s3_setup/s3_external_storage_setup.go)
67+
```go
68+
c, err := client.Dial(client.Options{
69+
HostPort: "localhost:7233",
70+
ExternalStorage: converter.ExternalStorage{
71+
Drivers: []converter.StorageDriver{driver},
72+
},
73+
})
74+
if err != nil {
75+
log.Fatalf("connect to Temporal: %v", err)
76+
}
77+
defer c.Close()
7478

75-
```go
76-
import (
77-
"go.temporal.io/sdk/client"
78-
"go.temporal.io/sdk/converter"
79-
"go.temporal.io/sdk/worker"
80-
)
81-
82-
c, err := client.Dial(client.Options{
83-
HostPort: "localhost:7233",
84-
ExternalStorage: converter.ExternalStorage{
85-
Drivers: []converter.StorageDriver{driver},
86-
},
87-
})
88-
if err != nil {
89-
log.Fatalf("connect to Temporal: %v", err)
90-
}
91-
defer c.Close()
92-
93-
w := worker.New(c, "my-task-queue", worker.Options{})
94-
```
95-
79+
w := worker.New(c, "my-task-queue", worker.Options{})
80+
```
9681
<!--SNIPEND-->
9782

9883
By default, payloads larger than 256 KiB are offloaded to external storage. You can adjust this with the
@@ -112,21 +97,8 @@ The following example shows a custom driver that uses local disk as the backing
11297
development and testing only. In production, use a durable storage system that is accessible to all Workers:
11398

11499
<!--SNIPSTART go-custom-storage-driver-->
115-
100+
[features/snippets/external_storage/custom_driver/custom_storage_driver.go](https://github.com/temporalio/features/blob/main/features/snippets/external_storage/custom_driver/custom_storage_driver.go)
116101
```go
117-
package main
118-
119-
import (
120-
"fmt"
121-
"os"
122-
"path/filepath"
123-
124-
"github.com/google/uuid"
125-
commonpb "go.temporal.io/api/common/v1"
126-
"go.temporal.io/sdk/converter"
127-
"google.golang.org/protobuf/proto"
128-
)
129-
130102
type LocalDiskStorageDriver struct {
131103
storeDir string
132104
}
@@ -204,7 +176,6 @@ func (d *LocalDiskStorageDriver) Retrieve(
204176
return payloads, nil
205177
}
206178
```
207-
208179
<!--SNIPEND-->
209180

210181
The following sections walk through the key parts of the driver implementation.
@@ -262,18 +233,15 @@ are offloaded to external storage. You can adjust this with the `PayloadSizeThre
262233
externalize all payloads regardless of size. A value of 0 is interpreted as the default (256 KiB).
263234

264235
<!--SNIPSTART go-external-storage-threshold-->
265-
236+
[features/snippets/external_storage/threshold/threshold_config.go](https://github.com/temporalio/features/blob/main/features/snippets/external_storage/threshold/threshold_config.go)
266237
```go
267-
import "go.temporal.io/sdk/converter"
268-
269238
c, err := client.Dial(client.Options{
270-
ExternalStorage: converter.ExternalStorage{
271-
Drivers: []converter.StorageDriver{driver},
272-
PayloadSizeThreshold: 1,
273-
},
239+
ExternalStorage: converter.ExternalStorage{
240+
Drivers: []converter.StorageDriver{driver},
241+
PayloadSizeThreshold: 1,
242+
},
274243
})
275244
```
276-
277245
<!--SNIPEND-->
278246

279247
## Use multiple storage drivers
@@ -296,29 +264,24 @@ The following example registers two drivers but always selects `preferredDriver`
296264
is only registered so the Worker can retrieve payloads that were previously stored with it:
297265

298266
<!--SNIPSTART go-external-storage-multiple-drivers-->
299-
267+
[features/snippets/external_storage/multiple_drivers/multiple_drivers.go](https://github.com/temporalio/features/blob/main/features/snippets/external_storage/multiple_drivers/multiple_drivers.go)
300268
```go
301-
import (
302-
commonpb "go.temporal.io/api/common/v1"
303-
"go.temporal.io/sdk/converter"
304-
)
305-
306269
type PreferredSelector struct {
307-
preferred converter.StorageDriver
270+
preferred converter.StorageDriver
308271
}
309272

310273
func (s *PreferredSelector) SelectDriver(
311-
ctx converter.StorageDriverStoreContext,
312-
payload *commonpb.Payload,
274+
ctx converter.StorageDriverStoreContext,
275+
payload *commonpb.Payload,
313276
) (converter.StorageDriver, error) {
314-
return s.preferred, nil
277+
return s.preferred, nil
315278
}
316279

317-
// Usage:
318-
converter.ExternalStorage{
319-
Drivers: []converter.StorageDriver{preferredDriver, legacyDriver},
320-
DriverSelector: &PreferredSelector{preferred: preferredDriver},
280+
func MultipleDriversSetup(preferredDriver, legacyDriver converter.StorageDriver) converter.ExternalStorage {
281+
return converter.ExternalStorage{
282+
Drivers: []converter.StorageDriver{preferredDriver, legacyDriver},
283+
DriverSelector: &PreferredSelector{preferred: preferredDriver},
284+
}
321285
}
322286
```
323-
324287
<!--SNIPEND-->

docs/develop/python/nexus/feature-guide.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class MyNexusServiceHandler:
245245
input.name, # First argument: name
246246
input.language, # Second argument: language
247247
],
248-
id=str(uuid.uuid4()),
248+
id=f"hello-multi-args-{input.name}-{input.language}",
249249
)
250250

251251

docs/encyclopedia/workflow/workflow-execution/event.mdx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This page discusses the following:
2424
- [Time Constraints](#time-constraints)
2525
- [Reset](#reset)
2626
- [Side Effect](#side-effect)
27+
- [Principal Attribution](#principal-attribution)
2728

2829
The Temporal Service tracks the progress of each Workflow Execution by appending information about Events, such as when the Workflow Execution began or ended, to the Event History associated with that execution.
2930
This information not only enables developers to know what took place, but is also essential for providing Durable Execution, since it enables the Workflow Execution to recover from a crash and continue making progress.
@@ -123,3 +124,57 @@ A Side Effect does not re-execute upon replay, but instead returns the recorded
123124

124125
Do not ever have a Side Effect that could fail, because failure could result in the Side Effect function executing more than once.
125126
If there is any chance that the code provided to the Side Effect could fail, use an Activity.
127+
128+
## What is a Principal Attribution? {#principal-attribution}
129+
130+
:::tip SUPPORT, STABILITY, and DEPENDENCY INFO
131+
132+
Principal Attribution is currently available in [Pre-release](/evaluate/development-production-features/release-stages#pre-release).
133+
134+
Email addresses can be displayed, which may be considered Personally Identifiable information (PII data), and should be handled according to your organization’s privacy, access control, logging, and retention policies.
135+
136+
:::
137+
138+
Principal Attribution for Workflow Executions is a server-derived set of non-spoofable `Principal` fields for Workflow history events.
139+
140+
The `Principal` fields represent the authenticated principal responsible for a [dataplane](/cloud/overview#data-plane-and-control-plane) execution action.
141+
This allows for identification of the entity that took a given action.
142+
143+
This is especially valuable for:
144+
145+
- compliance and audit use cases
146+
- incident investigation and root cause analysis
147+
- access governance and internal accountability
148+
149+
### Temporal Cloud
150+
151+
When enabled, Temporal Cloud populates the `Principal` value (with `Principal Type` and `Principal Name` fields).
152+
153+
Possible values are as follows:
154+
155+
| Type | Name |
156+
| ---- | ---- |
157+
| `users` | user email address |
158+
| `service-accounts` | service account name |
159+
| `mtls` | Common Name (CN) or Subject Domain Name (DN) if CN is not present |
160+
| `temporal` | Temporal internal services |
161+
162+
Anyone who has permission to read Workflow history in the Namespace (ReadOnly access and above) can see the Principal (and the metadata such as email address).
163+
164+
To enable Principal Attribution for a Namespace, contact [Temporal Cloud support](https://docs.temporal.io/cloud/support#support-ticket).
165+
166+
### Self-hosted Temporal
167+
168+
In self-hosted Temporal, you can control Principal Attribution with a dynamic config flag scoped to the Namespace.
169+
When enabled, the Principal returned by the `Authorizer` is stamped on Workflow history events.
170+
To enable, set `frontend.enablePrincipalPropagation` to `true` for the appropriate Namespace.
171+
172+
When using the default `Authorizer` with the default JWT `ClaimMapper`, the following values are populated:
173+
174+
| Type | Name |
175+
| ---- | ---- |
176+
| `jwt ` | value of the JWT `sub` claim |
177+
| `temporal` | `internal` (for internal frontend requests) |
178+
179+
A custom `Authorizer` must set the Principal field on `authorization.Result` for the request to be attributed.
180+
Custom `ClaimMapper` implementations control the `AuthType` and `Subject` values that the default `Authorizer` then copies into the `Principal`.

docs/encyclopedia/workflow/workflow-execution/workflowid-runid.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,4 @@ The Workflow Id Conflict Policy can have one of the following values:
143143
**This is the default policy, if one isn't specified.**
144144
- **Use Existing:** Prevents the Workflow Execution from spawning and returns a successful response with the Open Workflow Execution's Run Id.
145145
- **Terminate Existing:** Terminates the Open Workflow Execution then spawns the new Workflow Execution with the same Workflow Id.
146+

docs/evaluate/temporal-cloud/pricing.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,6 @@ On-Demand capacity is automatically adjusted based on past usage.
269269
Provisioned Capacity modes lets you define the capacity that is needed by your Workflow and is useful to handle traffic outside of the standard on-demand limits.
270270
See details on how capacity is set and the associated limits at [Capacity Modes](/cloud/capacity-modes).
271271

272-
:::tip Support, stability, and dependency info
273-
274-
Provisioned Capacity is currently in [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
275-
276-
:::
277-
278272
**How does pricing for Capacity Modes work?**
279273

280274
The number of Actions accrued can be impacted by your capacity mode.

0 commit comments

Comments
 (0)