💥 Carry over search attributes on continue-as-new if none are explicitly set#2731
Merged
Quinn-With-Two-Ns merged 4 commits intotemporalio:masterfrom Dec 4, 2025
Merged
Conversation
temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java
Outdated
Show resolved
Hide resolved
cretz
reviewed
Nov 19, 2025
Contributor
There was a problem hiding this comment.
Technically this is a change to behavior incompatibly if people have built expectation on the carryover not occurring. Should we add a 💥 in the title and note it in release notes? I assume if they want to go back to today's behavior they can provide an explicit empty attr collection?
(not reviewing the PR itself, just confirming the relaying of compatibility change)
Contributor
Author
There was a problem hiding this comment.
So according to the Javadoc the behaviour has always been to copy if none are specify, the SDK just hasn't been. This is a change in behavior so I have no issue calling it out with 💥 .
And yes if a user wants the previous behaviour they can set an empt collection.
296c6b2 to
f9f1759
Compare
maciejdudko
approved these changes
Dec 2, 2025
f9f1759 to
a2acbff
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.
Carry over search attributes on continue-as-new if none are explicitly set, this is the documented behaviour but previously the Java SDK was not actually carrying over search attributes.
closes #2178
Note
Carry over existing search attributes across continue-as-new and update test server and tests to support and verify it.
SyncWorkflowContext.continueAsNew(...): if nosearchAttributes/typedSearchAttributesprovided, carry over existingSearchAttributesfromreplayContext.RetryPolicyfromreplayContextwhenContinueAsNewOptionsis null.StateMachines: includesearchAttributesinWorkflowExecutionContinuedAsNewEventAttributeswhen present.TestWorkflowService.continueAsNew(...): forward continued runsearchAttributesintoStartWorkflowExecutionRequest.ContinueAsNewTest: add typed search attributes to initial options; assert they are carried over on first continue-as-new and can be overridden on subsequent runs.ContinueAsNewOptions.Written by Cursor Bugbot for commit a2acbff. This will update automatically on new commits. Configure here.