Add Temporal Nexus Operation Handler#2842
Open
Quinn-With-Two-Ns wants to merge 9 commits into
Open
Conversation
a33ff01 to
7e61dab
Compare
| private final WorkflowClient client; | ||
| private final OperationContext operationContext; | ||
| private final OperationStartDetails operationStartDetails; | ||
| private boolean asyncOperationStarted; |
There was a problem hiding this comment.
Forgive my lack of Java concurrency know how, but could this flag cause a race if you call startWorkflow concurrently? Both attempt to start, race past the check and successfully start a workflow.
7e61dab to
f2c65fc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit f2c65fc. Configure here.
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.

Add TemporalOperationHandler for generic Nexus operations
Goal
Provide a new base to make it easy to expose more Temporal actions as Nexus Operations
Summary
Test plan
Note
Medium Risk
Adds new Nexus-to-Temporal dispatch APIs (start/cancel) and refactors workflow-start/link attachment logic, which could affect Nexus operation execution and cancellation paths. Behavior is guarded by new token validation and single-async-start enforcement but still touches core operation flow.
Overview
Adds an experimental
TemporalOperationHandlerthat maps Nexusstartto either a synchronous result or an async workflow-run token via a newTemporalNexusClient(typed/untypedstartWorkflowoverloads) andTemporalOperationResult.Refactors workflow-start behavior into
NexusStartWorkflowHelperso both the existingWorkflowRunOperationImpland the new client share the same request construction and workflow-link attachment logic, and enforces only one async start per handler invocation.Renames/expands operation-token handling (
WorkflowRunOperationToken->OperationToken) and updatesOperationTokenUtilto support type-agnostic token loading for cancel dispatch, with updated/added tests covering sync results, typed/untyped starts, double-start errors, and cancel behavior.Reviewed by Cursor Bugbot for commit d448f63. Bugbot is set up for automated code reviews on this repo. Configure here.