Support Worker-variant callbacks - #11589
Open
chrsmith wants to merge 3 commits into
Open
Conversation
Contributor
|
Claude finished @chrsmith's task in 8m 48s —— View job Reviewed 20 files, 3 findings. |
chrsmith
force-pushed
the
chrsmith/wc-support-worker-variant-callbacks
branch
from
August 14, 2026 23:13
9e161f5 to
5719f95
Compare
chrsmith
commented
Aug 17, 2026
| Operation: n.callback.GetOperation(), | ||
| RequestId: n.requestID, | ||
| Payload: input, | ||
| // TODO(chrsmith): We need to map these links to a NexusOperationCallback, and not a NexusOperation. |
Contributor
Author
There was a problem hiding this comment.
I looked into adding this as another commit to this PR, but it was an involved enough yak shave I'll save it for a new PR in the stack. (It requires some proto changes from the api package, as well as wiring through from all the execution types that register completion callbacks.)
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.
feature/worker-callbacks. This will not go directly intomain, until the overall feature is code complete.What changed?
THIS IS IT! The actual PR that implements Worker callbacks!
This PR provides the implementation of the Worker-variant callback in the CHASM Callback component. A Worker-variant completion callback attached to a Workflow, Workflow Update, standalone Activity, or standalone Nexus Operation will result in a Nexus operation being invoked within the same namespace.
Additional changes/refactorings
The
CallbackInfo.BlockedReasonis now properly set. Previously it was left unimplemented in CHASM, and only callbacks attached to Workflows would report their status. We now wire through adestinationBlocked DestinationBlockedFnwith the CHASM context for Callbacks, and inject it viaCallbackDestinationBlockedProviderinservice/history/fx.go.Quirks/issues
We deliver all completion callbacks using the same request ID. This means however, that if multiple completion callbacks to the same (task queue, service, operation) were added in the same request (e.g. to
StartNexusOperationExecution.) then all of the worker callback invocations would carry the same request ID. The Nexus handler could interpret subsequent calls as duplicates and ignore them.This is something we can fix, by persisting a little more information in
CallbackStatebut it didn't seem like a realistic scenario; attaching multiple worker callbacks, in the same request, to the same taskqueue/operation.Why?
This is the new worker callbacks feature that will make developing "Nexus Connectors" (AKA fronting a Nexus service by a different API protocol) easier.
How did you test it?
Potential risks
While behind configuration flags, it's possible to attach a Worker-variant callback to Workflows, Workflow Updates, standalone Activities, and standalone Nexus Operations. In all cases they should behave the exact same. But there is opportunity for some subtle difference to cause problems.
NOTE: Worker-variant callbacks are NOT supported for HSM-backed workflows. Attaching a Worker callback to an HSM workflow will fail in glorious ways.