Skip to content

Add dynamic Temporal Nexus operation - #2144

Open
long-nt-tran wants to merge 1 commit into
temporalio:mainfrom
long-nt-tran:dynamic-nexus-operations
Open

long-nt-tran wants to merge 1 commit into
temporalio:mainfrom
long-nt-tran:dynamic-nexus-operations

Conversation

@long-nt-tran

@long-nt-tran long-nt-tran commented Nov 18, 2026 •

Copy link
Copy Markdown

What was changed

Adds dynamic: bool = False to the @temporal_operation(...) decorator. This allows users to annotate 1 Nexus operation handler as a catch-all that would handle unknown operation names dispatched to their Nexus service.

Similar to temporalio/sdk-go#2906

Why?

Adding dynamic handler allows users to configure a fallback when an unknown operation arrives to a Nexus service.

The reason for building this feature now is to help build a Nexus outbound MCP connector. Namely, a Nexus service that dynamically dispatches to an upstream MCP server via tool calling -- i.e., the user can call a tool using a named Nexus operation handler and the Nexus service uses a dynamic handler to dispatch to the right tool upstream, based on the operation name.

Checklist

  1. Closes: N/A

  2. How was this tested: Added new tests

  3. Any docs updates needed? Yes, will update docs.temporal.io after this PR

Note

Right now the nexus-rpc/sdk-python is pinned to nexus-rpc/sdk-python#70 in the pyproject.toml and uv.lock. These will be removed once nexus-rpc/sdk-python#70 lands, and I will not land this PR until nexus-rpc/sdk-python#70 lands.

@CLAassistant

CLAassistant commented Nov 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@long-nt-tran long-nt-tran left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failures due to my custom pins, see PR description NOTE section.

Will wait for nexus-rpc/sdk-python#70 to land to remove the custom pins and will not land this before that PR. Opening it now to get the feature shape reviewed first.

Comment thread pyproject.toml
keywords = ["temporal", "workflow"]
dependencies = [
"nexus-rpc==1.5.0",
"nexus-rpc @ git+https://github.com/long-nt-tran/nexus-rpc-sdk-python.git@c88388fa0b0ddac441c3b9dc18cb5919c5f1fd96",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be corrected to an upstream version once nexus-rpc/sdk-python#70 lands

Comment thread uv.lock
Comment on lines 2915 to -4610
@@ -4607,7 +4603,7 @@ requires-dist = [
{ name = "aioboto3", marker = "extra == 'aioboto3'", specifier = ">=10.4.0" },
{ name = "gcloud-aio-storage", marker = "extra == 'gcloud-aio-storage'", specifier = ">=9.6.4,<10" },
{ name = "grpcio", marker = "extra == 'grpc'", specifier = ">=1.49.1,<2" },
{ name = "nexus-rpc", specifier = "==1.5.0" },

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes will be reverted and nexus-rpc will point to an upstream version once nexus-rpc/sdk-python#70 lands

@long-nt-tran
long-nt-tran requested a review from a team November 18, 2026 22:30
@long-nt-tran
long-nt-tran marked this pull request as ready for review November 18, 2026 22:30
@long-nt-tran
long-nt-tran requested a review from a team as a code owner November 18, 2026 22:30

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.

3 participants