Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -12938,6 +12938,14 @@
"timeSkippingStatePropagation": {
"$ref": "#/definitions/v1TimeSkippingStatePropagation",
"description": "Experimental.\nTime-skipping state propagated by the execution that started this workflow.\nThis field is intended for use by the Temporal server, for example when a schedule\nstarts a workflow, and is not intended to be set by external clients."
},
"eagerWorkerControlTaskQueue": {
"type": "string",
"description": "Experimental. A dedicated per-worker Nexus task queue for control tasks sent to\nthe worker processing the eager Workflow Task. Used only when eager execution is accepted."
},
"eagerWorkerCapabilities": {
"$ref": "#/definitions/v1StartWorkflowExecutionRequestCapabilities",
"description": "Experimental. SDK capabilities of the worker processing the eager Workflow Task.\nUsed only when eager execution is accepted."
}
}
},
Expand Down Expand Up @@ -20272,6 +20280,15 @@
}
}
},
"v1StartWorkflowExecutionRequestCapabilities": {
"type": "object",
"properties": {
"supportsWorkflowHeartbeatNotification": {
"type": "boolean",
"description": "Experimental. Whether this worker supports Workflow heartbeat notifications."
}
}
},
"v1StartWorkflowExecutionResponse": {
"type": "object",
"properties": {
Expand Down
17 changes: 17 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17948,6 +17948,23 @@ components:
Time-skipping state propagated by the execution that started this workflow.
This field is intended for use by the Temporal server, for example when a schedule
starts a workflow, and is not intended to be set by external clients.
eagerWorkerControlTaskQueue:
type: string
description: |-
Experimental. A dedicated per-worker Nexus task queue for control tasks sent to
the worker processing the eager Workflow Task. Used only when eager execution is accepted.
eagerWorkerCapabilities:
allOf:
- $ref: '#/components/schemas/StartWorkflowExecutionRequest_Capabilities'
description: |-
Experimental. SDK capabilities of the worker processing the eager Workflow Task.
Used only when eager execution is accepted.
StartWorkflowExecutionRequest_Capabilities:
type: object
properties:
supportsWorkflowHeartbeatNotification:
type: boolean
description: Experimental. Whether this worker supports Workflow heartbeat notifications.
StartWorkflowExecutionResponse:
type: object
properties:
Expand Down
30 changes: 30 additions & 0 deletions temporal/api/worker/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option csharp_namespace = "Temporalio.Api.Worker.V1";

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "temporal/api/common/v1/message.proto";
import "temporal/api/deployment/v1/message.proto";
import "temporal/api/enums/v1/common.proto";

Expand Down Expand Up @@ -323,9 +324,18 @@ message EnvironmentInfo {
message WorkerCommand {
oneof type {
CancelActivityCommand cancel_activity = 1;
// Experimental. Request an early heartbeat of a running Workflow Task.
WorkflowHeartbeatNotificationCommand workflow_heartbeat_notification = 2;
}
}

// Experimental. Request an early heartbeat of the current Workflow Task.
message WorkflowHeartbeatNotificationCommand {
// The token of the Workflow Task returned to the worker.
bytes task_token = 1;
temporal.api.common.v1.WorkflowExecution execution = 2;
}

// Cancel an activity if it is still running. Otherwise, do nothing.
message CancelActivityCommand {
bytes task_token = 1;
Expand All @@ -335,9 +345,29 @@ message CancelActivityCommand {
message WorkerCommandResult {
oneof type {
CancelActivityResult cancel_activity = 1;
// Experimental. Result of a Workflow heartbeat notification.
WorkflowHeartbeatNotificationResult workflow_heartbeat_notification = 2;
}
}

// Experimental. Result of a WorkflowHeartbeatNotificationCommand.
// A successful result acknowledges the notification, not completion of a Workflow Task heartbeat.
message WorkflowHeartbeatNotificationResult {
enum Outcome {
OUTCOME_UNSPECIFIED = 0;
// The notification was accepted for the matching Workflow Task.
OUTCOME_ACCEPTED = 1;
// This notification is rejected because its token does not match the current Workflow Task or there is no current Workflow Task.
OUTCOME_TASK_TOKEN_MISMATCH = 2;
}

// The SDK's result for this notification.
Outcome outcome = 1;
// The token of the Workflow Task currently held for the command's Workflow Execution, if any.
// This field may be empty when outcome is OUTCOME_ACCEPTED.
bytes current_task_token = 2;
Comment on lines +366 to +368

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should say this can be blank when replying w/ ACCEPTED.

Other than that maybe we want to make it repeated if we do buffer later, just to make wire-compat easy? I'd be fine either way though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually I suppose the better thing to do here is just have this all be a oneof with variants for the outcomes. Not a huge deal but might as well. Sorry I didn't say that straight away.

}

// Result of a CancelActivityCommand.
// Treat both successful cancellation and no-op (activity is no longer running) as success.
message CancelActivityResult {
Expand Down
19 changes: 19 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@ message StartWorkflowExecutionRequest {
// This field is intended for use by the Temporal server, for example when a schedule
// starts a workflow, and is not intended to be set by external clients.
temporal.api.common.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 31;

// Experimental. A dedicated per-worker Nexus task queue for control tasks sent to
// the worker processing the eager Workflow Task. Used only when eager execution is accepted.
string eager_worker_control_task_queue = 32;
// Experimental. SDK capabilities of the worker processing the eager Workflow Task.
// Used only when eager execution is accepted.
Capabilities eager_worker_capabilities = 33;

message Capabilities {
// Experimental. Whether this worker supports Workflow heartbeat notifications.
bool supports_workflow_heartbeat_notification = 1;
}
}

message StartWorkflowExecutionResponse {
Expand Down Expand Up @@ -310,6 +322,13 @@ message PollWorkflowTaskQueueRequest {
// A dedicated per-worker Nexus task queue on which the server sends control
// tasks (e.g. activity cancellation) to this specific worker instance.
string worker_control_task_queue = 9;
// SDK capabilities of the worker making this poll.
Capabilities capabilities = 12;

message Capabilities {
// Experimental. Whether this worker supports Workflow heartbeat notifications.
bool supports_workflow_heartbeat_notification = 1;
}

// Deprecated. Use deployment_options instead.
// Each worker process should provide an ID unique to the specific set of code it is running
Expand Down
Loading