Skip to content

Commit 37ffb33

Browse files
Change nexus operation to execute-commands with WorkerCommandsRequest/Response
Renames the cancel-activities operation to a more general execute-commands operation that can support multiple command types. Updates proto structure to use nested WorkerCommand with oneof for extensibility. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 84c0bac commit 37ffb33

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

temporal/api/worker/v1/worker_nexus_service_commands.proto

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,34 @@ option csharp_namespace = "Temporalio.Api.Worker.V1";
3535
//
3636
// --)
3737

38-
// Request payload for the "cancel-activities" Nexus operation.
39-
message CancelActivitiesRequestPayload {
40-
// Task tokens identifying the activities to cancel.
41-
// Each token corresponds to a specific activity task that the worker received.
42-
repeated bytes task_tokens = 1;
38+
// Request payload for the "execute-commands" Nexus operation.
39+
message WorkerCommandsRequest {
40+
repeated WorkerCommand commands = 1;
41+
42+
message WorkerCommand {
43+
oneof type {
44+
CancelActivity cancel_activity = 1;
45+
}
46+
}
47+
48+
message CancelActivity {
49+
// Task token identifying the activity to cancel.
50+
bytes task_token = 1;
51+
}
4352
}
4453

45-
// Response payload for the "cancel-activities" Nexus operation.
46-
message CancelActivitiesResponsePayload {
47-
// Empty for now. Can be extended to include cancellation status per activity.
54+
// Response payload for the "execute-commands" Nexus operation.
55+
message WorkerCommandsResponse {
56+
repeated WorkerCommandResult results = 1;
57+
58+
message WorkerCommandResult {
59+
oneof type {
60+
CancelActivityResult cancel_activity = 1;
61+
}
62+
}
63+
64+
message CancelActivityResult {
65+
// Empty for now. Can be extended to include cancellation status.
66+
}
4867
}
4968

0 commit comments

Comments
 (0)