@temporalio/core-bridge 1.12.2 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +3 -3
  2. package/releases/aarch64-apple-darwin/index.node +0 -0
  3. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  4. package/releases/x86_64-apple-darwin/index.node +0 -0
  5. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  6. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  7. package/sdk-core/.cargo/config.toml +1 -1
  8. package/sdk-core/client/src/callback_based.rs +123 -0
  9. package/sdk-core/client/src/lib.rs +96 -28
  10. package/sdk-core/client/src/metrics.rs +33 -5
  11. package/sdk-core/client/src/raw.rs +40 -1
  12. package/sdk-core/client/src/retry.rs +12 -3
  13. package/sdk-core/core/src/lib.rs +4 -2
  14. package/sdk-core/core/src/pollers/poll_buffer.rs +62 -14
  15. package/sdk-core/core/src/worker/client.rs +9 -5
  16. package/sdk-core/core/src/worker/heartbeat.rs +3 -1
  17. package/sdk-core/core-api/src/worker.rs +2 -2
  18. package/sdk-core/core-c-bridge/Cargo.toml +2 -0
  19. package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +105 -0
  20. package/sdk-core/core-c-bridge/src/client.rs +265 -8
  21. package/sdk-core/core-c-bridge/src/tests/context.rs +11 -0
  22. package/sdk-core/core-c-bridge/src/tests/mod.rs +179 -3
  23. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/CODEOWNERS +1 -1
  24. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/README.md +1 -1
  25. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -1
  26. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.yaml +1 -0
  27. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +83 -0
  28. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +37 -0
  29. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +64 -0
  30. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +3 -1
  31. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +10 -0
  32. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +1 -0
  33. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +644 -9
  34. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +635 -21
  35. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +60 -2
  36. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +84 -15
  37. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +3 -0
  38. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +11 -0
  39. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +5 -0
  40. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +1 -1
  41. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +36 -0
  42. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +29 -0
  43. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/worker/v1/message.proto +11 -1
  44. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +122 -4
  45. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +41 -0
  46. package/sdk-core/sdk-core-protos/src/lib.rs +5 -1
  47. package/sdk-core/test-utils/Cargo.toml +1 -0
  48. package/sdk-core/test-utils/src/lib.rs +90 -3
  49. package/sdk-core/tests/cloud_tests.rs +11 -74
  50. package/sdk-core/tests/integ_tests/client_tests.rs +14 -10
  51. package/sdk-core/tests/integ_tests/worker_tests.rs +8 -2
  52. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +13 -0
  53. package/sdk-core/tests/integ_tests/workflow_tests/priority.rs +2 -108
  54. package/sdk-core/tests/main.rs +3 -0
  55. package/sdk-core/tests/shared_tests/mod.rs +43 -0
  56. package/sdk-core/tests/shared_tests/priority.rs +155 -0
  57. package/src/client.rs +5 -0
@@ -12,6 +12,7 @@ option csharp_namespace = "Temporalio.Api.Batch.V1";
12
12
  import "google/protobuf/duration.proto";
13
13
  import "google/protobuf/field_mask.proto";
14
14
  import "google/protobuf/timestamp.proto";
15
+ import "temporal/api/activity/v1/message.proto";
15
16
  import "temporal/api/common/v1/message.proto";
16
17
  import "temporal/api/enums/v1/batch_operation.proto";
17
18
  import "temporal/api/enums/v1/reset.proto";
@@ -112,10 +113,10 @@ message BatchOperationUnpauseActivities {
112
113
  bool match_all = 3;
113
114
  }
114
115
 
115
- // Providing this flag will also reset the number of attempts.
116
+ // Setting this flag will also reset the number of attempts.
116
117
  bool reset_attempts = 4;
117
118
 
118
- // Providing this flag will also reset the heartbeat details.
119
+ // Setting this flag will also reset the heartbeat details.
119
120
  bool reset_heartbeat = 5;
120
121
 
121
122
  // If set, the activity will start at a random time within the specified jitter
@@ -135,3 +136,60 @@ message BatchOperationTriggerWorkflowRule {
135
136
  temporal.api.rules.v1.WorkflowRuleSpec spec = 3;
136
137
  }
137
138
  }
139
+
140
+ // BatchOperationResetActivities sends activity reset requests in a batch.
141
+ // NOTE: keep in sync with temporal.api.workflowservice.v1.ResetActivityRequest
142
+ message BatchOperationResetActivities {
143
+ // The identity of the worker/client.
144
+ string identity = 1;
145
+
146
+ // The activities to reset. If match_all is set to true, all activities will be reset.
147
+ oneof activity {
148
+ string type = 2;
149
+ bool match_all = 3;
150
+ }
151
+
152
+ // Setting this flag will also reset the number of attempts.
153
+ bool reset_attempts = 4;
154
+
155
+ // Setting this flag will also reset the heartbeat details.
156
+ bool reset_heartbeat = 5;
157
+
158
+ // If activity is paused, it will remain paused after reset
159
+ bool keep_paused = 6;
160
+
161
+ // If set, the activity will start at a random time within the specified jitter
162
+ // duration, introducing variability to the start time.
163
+ google.protobuf.Duration jitter = 7;
164
+
165
+ // If set, the activity options will be restored to the defaults.
166
+ // Default options are then options activity was created with.
167
+ // They are part of the first ActivityTaskScheduled event.
168
+ bool restore_original_options = 8;
169
+ }
170
+
171
+ // BatchOperationUpdateActivityOptions sends an update-activity-options requests in a batch.
172
+ // NOTE: keep in sync with temporal.api.workflowservice.v1.UpdateActivityRequest
173
+ message BatchOperationUpdateActivityOptions {
174
+ // The identity of the worker/client.
175
+ string identity = 1;
176
+
177
+ // The activity to update. If match_all is set to true, all activities will be updated.
178
+ oneof activity {
179
+ string type = 2;
180
+ bool match_all = 3;
181
+ }
182
+
183
+ // Update Activity options. Partial updates are accepted and controlled by update_mask.
184
+ temporal.api.activity.v1.ActivityOptions activity_options = 4;
185
+
186
+ // Controls which fields from `activity_options` will be applied
187
+ google.protobuf.FieldMask update_mask = 5;
188
+
189
+ // If set, the activity options will be restored to the default.
190
+ // Default options are then options activity was created with.
191
+ // They are part of the first ActivityTaskScheduled event.
192
+ // This flag cannot be combined with any other option; if you supply
193
+ // restore_original together with other options, the request will be rejected.
194
+ bool restore_original = 6;
195
+ }
@@ -239,24 +239,37 @@ message Link {
239
239
  }
240
240
 
241
241
  // Priority contains metadata that controls relative ordering of task processing
242
- // when tasks are backlogged in a queue. Initially, Priority will be used in
243
- // activity and workflow task queues, which are typically where backlogs exist.
244
- // Other queues in the server (such as transfer and timer queues) and rate
245
- // limiting decisions do not use Priority, but may in the future.
242
+ // when tasks are backed up in a queue. Initially, Priority will be used in
243
+ // matching (workflow and activity) task queues. Later it may be used in history
244
+ // task queues and in rate limiting decisions.
246
245
  //
247
- // Priority is attached to workflows and activities. Activities and child
248
- // workflows inherit Priority from the workflow that created them, but may
249
- // override fields when they are started or modified. For each field of a
250
- // Priority on an activity/workflow, not present or equal to zero/empty string
251
- // means to inherit the value from the calling workflow, or if there is no
252
- // calling workflow, then use the default (documented below).
246
+ // Priority is attached to workflows and activities. By default, activities
247
+ // inherit Priority from the workflow that created them, but may override fields
248
+ // when an activity is started or modified.
253
249
  //
254
- // Despite being named "Priority", this message will also contains fields that
250
+ // Despite being named "Priority", this message also contains fields that
255
251
  // control "fairness" mechanisms.
256
252
  //
253
+ // For all fields, the field not present or equal to zero/empty string means to
254
+ // inherit the value from the calling workflow, or if there is no calling
255
+ // workflow, then use the default value.
256
+ //
257
+ // For all fields other than fairness_key, the zero value isn't meaningful so
258
+ // there's no confusion between inherit/default and a meaningful value. For
259
+ // fairness_key, the empty string will be interpreted as "inherit". This means
260
+ // that if a workflow has a non-empty fairness key, you can't override the
261
+ // fairness key of its activity to the empty string.
262
+ //
257
263
  // The overall semantics of Priority are:
258
- // 1. First, consider "priority_key": lower number goes first.
259
- // (more will be added here later)
264
+ // 1. First, consider "priority": higher priority (lower number) goes first.
265
+ // 2. Then, consider fairness: try to dispatch tasks for different fairness keys
266
+ // in proportion to their weight.
267
+ //
268
+ // Applications may use any subset of mechanisms that are useful to them and
269
+ // leave the other fields to use default values.
270
+ //
271
+ // Not all queues in the system may support the "full" semantics of all priority
272
+ // fields. (Currently only support in matching task queues is planned.)
260
273
  message Priority {
261
274
  // Priority key is a positive integer from 1 to n, where smaller integers
262
275
  // correspond to higher priorities (tasks run sooner). In general, tasks in
@@ -266,7 +279,63 @@ message Priority {
266
279
  // The maximum priority value (minimum priority) is determined by server
267
280
  // configuration, and defaults to 5.
268
281
  //
269
- // The default priority is (min+max)/2. With the default max of 5 and min of
270
- // 1, that comes out to 3.
282
+ // If priority is not present (or zero), then the effective priority will be
283
+ // the default priority, which is is calculated by (min+max)/2. With the
284
+ // default max of 5, and min of 1, that comes out to 3.
271
285
  int32 priority_key = 1;
286
+
287
+ // Fairness key is a short string that's used as a key for a fairness
288
+ // balancing mechanism. It may correspond to a tenant id, or to a fixed
289
+ // string like "high" or "low". The default is the empty string.
290
+ //
291
+ // The fairness mechanism attempts to dispatch tasks for a given key in
292
+ // proportion to its weight. For example, using a thousand distinct tenant
293
+ // ids, each with a weight of 1.0 (the default) will result in each tenant
294
+ // getting a roughly equal share of task dispatch throughput.
295
+ //
296
+ // (Note: this does not imply equal share of worker capacity! Fairness
297
+ // decisions are made based on queue statistics, not
298
+ // current worker load.)
299
+ //
300
+ // As another example, using keys "high" and "low" with weight 9.0 and 1.0
301
+ // respectively will prefer dispatching "high" tasks over "low" tasks at a
302
+ // 9:1 ratio, while allowing either key to use all worker capacity if the
303
+ // other is not present.
304
+ //
305
+ // All fairness mechanisms, including rate limits, are best-effort and
306
+ // probabilistic. The results may not match what a "perfect" algorithm with
307
+ // infinite resources would produce. The more unique keys are used, the less
308
+ // accurate the results will be.
309
+ //
310
+ // Fairness keys are limited to 64 bytes.
311
+ string fairness_key = 2;
312
+
313
+ // Fairness weight for a task can come from multiple sources for
314
+ // flexibility. From highest to lowest precedence:
315
+ // 1. Weights for a small set of keys can be overridden in task queue
316
+ // configuration with an API.
317
+ // 2. It can be attached to the workflow/activity in this field.
318
+ // 3. The default weight of 1.0 will be used.
319
+ //
320
+ // Weight values are clamped to the range [0.001, 1000].
321
+ float fairness_weight = 3;
272
322
  }
323
+
324
+ // This is used to send commands to a specific worker or a group of workers.
325
+ // Right now, it is used to send commands to a specific worker instance.
326
+ // Will be extended to be able to send command to multiple workers.
327
+ message WorkerSelector {
328
+ // Options are:
329
+ // - query (will be used as query to ListWorkers, same format as in ListWorkersRequest.query)
330
+ // - task queue (just a shortcut. Same as query=' "TaskQueue"="my-task-queue" ')
331
+ // - etc.
332
+ // All but 'query' are shortcuts, can be replaced with a query, but it is not convenient.
333
+ // string query = 5;
334
+ // string task_queue = 6;
335
+ // ...
336
+ oneof selector {
337
+ // Worker instance key to which the command should be sent.
338
+ string worker_instance_key = 1;
339
+ }
340
+ }
341
+
@@ -17,6 +17,9 @@ enum BatchOperationType {
17
17
  BATCH_OPERATION_TYPE_DELETE = 4;
18
18
  BATCH_OPERATION_TYPE_RESET = 5;
19
19
  BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS = 6;
20
+ BATCH_OPERATION_TYPE_UNPAUSE_ACTIVITY = 7;
21
+ BATCH_OPERATION_TYPE_UPDATE_ACTIVITY_OPTIONS = 8;
22
+ BATCH_OPERATION_TYPE_RESET_ACTIVITY = 9;
20
23
  }
21
24
 
22
25
  enum BatchOperationState {
@@ -89,3 +89,14 @@ enum DescribeTaskQueueMode {
89
89
  // Enhanced mode reports aggregated results for all partitions, supports Build IDs, and reports richer info.
90
90
  DESCRIBE_TASK_QUEUE_MODE_ENHANCED = 1;
91
91
  }
92
+
93
+ // Source for the effective rate limit.
94
+ enum RateLimitSource {
95
+ RATE_LIMIT_SOURCE_UNSPECIFIED = 0;
96
+ // The value was set by the API.
97
+ RATE_LIMIT_SOURCE_API = 1;
98
+ // The value was set by a worker.
99
+ RATE_LIMIT_SOURCE_WORKER = 2;
100
+ // The value was set as the system default.
101
+ RATE_LIMIT_SOURCE_SYSTEM = 3;
102
+ }
@@ -151,6 +151,11 @@ message WorkflowExecutionStartedEventAttributes {
151
151
  // Pinned override is inherited if Task Queue of new run is compatible with the override version.
152
152
  // Override is inherited separately and takes precedence over inherited base version.
153
153
  temporal.api.deployment.v1.WorkerDeploymentVersion inherited_pinned_version = 37;
154
+
155
+ // A boolean indicating whether the SDK has asked to eagerly execute the first workflow task for this workflow and
156
+ // eager execution was accepted by the server.
157
+ // Only populated by server with version >= 1.29.0.
158
+ bool eager_execution_accepted = 38;
154
159
  }
155
160
 
156
161
  message WorkflowExecutionCompletedEventAttributes {
@@ -51,4 +51,4 @@ message WorkflowTaskCompletedMetadata {
51
51
  // usually the same as client-version gRPC header. This should only be set if its value changed
52
52
  // since the last time recorded on the workflow (or be set on the first task).
53
53
  string sdk_version = 4;
54
- }
54
+ }
@@ -0,0 +1,36 @@
1
+ syntax = "proto3";
2
+
3
+ package temporal.api.sdk.v1;
4
+
5
+ option go_package = "go.temporal.io/api/sdk/v1;sdk";
6
+ option java_package = "io.temporal.api.sdk.v1";
7
+ option java_multiple_files = true;
8
+ option java_outer_classname = "WorkerConfigProto";
9
+ option ruby_package = "Temporalio::Api::Sdk::V1";
10
+ option csharp_namespace = "Temporalio.Api.Sdk.V1";
11
+
12
+ message WorkerConfig {
13
+ message SimplePollerBehavior {
14
+ int32 max_pollers = 1;
15
+ }
16
+
17
+ message AutoscalingPollerBehavior {
18
+ // At least this many poll calls will always be attempted (assuming slots are available).
19
+ // Cannot be zero.
20
+ int32 min_pollers = 1;
21
+
22
+ // At most this many poll calls will ever be open at once. Must be >= `minimum`.
23
+ int32 max_pollers = 2;
24
+
25
+ // This many polls will be attempted initially before scaling kicks in. Must be between
26
+ // `minimum` and `maximum`.
27
+ int32 initial_pollers = 3;
28
+ }
29
+
30
+ int32 workflow_cache_size = 1;
31
+
32
+ oneof poller_behavior {
33
+ SimplePollerBehavior simple_poller_behavior = 2;
34
+ AutoscalingPollerBehavior autoscaling_poller_behavior = 3;
35
+ }
36
+ }
@@ -315,3 +315,32 @@ message PollerScalingDecision {
315
315
  // all slots are already occupied.
316
316
  int32 poll_request_delta_suggestion = 1;
317
317
  }
318
+
319
+ message RateLimit {
320
+ // Zero is a valid rate limit.
321
+ float requests_per_second = 1;
322
+ }
323
+
324
+ message ConfigMetadata {
325
+ // Reason for why the config was set.
326
+ string reason = 1;
327
+
328
+ // Identity of the last updater.
329
+ // Set by the request's identity field.
330
+ string update_identity = 2;
331
+
332
+ // Time of the last update.
333
+ google.protobuf.Timestamp update_time = 3;
334
+ }
335
+
336
+ message RateLimitConfig {
337
+ RateLimit rate_limit = 1;
338
+ ConfigMetadata metadata = 2;
339
+ }
340
+
341
+ message TaskQueueConfig {
342
+ // Unless modified, this is the system-defined rate limit.
343
+ RateLimitConfig queue_rate_limit = 1;
344
+ // If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key.
345
+ RateLimitConfig fairness_keys_rate_limit_default = 2;
346
+ }
@@ -127,8 +127,18 @@ message WorkerHeartbeat {
127
127
  int32 total_sticky_cache_miss = 21;
128
128
  // Current cache size, expressed in number of Workflow Executions.
129
129
  int32 current_sticky_cache_size = 22;
130
+
131
+ // Plugins currently in use by this SDK.
132
+ repeated PluginInfo plugins = 23;
130
133
  }
131
134
 
132
135
  message WorkerInfo {
133
136
  WorkerHeartbeat worker_heartbeat = 1;
134
- }
137
+ }
138
+
139
+ message PluginInfo {
140
+ // The name of the plugin, required.
141
+ string name = 1;
142
+ // The version of the plugin, may be empty.
143
+ string version = 2;
144
+ }
@@ -32,6 +32,7 @@ import "temporal/api/namespace/v1/message.proto";
32
32
  import "temporal/api/query/v1/message.proto";
33
33
  import "temporal/api/replication/v1/message.proto";
34
34
  import "temporal/api/rules/v1/message.proto";
35
+ import "temporal/api/sdk/v1/worker_config.proto";
35
36
  import "temporal/api/schedule/v1/message.proto";
36
37
  import "temporal/api/taskqueue/v1/message.proto";
37
38
  import "temporal/api/update/v1/message.proto";
@@ -1058,6 +1059,9 @@ message DescribeTaskQueueRequest {
1058
1059
  // Report stats for the requested task queue type(s).
1059
1060
  bool report_stats = 8;
1060
1061
 
1062
+ // Report Task Queue Config
1063
+ bool report_config = 11;
1064
+
1061
1065
  // Deprecated, use `report_stats` instead.
1062
1066
  // If true, the task queue status will be included in the response.
1063
1067
  bool include_task_queue_status = 4 [deprecated = true];
@@ -1091,9 +1095,16 @@ message DescribeTaskQueueRequest {
1091
1095
  message DescribeTaskQueueResponse {
1092
1096
  repeated temporal.api.taskqueue.v1.PollerInfo pollers = 1;
1093
1097
 
1094
- // Statistics for the task queue. Only populated when `report_stats` is set to true in the request.
1098
+ // Statistics for the task queue.
1099
+ // Only set if `report_stats` is set on the request.
1095
1100
  temporal.api.taskqueue.v1.TaskQueueStats stats = 5;
1096
1101
 
1102
+ // Task queue stats breakdown by priority key. Only contains actively used priority keys.
1103
+ // Only set if `report_stats` is set on the request.
1104
+ // (-- api-linter: core::0140::prepositions=disabled
1105
+ // aip.dev/not-precedent: "by" is used to clarify the keys and values. --)
1106
+ map<int32, temporal.api.taskqueue.v1.TaskQueueStats> stats_by_priority_key = 8;
1107
+
1097
1108
  // Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to.
1098
1109
  // When not present, it means the tasks are routed to Unversioned workers (workers with
1099
1110
  // UNVERSIONED or unspecified WorkerVersioningMode.)
@@ -1105,6 +1116,22 @@ message DescribeTaskQueueResponse {
1105
1116
  // a Pinned VersioningOverride or are Child Workflows of a Pinned parent).
1106
1117
  temporal.api.taskqueue.v1.TaskQueueVersioningInfo versioning_info = 4;
1107
1118
 
1119
+ // Only populated if report_task_queue_config is set to true.
1120
+ temporal.api.taskqueue.v1.TaskQueueConfig config = 6;
1121
+
1122
+ message EffectiveRateLimit {
1123
+ // The effective rate limit for the task queue.
1124
+ float requests_per_second = 1;
1125
+
1126
+ // Source of the RateLimit Configuration,which can be one of the following values:
1127
+ // - SOURCE_API: The rate limit that is set via the TaskQueueConfig api.
1128
+ // - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.
1129
+ // - SOURCE_SYSTEM: The rate limit is the default value set by the system
1130
+ temporal.api.enums.v1.RateLimitSource rate_limit_source = 2;
1131
+ }
1132
+
1133
+ EffectiveRateLimit effective_rate_limit = 7;
1134
+
1108
1135
  // Deprecated.
1109
1136
  // Status of the task queue. Only populated when `include_task_queue_status` is set to true in the request.
1110
1137
  temporal.api.taskqueue.v1.TaskQueueStatus task_queue_status = 2 [deprecated = true];
@@ -1659,6 +1686,8 @@ message StartBatchOperationRequest {
1659
1686
  temporal.api.batch.v1.BatchOperationReset reset_operation = 14;
1660
1687
  temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions update_workflow_options_operation = 15;
1661
1688
  temporal.api.batch.v1.BatchOperationUnpauseActivities unpause_activities_operation = 16;
1689
+ temporal.api.batch.v1.BatchOperationResetActivities reset_activities_operation = 17;
1690
+ temporal.api.batch.v1.BatchOperationUpdateActivityOptions update_activity_options_operation = 18;
1662
1691
  }
1663
1692
  }
1664
1693
 
@@ -1856,6 +1885,7 @@ message ExecuteMultiOperationResponse {
1856
1885
  }
1857
1886
  }
1858
1887
 
1888
+ // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions
1859
1889
  message UpdateActivityOptionsRequest {
1860
1890
  // Namespace of the workflow which scheduled this activity
1861
1891
  string namespace = 1;
@@ -1871,12 +1901,14 @@ message UpdateActivityOptionsRequest {
1871
1901
  // Controls which fields from `activity_options` will be applied
1872
1902
  google.protobuf.FieldMask update_mask = 5;
1873
1903
 
1874
- // either activity id or activity type must be provided
1904
+ // either activity id, activity type or update_all must be provided
1875
1905
  oneof activity {
1876
1906
  // Only activity with this ID will be updated.
1877
1907
  string id = 6;
1878
1908
  // Update all running activities of this type.
1879
1909
  string type = 7;
1910
+ // Update all running activities.
1911
+ bool match_all = 9;
1880
1912
  }
1881
1913
 
1882
1914
  // If set, the activity options will be restored to the default.
@@ -1948,6 +1980,7 @@ message UnpauseActivityRequest {
1948
1980
  message UnpauseActivityResponse {
1949
1981
  }
1950
1982
 
1983
+ // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities
1951
1984
  message ResetActivityRequest {
1952
1985
  // Namespace of the workflow which scheduled this activity.
1953
1986
  string namespace = 1;
@@ -1957,19 +1990,21 @@ message ResetActivityRequest {
1957
1990
  // The identity of the client who initiated this request.
1958
1991
  string identity = 3;
1959
1992
 
1960
- // either activity id or activity type must be provided
1993
+ // either activity id, activity type or update_all must be provided
1961
1994
  oneof activity {
1962
1995
  // Only activity with this ID will be reset.
1963
1996
  string id = 4;
1964
1997
  // Reset all running activities with of this type.
1965
1998
  string type = 5;
1999
+ // Reset all running activities.
2000
+ bool match_all = 10;
1966
2001
  }
1967
2002
 
1968
2003
  // Indicates that activity should reset heartbeat details.
1969
2004
  // This flag will be applied only to the new instance of the activity.
1970
2005
  bool reset_heartbeat = 6;
1971
2006
 
1972
- // if activity is paused, it will remain paused after reset
2007
+ // If activity is paused, it will remain paused after reset
1973
2008
  bool keep_paused = 7;
1974
2009
 
1975
2010
  // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
@@ -2041,6 +2076,11 @@ message DescribeWorkerDeploymentVersionResponse {
2041
2076
  temporal.api.enums.v1.TaskQueueType type = 2;
2042
2077
  // Only set if `report_task_queue_stats` is set on the request.
2043
2078
  temporal.api.taskqueue.v1.TaskQueueStats stats = 3;
2079
+ // Task queue stats breakdown by priority key. Only contains actively used priority keys.
2080
+ // Only set if `report_task_queue_stats` is set to true in the request.
2081
+ // (-- api-linter: core::0140::prepositions=disabled
2082
+ // aip.dev/not-precedent: "by" is used to clarify the key. --)
2083
+ map<int32, temporal.api.taskqueue.v1.TaskQueueStats> stats_by_priority_key = 4;
2044
2084
  }
2045
2085
  }
2046
2086
 
@@ -2419,3 +2459,81 @@ message ListWorkersResponse {
2419
2459
  // Next page token
2420
2460
  bytes next_page_token = 2;
2421
2461
  }
2462
+
2463
+ message UpdateTaskQueueConfigRequest {
2464
+ message RateLimitUpdate {
2465
+ // Rate Limit to be updated
2466
+ temporal.api.taskqueue.v1.RateLimit rate_limit = 1;
2467
+ // Reason for why the rate limit was set.
2468
+ string reason = 2;
2469
+ }
2470
+
2471
+ string namespace = 1;
2472
+ string identity = 2;
2473
+ // Selects the task queue to update.
2474
+ string task_queue = 3;
2475
+ temporal.api.enums.v1.TaskQueueType task_queue_type = 4;
2476
+ // Update to queue-wide rate limit.
2477
+ // If not set, this configuration is unchanged.
2478
+ // NOTE: A limit set by the worker is overriden; and restored again when reset.
2479
+ // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit.
2480
+ RateLimitUpdate update_queue_rate_limit = 5;
2481
+ // Update to the default fairness key rate limit.
2482
+ // If not set, this configuration is unchanged.
2483
+ // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit.
2484
+ RateLimitUpdate update_fairness_key_rate_limit_default = 6;
2485
+ }
2486
+
2487
+ message UpdateTaskQueueConfigResponse {
2488
+ temporal.api.taskqueue.v1.TaskQueueConfig config = 1;
2489
+ }
2490
+
2491
+ message FetchWorkerConfigRequest {
2492
+ // Namespace this worker belongs to.
2493
+ string namespace = 1;
2494
+
2495
+ // The identity of the client who initiated this request.
2496
+ string identity = 2;
2497
+
2498
+ // Reason for sending worker command, can be used for audit purpose.
2499
+ string reason = 3;
2500
+
2501
+ // Defines which workers should receive this command.
2502
+ // only single worker is supported at this time.
2503
+ temporal.api.common.v1.WorkerSelector selector = 6;
2504
+ }
2505
+
2506
+ message FetchWorkerConfigResponse {
2507
+ // The worker configuration.
2508
+ temporal.api.sdk.v1.WorkerConfig worker_config = 1;
2509
+ }
2510
+
2511
+ message UpdateWorkerConfigRequest {
2512
+ // Namespace this worker belongs to.
2513
+ string namespace = 1;
2514
+
2515
+ // The identity of the client who initiated this request.
2516
+ string identity = 2;
2517
+
2518
+ // Reason for sending worker command, can be used for audit purpose.
2519
+ string reason = 3;
2520
+
2521
+ // Partial updates are accepted and controlled by update_mask.
2522
+ // The worker configuration to set.
2523
+ temporal.api.sdk.v1.WorkerConfig worker_config = 4;
2524
+
2525
+ // Controls which fields from `worker_config` will be applied
2526
+ google.protobuf.FieldMask update_mask = 5;
2527
+
2528
+ // Defines which workers should receive this command.
2529
+ temporal.api.common.v1.WorkerSelector selector = 6;
2530
+ }
2531
+
2532
+ message UpdateWorkerConfigResponse {
2533
+ oneof response {
2534
+ // The worker configuration. Will be returned if the command was sent to a single worker.
2535
+ temporal.api.sdk.v1.WorkerConfig worker_config = 1;
2536
+
2537
+ // Once we support sending update to a multiple workers - it will be converted into a batch job, and job id will be returned.
2538
+ }
2539
+ }
@@ -1194,4 +1194,45 @@ service WorkflowService {
1194
1194
  }
1195
1195
  };
1196
1196
  }
1197
+
1198
+ // Updates task queue configuration.
1199
+ // For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,
1200
+ // which uncouples the rate limit from the worker lifecycle.
1201
+ // If the overall queue rate limit is unset, the worker-set rate limit takes effect.
1202
+ rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) {
1203
+ option (google.api.http) = {
1204
+ post: "/namespaces/{namespace}/task-queues/{task_queue}/update-config"
1205
+ body: "*"
1206
+ additional_bindings {
1207
+ post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/update-config"
1208
+ body: "*"
1209
+ }
1210
+ };
1211
+ }
1212
+
1213
+ // FetchWorkerConfig returns the worker configuration for a specific worker.
1214
+ rpc FetchWorkerConfig (FetchWorkerConfigRequest) returns (FetchWorkerConfigResponse) {
1215
+ option (google.api.http) = {
1216
+ post: "/namespaces/{namespace}/workers/fetch-config"
1217
+ body: "*"
1218
+ additional_bindings {
1219
+ post: "/api/v1/namespaces/{namespace}/workers/fetch-config"
1220
+ body: "*"
1221
+ }
1222
+ };
1223
+ }
1224
+
1225
+ // UpdateWorkerConfig updates the worker configuration of one or more workers.
1226
+ // Can be used to partially update the worker configuration.
1227
+ // Can be used to update the configuration of multiple workers.
1228
+ rpc UpdateWorkerConfig (UpdateWorkerConfigRequest) returns (UpdateWorkerConfigResponse) {
1229
+ option (google.api.http) = {
1230
+ post: "/namespaces/{namespace}/workers/update-config"
1231
+ body: "*"
1232
+ additional_bindings {
1233
+ post: "/api/v1/namespaces/{namespace}/workers/update-config"
1234
+ body: "*"
1235
+ }
1236
+ };
1237
+ }
1197
1238
  }
@@ -1930,6 +1930,11 @@ pub mod temporal {
1930
1930
  tonic::include_proto!("temporal.api.cloud.cloudservice.v1");
1931
1931
  }
1932
1932
  }
1933
+ pub mod connectivityrule {
1934
+ pub mod v1 {
1935
+ tonic::include_proto!("temporal.api.cloud.connectivityrule.v1");
1936
+ }
1937
+ }
1933
1938
  pub mod identity {
1934
1939
  pub mod v1 {
1935
1940
  tonic::include_proto!("temporal.api.cloud.identity.v1");
@@ -2628,7 +2633,6 @@ pub mod temporal {
2628
2633
  _ => continue,
2629
2634
  }
2630
2635
  }
2631
- dbg!(&eventref);
2632
2636
  Some(workflow_event::Reference::EventRef(eventref))
2633
2637
  } else {
2634
2638
  None
@@ -21,6 +21,7 @@ futures-util = { version = "0.3", default-features = false }
21
21
  parking_lot = "0.12"
22
22
  prost = { workspace = true }
23
23
  rand = "0.9"
24
+ semver = "1.0"
24
25
  temporal-client = { path = "../client" }
25
26
  temporal-sdk = { path = "../sdk" }
26
27
  temporal-sdk-core = { path = "../core" }