Add Standalone Activity support to Temporal Nexus Operation Handler#2381
Add Standalone Activity support to Temporal Nexus Operation Handler#2381Quinn-With-Two-Ns wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56fa028ede
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e5e966b to
f93653b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 2284fed. Configure here.
| args ...any, | ||
| ) (TemporalOperationResult[R], error) { | ||
| if nc.asyncStarted != nil && !nc.asyncStarted.CompareAndSwap(false, true) { | ||
| return TemporalOperationResult[R]{}, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "only one async operation can be started per operation invocation") |
There was a problem hiding this comment.
Maybe we should consider defining this error as a package var for re-use as we add more functionality to NexusClient?
There was a problem hiding this comment.
I made the message a var we can reuse, I couldn't do the whole error because it is mutable

What was changed
Add Standalone Activity support to Temporal Nexus Operation Handler
Why?
Allows starting Standalone Activities from Nexus Operation Handlers
Checklist
Closes
How was this tested:
Note
Medium Risk
Touches experimental Nexus/standalone-activity integration and extends the activity start RPC path with callbacks and conflict attachment; behavior depends on server features, with several integration checks gated or skipped until NEXUS-400.
Overview
Nexus operation handlers can now return async operations backed by stand-alone activities, parallel to the existing workflow-run path.
temporalnexus.StartActivity/StartUntypedActivityscheduleclient.ExecuteActivity, propagate Nexus request ID, completion callbacks, and links, attach on-conflict behavior forUSE_EXISTING, emit an activity-execution operation token (type 2), and add handler links from the start response.NewTemporalOperationgainsCancelActivityExecution(default: cancel via activity handle) and cancel routing by token type.The internal activity client wires RequestId, CompletionCallbacks, Links, OnConflictOptions, and captures StartActivityExecution.Link via SDK-only setters on
ClientStartActivityOptions.Link_Activityis supported in Nexus link conversion and inconvertNexusLinks.CI sets
DISABLE_ACTIVITY_BACKED_NEXUS_TESTSfor docker-compose integration runs. A dedicated integration suite covers success, cancel, failures, timeouts, retries, shared activity + dual callbacks, and orphaned completion when the caller workflow is terminated; some link and LastHeartbeatDetails assertions are skipped pending server work (NEXUS-400).Reviewed by Cursor Bugbot for commit e792df2. Bugbot is set up for automated code reviews on this repo. Configure here.