Generic Temporal Nexus Operation Handler#690
Open
Quinn-With-Two-Ns wants to merge 4 commits into
Open
Conversation
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
Added a generic Nexus operation handler that consolidates the common pattern of "either return a synchronous
result or start a workflow as an async operation."
Why?
The existing
WorkflowRun/SyncOperationsplit forces users to pick the operation shape up front, which is awkward when:The new TemporalOperation unifies these cases behind one API and makes the common path much shorter.
Checklist
Closes
How was this tested:
Note
Medium Risk
Adds new Nexus operation handler and client APIs that affect workflow-start plumbing, token handling, and cancellation behavior; bugs could impact operation cancellation or link/callback propagation.
Overview
Introduces a new generic Temporal-backed Nexus operation handler (
TemporalNexusOperationHandler) that lets a start function return either a synchronous value or an async operation token viaTemporalOperationResult, and supports overridable cancel behavior for workflow-run tokens.Adds a Nexus-aware client (
ITemporalNexusClient/TemporalNexusClient) plusNexusWorkflowStartHelperto centralize workflow-start plumbing (task queue defaulting, conflict attach options, inbound/outbound links, completion callbacks, and token header injection).Refactors
NexusWorkflowRunHandletoken handling to exposeParseToken(validates base64url/JSON/version while leaving token-type enforcement to callers) and updatesWorkflowRunOperationContextto use the shared start helper. Expands tests to cover token encoding/parsing,TemporalOperationResult, and end-to-end worker behavior for the new handler (start-by-expression/name, sync results, links, conflict policy, and cancellation/overrides).Reviewed by Cursor Bugbot for commit 40094ad. Bugbot is set up for automated code reviews on this repo. Configure here.