Skip to content

Commit adecd33

Browse files
committed
Merge branch 'master' of github.com:temporalio/api into spk/signal-with-start
2 parents c3e6d26 + f224850 commit adecd33

17 files changed

Lines changed: 651 additions & 138 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nexus-rpc/nexus-rpc-gen/main/schemas/nexus-rpc-gen.json
2+
#
3+
# Nexus service definition for server-to-worker communication.
4+
# See request_response.proto for message definitions.
5+
#
6+
# Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key}
7+
8+
nexusrpc: 1.0.0
9+
10+
services:
11+
temporal.api.nexusservices.workerservice.v1.WorkerService:
12+
description: >
13+
Internal Nexus service for server-to-worker communication.
14+
Used by the Temporal server to send commands to workers.
15+
operations:
16+
ExecuteCommands:
17+
description: Executes worker commands sent by the server.
18+
input:
19+
$goRef: "go.temporal.io/api/nexusservices/workerservice/v1.ExecuteCommandsRequest"
20+
$javaRef: "io.temporal.api.nexusservices.workerservice.v1.ExecuteCommandsRequest"
21+
$pythonRef: "temporalio.api.nexusservices.workerservice.v1.ExecuteCommandsRequest"
22+
$typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.ExecuteCommandsRequest"
23+
$dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.ExecuteCommandsRequest"
24+
$rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::ExecuteCommandsRequest"
25+
output:
26+
$goRef: "go.temporal.io/api/nexusservices/workerservice/v1.ExecuteCommandsResponse"
27+
$javaRef: "io.temporal.api.nexusservices.workerservice.v1.ExecuteCommandsResponse"
28+
$pythonRef: "temporalio.api.nexusservices.workerservice.v1.ExecuteCommandsResponse"
29+
$typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.ExecuteCommandsResponse"
30+
$dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.ExecuteCommandsResponse"
31+
$rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::ExecuteCommandsResponse"
32+

openapi/openapiv2.json

Lines changed: 244 additions & 78 deletions
Large diffs are not rendered by default.

openapi/openapiv3.yaml

Lines changed: 151 additions & 31 deletions
Large diffs are not rendered by default.

temporal/api/activity/v1/message.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import "google/protobuf/timestamp.proto";
1515
import "temporal/api/common/v1/message.proto";
1616
import "temporal/api/deployment/v1/message.proto";
1717
import "temporal/api/enums/v1/activity.proto";
18+
import "temporal/api/callback/v1/message.proto";
1819
import "temporal/api/enums/v1/workflow.proto";
1920
import "temporal/api/failure/v1/message.proto";
2021
import "temporal/api/taskqueue/v1/message.proto";
@@ -161,6 +162,9 @@ message ActivityExecutionInfo {
161162

162163
// Set if activity cancelation was requested.
163164
string canceled_reason = 32;
165+
166+
// Links to related entities, such as the entity that started this activity.
167+
repeated temporal.api.common.v1.Link links = 33;
164168
}
165169

166170
// Limited activity information returned in the list response.
@@ -195,3 +199,20 @@ message ActivityExecutionListInfo {
195199
// This field is only populated if the activity is closed.
196200
google.protobuf.Duration execution_duration = 11;
197201
}
202+
203+
// CallbackInfo contains the state of an attached activity callback.
204+
message CallbackInfo {
205+
// Trigger for when the activity is closed.
206+
message ActivityClosed {}
207+
208+
message Trigger {
209+
oneof variant {
210+
ActivityClosed activity_closed = 1;
211+
}
212+
}
213+
214+
// Trigger for this callback.
215+
Trigger trigger = 1;
216+
// Common callback info.
217+
temporal.api.callback.v1.CallbackInfo info = 2;
218+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
package temporal.api.callback.v1;
4+
5+
option go_package = "go.temporal.io/api/callback/v1;callback";
6+
option java_package = "io.temporal.api.callback.v1";
7+
option java_multiple_files = true;
8+
option java_outer_classname = "MessageProto";
9+
option ruby_package = "Temporalio::Api::Callback::V1";
10+
option csharp_namespace = "Temporalio.Api.Callback.V1";
11+
12+
import "google/protobuf/timestamp.proto";
13+
14+
import "temporal/api/common/v1/message.proto";
15+
import "temporal/api/enums/v1/common.proto";
16+
import "temporal/api/failure/v1/message.proto";
17+
18+
// Common callback information. Specific CallbackInfo messages should embed this and may include additional fields.
19+
message CallbackInfo {
20+
// Information on how this callback should be invoked (e.g. its URL and type).
21+
temporal.api.common.v1.Callback callback = 1;
22+
// The time when the callback was registered.
23+
google.protobuf.Timestamp registration_time = 2;
24+
// The current state of the callback.
25+
temporal.api.enums.v1.CallbackState state = 3;
26+
// The number of attempts made to deliver the callback.
27+
// This number represents a minimum bound since the attempt is incremented after the callback request completes.
28+
int32 attempt = 4;
29+
// The time when the last attempt completed.
30+
google.protobuf.Timestamp last_attempt_complete_time = 5;
31+
// The last attempt's failure, if any.
32+
temporal.api.failure.v1.Failure last_attempt_failure = 6;
33+
// The time when the next attempt is scheduled.
34+
google.protobuf.Timestamp next_attempt_schedule_time = 7;
35+
// If the state is BLOCKED, blocked reason provides additional information.
36+
string blocked_reason = 8;
37+
}

temporal/api/common/v1/message.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,17 @@ message Link {
240240
string job_id = 1;
241241
}
242242

243+
// A link to an activity.
244+
message Activity {
245+
string namespace = 1;
246+
string activity_id = 2;
247+
string run_id = 3;
248+
}
249+
243250
oneof variant {
244251
WorkflowEvent workflow_event = 1;
245252
BatchJob batch_job = 2;
253+
Activity activity = 3;
246254
}
247255
}
248256

temporal/api/compute/v1/config.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import "temporal/api/enums/v1/task_queue.proto";
1515
import "google/protobuf/field_mask.proto";
1616

1717
message ComputeConfigScalingGroup {
18-
// Optional. The set of task queue types this scaling group serves.
18+
// Optional. The set of task queue types this scaling group serves.
1919
// If not provided, this scaling group serves all not otherwise defined
2020
// task types.
2121
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
@@ -34,7 +34,7 @@ message ComputeConfigScalingGroup {
3434
// events.
3535
message ComputeConfig {
3636

37-
// Each scaling group describes a compute config for a specific subset of the worker
37+
// Each scaling group describes a compute config for a specific subset of the worker
3838
// deployment version: covering a specific set of task types and/or regions.
3939
// Having different configurations for different task types, allows independent
4040
// tuning of activity and workflow task processing (for example).
@@ -56,3 +56,13 @@ message ComputeConfigScalingGroupUpdate {
5656
// "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details"
5757
google.protobuf.FieldMask update_mask = 2;
5858
}
59+
60+
// A subset of information in ComputeConfig optimized for list views.
61+
message ComputeConfigSummary {
62+
map<string, ComputeConfigScalingGroupSummary> scaling_groups = 1;
63+
}
64+
65+
message ComputeConfigScalingGroupSummary {
66+
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
67+
string provider_type = 2;
68+
}

temporal/api/deployment/v1/message.proto

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ option csharp_namespace = "Temporalio.Api.Deployment.V1";
1111

1212
import "google/protobuf/timestamp.proto";
1313

14+
import "temporal/api/enums/v1/workflow.proto";
1415
import "temporal/api/enums/v1/deployment.proto";
1516
import "temporal/api/enums/v1/task_queue.proto";
1617
import "temporal/api/common/v1/message.proto";
1718
import "temporal/api/compute/v1/config.proto";
1819

1920
// Worker Deployment options set in SDK that need to be sent to server in every poll.
20-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
2121
message WorkerDeploymentOptions {
2222
// Required when `worker_versioning_mode==VERSIONED`.
2323
string deployment_name = 1;
@@ -87,13 +87,12 @@ message DeploymentListInfo {
8787
}
8888

8989

90-
// A Worker Deployment Version (Version, for short) represents all workers of the same
91-
// code and config within a Deployment. Workers of the same Version are expected to
92-
// behave exactly the same so when executions move between them there are no
90+
// A Worker Deployment Version (Version, for short) represents all workers of the same
91+
// code and config within a Deployment. Workers of the same Version are expected to
92+
// behave exactly the same so when executions move between them there are no
9393
// non-determinism issues.
94-
// Worker Deployment Versions are created in Temporal server automatically when
94+
// Worker Deployment Versions are created in Temporal server automatically when
9595
// their first poller arrives to the server.
96-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
9796
message WorkerDeploymentVersionInfo {
9897
// Deprecated. Use `deployment_version`.
9998
string version = 1 [deprecated = true];
@@ -175,7 +174,6 @@ message WorkerDeploymentVersionInfo {
175174

176175
// Information about workflow drainage to help the user determine when it is safe
177176
// to decommission a Version. Not present while version is current or ramping.
178-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
179177
message VersionDrainageInfo {
180178
// Set to DRAINING when the version first stops accepting new executions (is no longer current or ramping).
181179
// Set to DRAINED when no more open pinned workflows exist on this version.
@@ -186,14 +184,13 @@ message VersionDrainageInfo {
186184
google.protobuf.Timestamp last_checked_time = 3;
187185
}
188186

189-
// A Worker Deployment (Deployment, for short) represents all workers serving
190-
// a shared set of Task Queues. Typically, a Deployment represents one service or
187+
// A Worker Deployment (Deployment, for short) represents all workers serving
188+
// a shared set of Task Queues. Typically, a Deployment represents one service or
191189
// application.
192-
// A Deployment contains multiple Deployment Versions, each representing a different
190+
// A Deployment contains multiple Deployment Versions, each representing a different
193191
// version of workers. (see documentation of WorkerDeploymentVersionInfo)
194192
// Deployment records are created in Temporal server automatically when their
195193
// first poller arrives to the server.
196-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
197194
message WorkerDeploymentInfo {
198195
// Identifies a Worker Deployment. Must be unique within the namespace.
199196
string name = 1;
@@ -257,6 +254,7 @@ message WorkerDeploymentInfo {
257254
// Timestamp when this version last stopped being current or ramping.
258255
// Cleared if the version becomes current or ramping again.
259256
google.protobuf.Timestamp last_deactivation_time = 10;
257+
temporal.api.compute.v1.ComputeConfigSummary compute_config = 13;
260258
}
261259
}
262260

@@ -317,11 +315,23 @@ message RoutingConfig {
317315
int64 revision_number = 10;
318316
}
319317

320-
// Used as part of WorkflowExecutionStartedEventAttributes to pass down the AutoUpgrade behavior and source deployment version
318+
// Used as part of WorkflowExecutionStartedEventAttributes to pass down the AutoUpgrade behavior and source deployment version
321319
// to a workflow execution whose parent/previous workflow has an AutoUpgrade behavior.
320+
// Also used for Upgrade-on-CaN behaviors AutoUpgrade and UseRampingVersion.
322321
message InheritedAutoUpgradeInfo {
323322
// The source deployment version of the parent/previous workflow.
324323
temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1;
325324
// The revision number of the source deployment version of the parent/previous workflow.
326325
int64 source_deployment_revision_number = 2;
326+
// Experimental.
327+
// If this workflow is the result of a continue-as-new, this field is set to the initial_versioning_behavior
328+
// specified in that command.
329+
// Only used for the initial task of this run and the initial task of any retries of this run.
330+
// Not passed to children or to future continue-as-new.
331+
//
332+
// Note: In the first release of Upgrade-on-CaN, when the only ContinueAsNewVersioningBehavior was AutoUpgrade,
333+
// a non-empty InheritedAutoUpgradeInfo meant that the workflow should start as AutoUpgrade. So for compatibility
334+
// with history events generated during that time, know that an UNSPECIFIED value here is equivalent to AutoUpgrade
335+
// value if the InheritedAutoUpgradeInfo is non-empty.
336+
temporal.api.enums.v1.ContinueAsNewVersioningBehavior continue_as_new_initial_versioning_behavior = 3;
327337
}

temporal/api/enums/v1/deployment.proto

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ enum DeploymentReachability {
3030
// aip.dev/not-precedent: Call this status because it is . --)
3131
// Specify the drainage status for a Worker Deployment Version so users can decide whether they
3232
// can safely decommission the version.
33-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
3433
enum VersionDrainageStatus {
3534
// Drainage Status is not specified.
3635
VERSION_DRAINAGE_STATUS_UNSPECIFIED = 0;
@@ -49,7 +48,6 @@ enum VersionDrainageStatus {
4948
// - Whether or not Temporal Server considers this worker's version (Build ID) when dispatching
5049
// tasks to it.
5150
// - Whether or not the workflows processed by this worker are versioned using the worker's version.
52-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
5351
enum WorkerVersioningMode {
5452
WORKER_VERSIONING_MODE_UNSPECIFIED = 0;
5553
// Workers with this mode are not distinguished from each other for task routing, even if they
@@ -76,7 +74,6 @@ enum WorkerVersioningMode {
7674
// (-- api-linter: core::0216::synonyms=disabled
7775
// aip.dev/not-precedent: Call this status because it is . --)
7876
// Specify the status of a Worker Deployment Version.
79-
// Experimental. Worker Deployments are experimental and might significantly change in the future.
8077
enum WorkerDeploymentVersionStatus {
8178
WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED = 0;
8279
// The Worker Deployment Version has been created inside the Worker Deployment but is not used by any

temporal/api/enums/v1/task_queue.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ enum TaskQueueKind {
3131
//
3232
// Sticky queues are only for workflow tasks. There are no sticky task queues for activities.
3333
TASK_QUEUE_KIND_STICKY = 2;
34+
// A worker-commands task queue is used for server-to-worker communication (e.g. activity
35+
// cancellations). These queues are ephemeral and per-worker-process — they exist only for
36+
// the lifetime of the worker process. Used with TASK_QUEUE_TYPE_NEXUS and polled via
37+
// PollNexusTaskQueue.
38+
TASK_QUEUE_KIND_WORKER_COMMANDS = 3;
3439
}
3540

3641
enum TaskQueueType {

0 commit comments

Comments
 (0)