💥 filter nil values from SearchAttributes for workflow start and continue-as-new#2274
Draft
💥 filter nil values from SearchAttributes for workflow start and continue-as-new#2274
SearchAttributes for workflow start and continue-as-new#2274Conversation
jmaeagle99
approved these changes
Apr 9, 2026
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 was changed
💥 Start-like requests now omit unset search attributes instead of sending
binary/nullpayloads inSearchAttributes.Added
sanitizeSearchAttributesForStartand applied it to:Also added regression coverage to verify that:
nil/MetadataEncodingNilsearch attributes are removed from start requestsData == nil(for example[]byte(nil)encoded asbinary/plain) are preservedWhy?
Unset search attributes are represented in workflow state as nil payloads so upserts can remove them, but start-like requests should not resend those unset values.
Without this change, a workflow that unset a search attribute and then continued as new could carry that removed attribute forward incorrectly. The sanitization is intentionally keyed to
MetadataEncodingNilso we only drop true nil payloads and do not accidentally strip other payloads that may haveData == nil.💥 Behavior change details
MetadataEncodingNil(binary/null) instead of sending them to the server.payload.Data == nil, so values like[]byte(nil)encoded asbinary/plainare still sent.Checklist
Closes Stop sending null search attribute values on workflow start and continue as new #2150
How was this tested:
Added/updated tests in:
internal/internal_workflow_client_test.gotest/integration_test.gotest/workflow_test.goRan:
The broader integration suite was not run in this session.
No.