Skip to content

Add Nexus worker service for server-to-worker commands#708

Merged
rkannan82 merged 12 commits intomasterfrom
kannan/activity-cancel
Apr 7, 2026
Merged

Add Nexus worker service for server-to-worker commands#708
rkannan82 merged 12 commits intomasterfrom
kannan/activity-cancel

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Feb 3, 2026

Summary

Defines a Nexus service for server-to-worker communication, starting with activity cancellation support.

Design Decision

We chose a generic command API (ExecuteCommandsRequest with oneof command types) instead of a cancel-specific API. This allows a future optimization to batch multiple commands (cancel, pause, etc) in a single request and deliver to a worker in one RPC.

Files

  • temporal/api/nexusservices/workerservice/v1/request_response.proto - request response definitions
  • nexus-rpc/temporal-proto-models-nexusrpc.yaml - Nexus service definition

Related

@rkannan82 rkannan82 requested review from a team as code owners February 3, 2026 21:30
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch 3 times, most recently from 4b2e0d1 to 54edb8e Compare February 3, 2026 21:42
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch 2 times, most recently from afb40a2 to b920471 Compare February 4, 2026 05:43
@rkannan82 rkannan82 changed the title Add API to send control tasks from server to worker Add Nexus request and response payloads to cancel activities Feb 4, 2026
@rkannan82 rkannan82 requested a review from cretz February 4, 2026 05:50
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch from b920471 to 84c0bac Compare February 4, 2026 05:51
@rkannan82 rkannan82 marked this pull request as draft February 4, 2026 05:55
@rkannan82 rkannan82 removed the request for review from ShahabT February 5, 2026 18:05
Copy link
Copy Markdown
Contributor

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM, though would want to see end-to-end working including in an SDK if possible before approving

@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch from 84c0bac to 28ea1dd Compare February 11, 2026 21:20
@rkannan82 rkannan82 changed the base branch from master to kannan/add-worker-instance-key-to-wft-complete February 11, 2026 21:23
@rkannan82 rkannan82 requested review from bergundy and cretz February 12, 2026 18:56
@rkannan82 rkannan82 marked this pull request as ready for review February 12, 2026 19:39
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch from 7d3bfb7 to e0d0049 Compare February 12, 2026 19:43
This enables the server to track which worker is executing eager-dispatched
activities, allowing activity cancellation to be routed correctly.
@rkannan82 rkannan82 force-pushed the kannan/add-worker-instance-key-to-wft-complete branch from 61952c9 to 98350a9 Compare February 12, 2026 19:46
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch from e0d0049 to 6c21af4 Compare February 12, 2026 19:47
Copy link
Copy Markdown
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

LGTM, don't merge this until you've generated the code and verified that this API works across SDK and server.

There will probably be a separate code generation project that will construct the YAML from protos to prevent the need to define services in separate places but this is a good start IMHO.

Copy link
Copy Markdown
Contributor

@cretz cretz left a comment

Choose a reason for hiding this comment

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

This is our first Nexus service, so lots of things undecided. I added comments, but would like to hear others' opinions.

@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch 2 times, most recently from 37ffb33 to 6c21af4 Compare February 27, 2026 22:19
@rkannan82 rkannan82 changed the title Add Nexus request and response payloads to cancel activities Add Nexus worker service for server-to-worker commands Feb 27, 2026
@rkannan82 rkannan82 requested a review from bergundy February 27, 2026 22:56
@rkannan82 rkannan82 force-pushed the kannan/activity-cancel branch from 32523fb to cfff488 Compare March 13, 2026 18:09
- Rename WorkerCommandsRequest/Response to ExecuteCommandsRequest/Response
  to match the operation name (bergundy feedback)
- Change operation name from executeCommands to ExecuteCommands (PascalCase)
- Add doc: results list must be 1:1 with commands list (Sushisource feedback)

Made-with: Cursor
Move WorkerCommand, CancelActivityCommand, WorkerCommandResult, and
CancelActivityResult to temporal.api.worker.v1 as top-level messages.
request_response.proto now only contains ExecuteCommandsRequest and
ExecuteCommandsResponse, following the repo convention. (bergundy feedback)

Made-with: Cursor
@rkannan82 rkannan82 requested a review from bergundy April 6, 2026 17:12
Copy link
Copy Markdown
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Looking good to me

Copy link
Copy Markdown
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Just one comment on the location of the schema file.

Base automatically changed from kannan/add-worker-instance-key-to-wft-complete to master April 6, 2026 23:06
rkannan82 and others added 3 commits April 6, 2026 16:14
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removed comment about service definition in request_response.proto.
@rkannan82 rkannan82 merged commit 43b4618 into master Apr 7, 2026
4 checks passed
@rkannan82 rkannan82 deleted the kannan/activity-cancel branch April 7, 2026 19:04
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.

5 participants