Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions references/go/data-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,32 @@ err := workflow.UpsertMemo(ctx, map[string]interface{}{
})
```

### Memo encoding: default vs. user `DataConverter`

By default, Memo values are serialized with the **default** Data Converter — even when `client.Options{DataConverter}` is set to a custom converter.
That means a `CodecDataConverter` you configured to encrypt Workflow inputs/results does **not** apply to Memo fields by default.

Go SDK v1.41.0 added the opt-in SDK flag `SDKFlagMemoUserDCEncode` (numeric ID `7`).
When enabled, `StartWorkflow`, `SignalWithStartWorkflow`, `ScheduleClient.Create`, `workflow.UpsertMemo`, and `workflow.ExecuteChildWorkflow` route Memo values through the user `DataConverter` from `client.Options`.
On encode error, the SDK falls back to the default Data Converter; if the default also errors, the **user converter's** error is returned.

The flag is **disabled by default** in `sdkFlagsAllowed` in v1.41.0 through v1.43.0.
Enable it at process start by setting the env var `TEMPORAL_SDK_FLAG_7=1`.
There is no public `client.Options` or `worker.Options` field for this — the env var is the only knob.

To encrypt Memos with a `PayloadCodec`, both must be true: (a) the codec is part of the `DataConverter` passed to `client.Dial` (e.g., via `converter.NewCodecDataConverter`), and (b) `TEMPORAL_SDK_FLAG_7=1` is set on every client process and worker process that writes Memos.

Scope notes:

- The flag affects Memo encoding only; Search Attributes use a separate typed-value path.
- For in-Workflow calls (`UpsertMemo`, `ExecuteChildWorkflow`), the flag is gated through `TryUse`, so the decision is recorded in history and replay stays deterministic.
- Memos remain "non-indexed metadata" with no type safety and eventual consistency — enabling the flag does not change those properties.

## Best Practices

1. Use structs with exported fields for inputs and outputs
2. Prefer JSON for readability during development, protobuf for performance in production
3. Keep payloads small -- see `references/core/gotchas.md` for limits
4. Use `PayloadCodec` for encryption; never store sensitive data unencrypted
5. Configure the same data converter on both client and worker
6. Don't put sensitive data in a Memo unless every process that writes memos sets `TEMPORAL_SDK_FLAG_7=1` **and** the client's `DataConverter` includes the encrypting `PayloadCodec` — otherwise memos bypass the codec
1 change: 0 additions & 1 deletion references/java/integrations/spring-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ Media image = new Media(MimeTypeUtils.IMAGE_PNG, URI.create("https://cdn.example

For anything larger than a small thumbnail, route the bytes to a binary store from an Activity and pass only the URL across the conversation.


## Vector stores, embeddings, and MCP

When the corresponding Spring AI modules (`spring-ai-rag`, `spring-ai-mcp`) are on the classpath, the integration registers Activities for vector stores, embeddings, and MCP tool calls automatically. Inject the matching Spring AI types into your Activities or Workflows and use them as you would in any Spring AI application — each operation executes through a Temporal Activity.
Expand Down