Add metadata context support to mutable state#8966
Closed
nikki-dag wants to merge 1 commit intotemporalio:mainfrom
Closed
Add metadata context support to mutable state#8966nikki-dag wants to merge 1 commit intotemporalio:mainfrom
nikki-dag wants to merge 1 commit intotemporalio:mainfrom
Conversation
326c7cc to
0a83835
Compare
0a83835 to
efe6950
Compare
nikki-dag
commented
Jan 8, 2026
| metadataContextInterceptor *interceptor.MetadataContextInterceptor, | ||
| ) []grpc.UnaryServerInterceptor { | ||
| return []grpc.UnaryServerInterceptor{ | ||
| metadataContextInterceptor.Intercept, |
Contributor
Author
There was a problem hiding this comment.
We don't need to inject this in OSS yet, let me know if you think I should remove it.
| metadataContextKey struct{} | ||
|
|
||
| // metadataContext is used to store workflow and activity metadata that can be modified in-place | ||
| metadataContext struct { |
Contributor
Author
There was a problem hiding this comment.
I can specify a more descriptive name for this map, such as "archetypeAttributesContext." Let me know if you have other suggestions or prefer to keep it generic.
efe6950 to
07a6cde
Compare
07a6cde to
2cc1fbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Adds metadata context support to history service gRPC calls while setting information before finalizing any mutable state transaction.
Why?
We want to pass mutable state metadata, such as workflow type, activity type, workflow task queue, and activity task queue, throughout the gRPC call lifecycle.
How did you test it?
Note
Introduces a per-request metadata context and populates it with workflow info during state transitions.
contextutilmetadata store with thread-safe, in-placeContextMetadataSet/GetMetadataContextInterceptorthat injects metadata context into all history requests; wired viafxinfx.goMutableStateImplnow setsworkflow-typeandworkflow-task-queueinto the requestcontextatcloseTransactionWritten by Cursor Bugbot for commit 2cc1fbc. This will update automatically on new commits. Configure here.