Skip to content

Add nexus handler callbacks for SANO - #1926

Draft
VegetarianOrc wants to merge 1 commit into
amazzeo/nexus-handler-callbacksfrom
amazzeo/nexus-handler-callbacks-client
Draft

VegetarianOrc wants to merge 1 commit into
amazzeo/nexus-handler-callbacksfrom
amazzeo/nexus-handler-callbacks-client

Conversation

@VegetarianOrc

@VegetarianOrc VegetarianOrc commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR currently depends on draft branch of nexus-rpc for the functionality described here: nexus-rpc/sdk-python#58.
Before merging, nexus-rpc will be released with proper version and this PR updated to use that.

What was changed

  • NexusClient.start_operation and NexusClient.execute_operation accept a new completion_callbacks argument.
  • The new function temporalio.nexus.create_completion_callback creates a CompletionCallback. It accepts a service name and an operation name, or an on-complete operation from a service definition or a handler method. It checks that the operation takes OnCompleteRequest as input and returns OnCompleteResponse.
  • Type checkers check that each callback accepts the output type of the operation. A handler that receives RawValue accepts the output of any operation.
  • The payload visitor visits the OnCompleteRequest and OnCompleteResponse messages of the notification service.
  • The CI workflow installs NexGen 0.2.7. The tests use the v1.9.2-nexus-handler-callbacks dev server.

Why

A caller of a standalone Nexus operation can now get the outcome of the operation in a Nexus handler. When the operation finishes, the server calls an on-complete operation on a worker for the task queue of the callback. The call contains the result or the failure, and the source context that the caller supplies.

Checklist

  1. How was this tested:
  • New tests deliver success, failure, cancellation and termination outcomes to on-complete handlers on a worker.
  • New type tests check the overloads of create_completion_callback.
  1. Any docs updates?

Yes, new docs will be added in support of the Nexus handler callbacks feature.

@VegetarianOrc
VegetarianOrc added this pull request to stack #1927 October 5, 2026 18:02
@VegetarianOrc
VegetarianOrc force-pushed the amazzeo/nexus-handler-callbacks-client branch from 7a3b590 to 48b8986 Compare October 5, 2026 18:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant