Skip to content

Context hook for payload visitor#243

Merged
jmaeagle99 merged 1 commit intotemporalio:masterfrom
jmaeagle99:contexthook
Mar 30, 2026
Merged

Context hook for payload visitor#243
jmaeagle99 merged 1 commit intotemporalio:masterfrom
jmaeagle99:contexthook

Conversation

@jmaeagle99
Copy link
Copy Markdown
Contributor

@jmaeagle99 jmaeagle99 commented Mar 30, 2026

What changed?

Add optional VisitPayloadsOptions.ContextHook to allow updating the context on a per-message basis.

Why?

Allow contextual information for each proto message instance so that descending payload visiting has access to it. For example, this enables context awareness when visiting the commands of a workflow task completion request.

How did you test it?

Added new tests to validate existing behavior and new behavior.

Potential risks

Low. This setting is marked as experimental and requires opt-in to enable the new behavior. Existing usage should see no behavioral differences.

@jmaeagle99 jmaeagle99 requested review from a team as code owners March 30, 2026 16:28
if options.SkipSearchAttributes { continue }
{{end}}
if o == nil { continue }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only handles payloads, do we want to create a GH issue for a future visitFailures feature for ContextHook? Maybe something worth tracking in the Go SDK as a future feature?

@jmaeagle99 jmaeagle99 merged commit d4eaf78 into temporalio:master Mar 30, 2026
4 checks passed
@jmaeagle99 jmaeagle99 deleted the contexthook branch March 30, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants