Repository navigation
Support direct synchronous returns from Temporal operations - #3206
Merged
litlep-nibbyt merged 1 commit intoNov 19, 2026
Merged
Conversation
litlep-nibbyt
force-pushed
the
nexus-sync-return
branch
from
November 17, 2026 00:05
feb7bba to
dabefa9
Compare
litlep-nibbyt
marked this pull request as ready for review
November 17, 2026 01:22
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the synchronous Nexus handler direct-return changes.
No open issues 🎉
What changed in this PR
This PR simplifies synchronous Nexus handlers in the Java SDK by allowing @TemporalOperation methods to return output directly. It builds on the context refactor in #3195 while preserving explicit TemporalOperationResult returns.
Changes:
- Validate direct return types and wrap returned values as synchronous results, including null, primitive, and void outputs.
- Add unit and workflow tests for direct returns, type validation, failure propagation, and existing wrapped results.
- Update API documentation, examples, and the changelog.
| File | Description |
|---|---|
temporal-sdk/src/test/java/io/temporal/workflow/nexus/TemporalOperationAnnotationTest.java |
Adds end-to-end coverage for direct output serialization, null results, and failures. |
temporal-sdk/src/test/java/io/temporal/internal/nexus/TemporalOperationProcessorTest.java |
Tests direct-return validation, wrapping, and compatibility with wrapped results. |
temporal-sdk/src/main/java/io/temporal/nexus/TemporalOperation.java |
Documents direct synchronous returns and void support. |
temporal-sdk/src/main/java/io/temporal/nexus/TemporalNexusClient.java |
Updates synchronous-handler documentation and the signal example. |
temporal-sdk/src/main/java/io/temporal/internal/nexus/TemporalOperationProcessor.java |
Accepts direct output types and wraps values in synchronous results. |
CHANGELOG.md |
Announces direct-return support and continued wrapped-result compatibility. |
Review effort: Balanced
Quinn-With-Two-Ns
approved these changes
Nov 18, 2026
litlep-nibbyt
force-pushed
the
nexus-sync-return
branch
from
November 18, 2026 22:11
224f3b6 to
cad03d6
Compare
litlep-nibbyt
force-pushed
the
nexus-sync-return
branch
from
November 19, 2026 00:42
a59fa92 to
65439e4
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?
Allow
@TemporalOperationmethods to return their output directly:The SDK wraps the value as a synchronous result internally. Existing methods returning
TemporalOperationResult<R>continue to work.Stacked on #3195; this diff contains only direct-return support, documentation, and tests.
Why?
Remove the explicit
TemporalOperationResult.sync(...)wrapper from synchronous handlers.Breaking changes?
None beyond the context changes in #3195.
Server PR
Not required.
Validation
Nexus tests: 173 passed, 15 skipped. Formatting, Javadoc, and
git diff --checkpassed.