@temporalio/core-bridge 1.11.8 → 1.12.0

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 (205) hide show
  1. package/Cargo.lock +219 -193
  2. package/Cargo.toml +27 -8
  3. package/README.md +5 -0
  4. package/index.js +72 -12
  5. package/lib/errors.d.ts +25 -0
  6. package/lib/errors.js +76 -1
  7. package/lib/errors.js.map +1 -1
  8. package/lib/index.d.ts +11 -478
  9. package/lib/index.js +28 -5
  10. package/lib/index.js.map +1 -1
  11. package/lib/native.d.ts +330 -0
  12. package/lib/{worker-tuner.js → native.js} +1 -1
  13. package/lib/native.js.map +1 -0
  14. package/package.json +7 -3
  15. package/releases/aarch64-apple-darwin/index.node +0 -0
  16. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  17. package/releases/x86_64-apple-darwin/index.node +0 -0
  18. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  19. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  20. package/sdk-core/.cargo/config.toml +8 -2
  21. package/sdk-core/.cargo/multi-worker-manual-test +15 -0
  22. package/sdk-core/.github/workflows/per-pr.yml +40 -11
  23. package/sdk-core/AGENTS.md +73 -0
  24. package/sdk-core/ARCHITECTURE.md +71 -23
  25. package/sdk-core/Cargo.toml +1 -1
  26. package/sdk-core/README.md +4 -4
  27. package/sdk-core/arch_docs/workflow_task_chunking.md +51 -0
  28. package/sdk-core/client/Cargo.toml +1 -1
  29. package/sdk-core/client/src/lib.rs +49 -13
  30. package/sdk-core/client/src/metrics.rs +15 -16
  31. package/sdk-core/client/src/proxy.rs +2 -2
  32. package/sdk-core/client/src/raw.rs +54 -8
  33. package/sdk-core/client/src/retry.rs +109 -13
  34. package/sdk-core/client/src/worker_registry/mod.rs +4 -4
  35. package/sdk-core/client/src/workflow_handle/mod.rs +1 -1
  36. package/sdk-core/core/Cargo.toml +28 -8
  37. package/sdk-core/core/src/abstractions.rs +62 -10
  38. package/sdk-core/core/src/core_tests/activity_tasks.rs +180 -8
  39. package/sdk-core/core/src/core_tests/mod.rs +4 -4
  40. package/sdk-core/core/src/core_tests/queries.rs +18 -4
  41. package/sdk-core/core/src/core_tests/workers.rs +3 -3
  42. package/sdk-core/core/src/core_tests/workflow_tasks.rs +191 -25
  43. package/sdk-core/core/src/ephemeral_server/mod.rs +10 -3
  44. package/sdk-core/core/src/internal_flags.rs +14 -14
  45. package/sdk-core/core/src/lib.rs +5 -2
  46. package/sdk-core/core/src/pollers/mod.rs +1 -1
  47. package/sdk-core/core/src/pollers/poll_buffer.rs +495 -164
  48. package/sdk-core/core/src/protosext/mod.rs +3 -3
  49. package/sdk-core/core/src/replay/mod.rs +3 -3
  50. package/sdk-core/core/src/telemetry/metrics.rs +13 -4
  51. package/sdk-core/core/src/telemetry/mod.rs +72 -70
  52. package/sdk-core/core/src/telemetry/otel.rs +51 -54
  53. package/sdk-core/core/src/test_help/mod.rs +9 -3
  54. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +31 -11
  55. package/sdk-core/core/src/worker/activities/local_activities.rs +35 -28
  56. package/sdk-core/core/src/worker/activities.rs +58 -30
  57. package/sdk-core/core/src/worker/client/mocks.rs +3 -3
  58. package/sdk-core/core/src/worker/client.rs +155 -53
  59. package/sdk-core/core/src/worker/mod.rs +103 -95
  60. package/sdk-core/core/src/worker/nexus.rs +100 -73
  61. package/sdk-core/core/src/worker/tuner/resource_based.rs +14 -6
  62. package/sdk-core/core/src/worker/tuner.rs +4 -13
  63. package/sdk-core/core/src/worker/workflow/history_update.rs +47 -51
  64. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -4
  65. package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +127 -32
  66. package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +1 -2
  67. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +1 -1
  68. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +55 -42
  69. package/sdk-core/core/src/worker/workflow/managed_run.rs +45 -35
  70. package/sdk-core/core/src/worker/workflow/mod.rs +200 -97
  71. package/sdk-core/core/src/worker/workflow/wft_poller.rs +175 -4
  72. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +38 -36
  73. package/sdk-core/core-api/Cargo.toml +8 -0
  74. package/sdk-core/core-api/src/envconfig.rs +1544 -0
  75. package/sdk-core/core-api/src/lib.rs +2 -0
  76. package/sdk-core/core-api/src/telemetry/metrics.rs +8 -0
  77. package/sdk-core/core-api/src/telemetry.rs +36 -3
  78. package/sdk-core/core-api/src/worker.rs +301 -75
  79. package/sdk-core/docker/docker-compose-telem.yaml +1 -0
  80. package/sdk-core/etc/prometheus.yaml +6 -2
  81. package/sdk-core/histories/long_local_activity_with_update-0_history.bin +0 -0
  82. package/sdk-core/histories/long_local_activity_with_update-1_history.bin +0 -0
  83. package/sdk-core/histories/long_local_activity_with_update-2_history.bin +0 -0
  84. package/sdk-core/histories/long_local_activity_with_update-3_history.bin +0 -0
  85. package/sdk-core/sdk/src/activity_context.rs +5 -0
  86. package/sdk-core/sdk/src/interceptors.rs +73 -3
  87. package/sdk-core/sdk/src/lib.rs +15 -16
  88. package/sdk-core/sdk/src/workflow_context/options.rs +10 -0
  89. package/sdk-core/sdk/src/workflow_context.rs +48 -29
  90. package/sdk-core/sdk/src/workflow_future.rs +5 -6
  91. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +20 -0
  92. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/CODEOWNERS +6 -0
  93. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/README.md +17 -6
  94. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -1
  95. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.lock +7 -2
  96. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.yaml +2 -0
  97. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +78 -0
  98. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +29 -0
  99. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +74 -32
  100. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +45 -15
  101. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +7 -1
  102. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +3 -3
  103. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +3 -3
  104. package/sdk-core/sdk-core-protos/protos/api_upstream/LICENSE +1 -1
  105. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +2 -0
  106. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +1103 -88
  107. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +1233 -151
  108. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -22
  109. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +19 -24
  110. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +0 -22
  111. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +12 -22
  112. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +45 -45
  113. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -22
  114. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -22
  115. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +15 -22
  116. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -22
  117. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/event_type.proto +4 -22
  118. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -22
  119. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -22
  120. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -20
  121. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -22
  122. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -22
  123. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -22
  124. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -22
  125. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -22
  126. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/workflow.proto +4 -22
  127. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -22
  128. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto +0 -22
  129. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +2 -22
  130. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -22
  131. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +75 -49
  132. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -22
  133. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -20
  134. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -22
  135. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -22
  136. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -22
  137. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/query/v1/message.proto +0 -22
  138. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -22
  139. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/rules/v1/message.proto +90 -0
  140. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -22
  141. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -22
  142. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -22
  143. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -22
  144. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -22
  145. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +17 -38
  146. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/update/v1/message.proto +0 -22
  147. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/version/v1/message.proto +0 -22
  148. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +151 -44
  149. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +172 -65
  150. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +69 -28
  151. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/activity_task/activity_task.proto +18 -0
  152. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/common/common.proto +5 -0
  153. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/nexus/nexus.proto +16 -1
  154. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +21 -15
  155. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +3 -0
  156. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +3 -0
  157. package/sdk-core/sdk-core-protos/src/lib.rs +60 -16
  158. package/sdk-core/test-utils/src/lib.rs +157 -39
  159. package/sdk-core/tests/cloud_tests.rs +86 -0
  160. package/sdk-core/tests/fuzzy_workflow.rs +23 -26
  161. package/sdk-core/tests/global_metric_tests.rs +116 -0
  162. package/sdk-core/tests/heavy_tests.rs +127 -7
  163. package/sdk-core/tests/integ_tests/client_tests.rs +2 -8
  164. package/sdk-core/tests/integ_tests/metrics_tests.rs +100 -106
  165. package/sdk-core/tests/integ_tests/polling_tests.rs +94 -8
  166. package/sdk-core/tests/integ_tests/update_tests.rs +75 -6
  167. package/sdk-core/tests/integ_tests/worker_tests.rs +54 -5
  168. package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +240 -0
  169. package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +41 -3
  170. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +168 -8
  171. package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +285 -15
  172. package/sdk-core/tests/integ_tests/workflow_tests/priority.rs +12 -4
  173. package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +3 -2
  174. package/sdk-core/tests/integ_tests/workflow_tests.rs +124 -74
  175. package/sdk-core/tests/main.rs +3 -51
  176. package/sdk-core/tests/manual_tests.rs +430 -0
  177. package/sdk-core/tests/runner.rs +28 -2
  178. package/src/client.rs +565 -0
  179. package/src/helpers/abort_controller.rs +204 -0
  180. package/src/helpers/callbacks.rs +299 -0
  181. package/src/helpers/errors.rs +302 -0
  182. package/src/helpers/future.rs +44 -0
  183. package/src/helpers/handles.rs +191 -0
  184. package/src/helpers/inspect.rs +18 -0
  185. package/src/helpers/json_string.rs +58 -0
  186. package/src/helpers/mod.rs +20 -0
  187. package/src/helpers/properties.rs +71 -0
  188. package/src/helpers/try_from_js.rs +213 -0
  189. package/src/helpers/try_into_js.rs +129 -0
  190. package/src/lib.rs +28 -40
  191. package/src/logs.rs +111 -0
  192. package/src/metrics.rs +325 -0
  193. package/src/runtime.rs +409 -498
  194. package/src/testing.rs +315 -57
  195. package/src/worker.rs +907 -378
  196. package/ts/errors.ts +57 -0
  197. package/ts/index.ts +10 -596
  198. package/ts/native.ts +496 -0
  199. package/lib/worker-tuner.d.ts +0 -167
  200. package/lib/worker-tuner.js.map +0 -1
  201. package/src/conversions/slot_supplier_bridge.rs +0 -291
  202. package/src/conversions.rs +0 -618
  203. package/src/errors.rs +0 -38
  204. package/src/helpers.rs +0 -297
  205. package/ts/worker-tuner.ts +0 -193
@@ -1,25 +1,3 @@
1
- // The MIT License
2
- //
3
- // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
4
- //
5
- // Permission is hereby granted, free of charge, to any person obtaining a copy
6
- // of this software and associated documentation files (the "Software"), to deal
7
- // in the Software without restriction, including without limitation the rights
8
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- // copies of the Software, and to permit persons to whom the Software is
10
- // furnished to do so, subject to the following conditions:
11
- //
12
- // The above copyright notice and this permission notice shall be included in
13
- // all copies or substantial portions of the Software.
14
- //
15
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- // THE SOFTWARE.
22
-
23
1
  syntax = "proto3";
24
2
 
25
3
  package temporal.api.workflowservice.v1;
@@ -53,6 +31,7 @@ import "temporal/api/protocol/v1/message.proto";
53
31
  import "temporal/api/namespace/v1/message.proto";
54
32
  import "temporal/api/query/v1/message.proto";
55
33
  import "temporal/api/replication/v1/message.proto";
34
+ import "temporal/api/rules/v1/message.proto";
56
35
  import "temporal/api/schedule/v1/message.proto";
57
36
  import "temporal/api/taskqueue/v1/message.proto";
58
37
  import "temporal/api/update/v1/message.proto";
@@ -220,10 +199,15 @@ message StartWorkflowExecutionResponse {
220
199
  string run_id = 1;
221
200
  // If true, a new workflow was started.
222
201
  bool started = 3;
202
+ // Current execution status of the workflow. Typically remains WORKFLOW_EXECUTION_STATUS_RUNNING
203
+ // unless a de-dupe occurs or in specific scenarios handled within the ExecuteMultiOperation (refer to its docs).
204
+ temporal.api.enums.v1.WorkflowExecutionStatus status = 5;
223
205
  // When `request_eager_execution` is set on the `StartWorkflowExecutionRequest`, the server - if supported - will
224
206
  // return the first workflow task to be eagerly executed.
225
207
  // The caller is expected to have a worker available to process the task.
226
208
  PollWorkflowTaskQueueResponse eager_workflow_task = 2;
209
+ // Link to the workflow event.
210
+ temporal.api.common.v1.Link link = 4;
227
211
  }
228
212
 
229
213
  message GetWorkflowExecutionHistoryRequest {
@@ -270,10 +254,10 @@ message PollWorkflowTaskQueueRequest {
270
254
  temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
271
255
  // The identity of the worker/client who is polling this task queue
272
256
  string identity = 3;
273
- // DEPRECATED since 1.21 - use `worker_version_capabilities` instead.
257
+ // DEPRECATED since 1.21 - use `deployment_options` instead.
274
258
  // Each worker process should provide an ID unique to the specific set of code it is running
275
259
  // "checksum" in this field name isn't very accurate, it should be though of as an id.
276
- string binary_checksum = 4;
260
+ string binary_checksum = 4 [deprecated = true];
277
261
  // Information about this worker's build identifier and if it is choosing to use the versioning
278
262
  // feature. See the `WorkerVersionCapabilities` docstring for more.
279
263
  // Deprecated. Replaced by deployment_options.
@@ -355,16 +339,16 @@ message RespondWorkflowTaskCompletedRequest {
355
339
  // something useful, but cannot complete it within the workflow task timeout. Local activities
356
340
  // which run for longer than the task timeout being the prime example.
357
341
  bool force_create_new_workflow_task = 6;
358
- // DEPRECATED since 1.21 - use `worker_version_stamp` instead.
342
+ // DEPRECATED since 1.21 - use `deployment_options` instead.
359
343
  // Worker process' unique binary id
360
- string binary_checksum = 7;
344
+ string binary_checksum = 7 [deprecated = true];
361
345
  // Responses to the `queries` field in the task being responded to
362
346
  map<string, temporal.api.query.v1.WorkflowQueryResult> query_results = 8;
363
347
  string namespace = 9;
364
348
  // Version info of the worker who processed this task. This message's `build_id` field should
365
349
  // always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
366
350
  // field to true. See message docstrings for more.
367
- // Deprecated. Use `deployment` and `versioning_behavior` instead.
351
+ // Deprecated. Use `deployment_options` and `versioning_behavior` instead.
368
352
  temporal.api.common.v1.WorkerVersionStamp worker_version_stamp = 10 [deprecated = true];
369
353
  // Protocol messages piggybacking on a WFT as a transport
370
354
  repeated temporal.api.protocol.v1.Message messages = 11;
@@ -418,21 +402,21 @@ message RespondWorkflowTaskFailedRequest {
418
402
  temporal.api.failure.v1.Failure failure = 3;
419
403
  // The identity of the worker/client
420
404
  string identity = 4;
421
- // DEPRECATED since 1.21 - use `worker_version_stamp` instead.
405
+ // DEPRECATED since 1.21 - use `deployment_options` instead.
422
406
  // Worker process' unique binary id
423
- string binary_checksum = 5;
407
+ string binary_checksum = 5 [deprecated = true];
424
408
  string namespace = 6;
425
409
  // Protocol messages piggybacking on a WFT as a transport
426
410
  repeated temporal.api.protocol.v1.Message messages = 7;
427
411
  // Version info of the worker who processed this task. This message's `build_id` field should
428
412
  // always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
429
413
  // field to true. See message docstrings for more.
430
- // Deprecated. Use `deployment` instead.
414
+ // Deprecated. Use `deployment_options` instead.
431
415
  temporal.api.common.v1.WorkerVersionStamp worker_version = 8 [deprecated = true];
432
416
  // Deployment info of the worker that completed this task. Must be present if user has set
433
417
  // `WorkerDeploymentOptions` regardless of versioning being enabled or not.
434
418
  // Deprecated. Replaced with `deployment_options`.
435
- temporal.api.deployment.v1.Deployment deployment = 9;
419
+ temporal.api.deployment.v1.Deployment deployment = 9 [deprecated = true];
436
420
  // Worker deployment options that user has set in the worker.
437
421
  temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 10;
438
422
  }
@@ -523,6 +507,10 @@ message RecordActivityTaskHeartbeatResponse {
523
507
 
524
508
  // Will be set to true if the activity is paused.
525
509
  bool activity_paused = 2;
510
+
511
+ // Will be set to true if the activity was reset.
512
+ // Applies only to the current run.
513
+ bool activity_reset = 3;
526
514
  }
527
515
 
528
516
  message RecordActivityTaskHeartbeatByIdRequest {
@@ -547,6 +535,10 @@ message RecordActivityTaskHeartbeatByIdResponse {
547
535
 
548
536
  // Will be set to true if the activity is paused.
549
537
  bool activity_paused = 2;
538
+
539
+ // Will be set to true if the activity was reset.
540
+ // Applies only to the current run.
541
+ bool activity_reset = 3;
550
542
  }
551
543
 
552
544
  message RespondActivityTaskCompletedRequest {
@@ -560,7 +552,7 @@ message RespondActivityTaskCompletedRequest {
560
552
  // Version info of the worker who processed this task. This message's `build_id` field should
561
553
  // always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
562
554
  // field to true. See message docstrings for more.
563
- // Deprecated. Use `deployment` instead.
555
+ // Deprecated. Use `deployment_options` instead.
564
556
  temporal.api.common.v1.WorkerVersionStamp worker_version = 5 [deprecated = true];
565
557
  // Deployment info of the worker that completed this task. Must be present if user has set
566
558
  // `WorkerDeploymentOptions` regardless of versioning being enabled or not.
@@ -604,7 +596,7 @@ message RespondActivityTaskFailedRequest {
604
596
  // Version info of the worker who processed this task. This message's `build_id` field should
605
597
  // always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
606
598
  // field to true. See message docstrings for more.
607
- // Deprecated. Use `deployment` instead.
599
+ // Deprecated. Use `deployment_options` instead.
608
600
  temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];
609
601
  // Deployment info of the worker that completed this task. Must be present if user has set
610
602
  // `WorkerDeploymentOptions` regardless of versioning being enabled or not.
@@ -654,7 +646,7 @@ message RespondActivityTaskCanceledRequest {
654
646
  // Version info of the worker who processed this task. This message's `build_id` field should
655
647
  // always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
656
648
  // field to true. See message docstrings for more.
657
- // Deprecated. Use `deployment` instead.
649
+ // Deprecated. Use `deployment_options` instead.
658
650
  temporal.api.common.v1.WorkerVersionStamp worker_version = 5 [deprecated = true];
659
651
  // Deployment info of the worker that completed this task. Must be present if user has set
660
652
  // `WorkerDeploymentOptions` regardless of versioning being enabled or not.
@@ -680,6 +672,8 @@ message RespondActivityTaskCanceledByIdRequest {
680
672
  temporal.api.common.v1.Payloads details = 5;
681
673
  // The identity of the worker/client
682
674
  string identity = 6;
675
+ // Worker deployment options that user has set in the worker.
676
+ temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 7;
683
677
  }
684
678
 
685
679
  message RespondActivityTaskCanceledByIdResponse {
@@ -705,6 +699,9 @@ message RequestCancelWorkflowExecutionRequest {
705
699
  message RequestCancelWorkflowExecutionResponse {
706
700
  }
707
701
 
702
+ // Keep the parameters in sync with:
703
+ // - temporal.api.batch.v1.BatchOperationSignal.
704
+ // - temporal.api.workflow.v1.PostResetOperation.SignalWorkflow.
708
705
  message SignalWorkflowExecutionRequest {
709
706
  string namespace = 1;
710
707
  temporal.api.common.v1.WorkflowExecution workflow_execution = 2;
@@ -817,6 +814,10 @@ message ResetWorkflowExecutionRequest {
817
814
  temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 6;
818
815
  // Event types not to be reapplied
819
816
  repeated temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7;
817
+ // Operations to perform after the workflow has been reset. These operations will be applied
818
+ // to the *new* run of the workflow execution in the order they are provided.
819
+ // All operations are applied to the workflow before the first new workflow task is generated
820
+ repeated temporal.api.workflow.v1.PostResetOperation post_reset_operations = 8;
820
821
  }
821
822
 
822
823
  message ResetWorkflowExecutionResponse {
@@ -1802,6 +1803,12 @@ message ExecuteMultiOperationRequest {
1802
1803
  }
1803
1804
  }
1804
1805
 
1806
+ // IMPORTANT: For [StartWorkflow, UpdateWorkflow] combination ("Update-with-Start") when both
1807
+ // 1. the workflow update for the requested update ID has already completed, and
1808
+ // 2. the workflow for the requested workflow ID has already been closed,
1809
+ // then you'll receive
1810
+ // - an update response containing the update's outcome, and
1811
+ // - a start response with a `status` field that reflects the workflow's current state.
1805
1812
  message ExecuteMultiOperationResponse {
1806
1813
  repeated Response responses = 1;
1807
1814
 
@@ -1828,13 +1835,13 @@ message UpdateActivityOptionsRequest {
1828
1835
  // Controls which fields from `activity_options` will be applied
1829
1836
  google.protobuf.FieldMask update_mask = 5;
1830
1837
 
1831
- // either activity id or activity type must be provided
1832
- oneof activity {
1833
- // Only activity with this ID will be updated.
1834
- string id = 6;
1835
- // Update all running activities of this type.
1836
- string type = 7;
1837
- }
1838
+ // either activity id or activity type must be provided
1839
+ oneof activity {
1840
+ // Only activity with this ID will be updated.
1841
+ string id = 6;
1842
+ // Update all running activities of this type.
1843
+ string type = 7;
1844
+ }
1838
1845
  }
1839
1846
 
1840
1847
  message UpdateActivityOptionsResponse {
@@ -1859,6 +1866,8 @@ message PauseActivityRequest {
1859
1866
  string type = 5;
1860
1867
  }
1861
1868
 
1869
+ // Reason to pause the activity.
1870
+ string reason = 6;
1862
1871
  }
1863
1872
 
1864
1873
  message PauseActivityResponse {
@@ -1928,6 +1937,9 @@ message ResetActivityRequest {
1928
1937
  message ResetActivityResponse {
1929
1938
  }
1930
1939
 
1940
+ // Keep the parameters in sync with:
1941
+ // - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions.
1942
+ // - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions.
1931
1943
  message UpdateWorkflowExecutionOptionsRequest {
1932
1944
  // The namespace name of the target Workflow.
1933
1945
  string namespace = 1;
@@ -1960,9 +1972,11 @@ message DescribeDeploymentResponse {
1960
1972
  }
1961
1973
 
1962
1974
  message DescribeWorkerDeploymentVersionRequest {
1963
- string namespace = 1;
1964
- // Deployment Version identifier in the form "<deployment_name>.<build_id>".
1965
- string version = 2;
1975
+ string namespace = 1;
1976
+ // Deprecated. Use `deployment_version`.
1977
+ string version = 2 [deprecated = true];
1978
+ // Required.
1979
+ temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 3;
1966
1980
  }
1967
1981
 
1968
1982
  message DescribeWorkerDeploymentVersionResponse {
@@ -2019,11 +2033,14 @@ message SetCurrentDeploymentResponse {
2019
2033
  message SetWorkerDeploymentCurrentVersionRequest {
2020
2034
  string namespace = 1;
2021
2035
  string deployment_name = 2;
2022
- // Required. Can be one of the following:
2023
- // - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
2024
- // - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
2025
- // with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
2026
- string version = 3;
2036
+ // Deprecated. Use `build_id`.
2037
+ string version = 3 [deprecated = true];
2038
+
2039
+ // The build id of the Version that you want to set as Current.
2040
+ // Pass an empty value to set the Current Version to nil.
2041
+ // A nil Current Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
2042
+ string build_id = 7;
2043
+
2027
2044
  // Optional. This can be the value of conflict_token from a Describe, or another Worker
2028
2045
  // Deployment API. Passing a non-nil conflict token will cause this request to fail if the
2029
2046
  // Deployment's configuration has been modified between the API call that generated the
@@ -2052,21 +2069,24 @@ message SetWorkerDeploymentCurrentVersionResponse {
2052
2069
  // that write to the Worker Deployment state to ensure that the state
2053
2070
  // did not change between this API call and a future write.
2054
2071
  bytes conflict_token = 1;
2055
- // The version that was current before executing this operation, in the form
2056
- // "<deployment_name>.<build_id>". Can also be the `__unversioned__` special value.
2057
- string previous_version = 2;
2072
+ // Deprecated. Use `previous_deployment_version`.
2073
+ string previous_version = 2 [deprecated = true];
2074
+ // The version that was current before executing this operation.
2075
+ temporal.api.deployment.v1.WorkerDeploymentVersion previous_deployment_version = 3;
2058
2076
  }
2059
2077
 
2060
2078
  // Set/unset the Ramping Version of a Worker Deployment and its ramp percentage.
2061
2079
  message SetWorkerDeploymentRampingVersionRequest {
2062
2080
  string namespace = 1;
2063
2081
  string deployment_name = 2;
2064
- // Can be one of the following:
2065
- // - Absent/empty value to unset the Ramping Version. Must be paired with `percentage=0`.
2066
- // - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
2067
- // - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
2068
- // with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
2069
- string version = 3;
2082
+ // Deprecated. Use `build_id`.
2083
+ string version = 3 [deprecated = true];
2084
+
2085
+ // The build id of the Version that you want to ramp traffic to.
2086
+ // Pass an empty value to set the Ramping Version to nil.
2087
+ // A nil Ramping Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
2088
+ string build_id = 8;
2089
+
2070
2090
  // Ramp percentage to set. Valid range: [0,100].
2071
2091
  float percentage = 4;
2072
2092
 
@@ -2101,9 +2121,10 @@ message SetWorkerDeploymentRampingVersionResponse {
2101
2121
  // that write to the Worker Deployment state to ensure that the state
2102
2122
  // did not change between this API call and a future write.
2103
2123
  bytes conflict_token = 1;
2104
- // The version that was ramping before executing this operation, in the form
2105
- // "<deployment_name>.<build_id>". Can also be the `__unversioned__` special value.
2106
- string previous_version = 2;
2124
+ // Deprecated. Use `previous_deployment_version`.
2125
+ string previous_version = 2 [deprecated = true];
2126
+ // The version that was ramping before executing this operation.
2127
+ temporal.api.deployment.v1.WorkerDeploymentVersion previous_deployment_version = 4;
2107
2128
  // The ramping version percentage before executing this operation.
2108
2129
  float previous_percentage = 3;
2109
2130
  }
@@ -2136,8 +2157,10 @@ message ListWorkerDeploymentsResponse {
2136
2157
  // can be skipped by passing `skip-drainage=true`.
2137
2158
  message DeleteWorkerDeploymentVersionRequest {
2138
2159
  string namespace = 1;
2139
- // Deployment Version identifier in the form "<deployment_name>.<build_id>".
2140
- string version = 2;
2160
+ // Deprecated. Use `deployment_version`.
2161
+ string version = 2 [deprecated = true];
2162
+ // Required.
2163
+ temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;
2141
2164
  // Pass to force deletion even if the Version is draining. In this case the open pinned
2142
2165
  // workflows will be stuck until manually moved to another version by UpdateWorkflowExecutionOptions.
2143
2166
  bool skip_drainage = 3;
@@ -2163,8 +2186,10 @@ message DeleteWorkerDeploymentResponse {
2163
2186
  // Used to update the user-defined metadata of a Worker Deployment Version.
2164
2187
  message UpdateWorkerDeploymentVersionMetadataRequest {
2165
2188
  string namespace = 1;
2166
- // Deployment Version identifier in the form "<deployment_name>.<build_id>".
2167
- string version = 2;
2189
+ // Deprecated. Use `deployment_version`.
2190
+ string version = 2 [deprecated = true];
2191
+ // Required.
2192
+ temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;
2168
2193
  map<string, temporal.api.common.v1.Payload> upsert_entries = 3;
2169
2194
  // List of keys to remove from the metadata.
2170
2195
  repeated string remove_entries = 4;
@@ -2201,3 +2226,85 @@ message GetDeploymentReachabilityResponse {
2201
2226
  // was actually calculated.
2202
2227
  google.protobuf.Timestamp last_update_time = 3;
2203
2228
  }
2229
+
2230
+ message CreateWorkflowRuleRequest {
2231
+ string namespace = 1;
2232
+
2233
+ // The rule specification .
2234
+ temporal.api.rules.v1.WorkflowRuleSpec spec = 2;
2235
+
2236
+ // If true, the rule will be applied to the currently running workflows via batch job.
2237
+ // If not set , the rule will only be applied when triggering condition is satisfied.
2238
+ // visibility_query in the rule will be used to select the workflows to apply the rule to.
2239
+ bool force_scan = 3;
2240
+
2241
+ // Used to de-dupe requests. Typically should be UUID.
2242
+ string request_id = 4;
2243
+
2244
+ // Identity of the actor who created the rule. Will be stored with the rule.
2245
+ string identity = 5;
2246
+
2247
+ // Rule description.Will be stored with the rule.
2248
+ string description = 6;
2249
+ }
2250
+
2251
+ message CreateWorkflowRuleResponse {
2252
+ // Created rule.
2253
+ temporal.api.rules.v1.WorkflowRule rule = 1;
2254
+
2255
+ // Batch Job ID if force-scan flag was provided. Otherwise empty.
2256
+ string job_id = 2;
2257
+ }
2258
+
2259
+ message DescribeWorkflowRuleRequest {
2260
+ string namespace = 1;
2261
+ // User-specified ID of the rule to read. Unique within the namespace.
2262
+ string rule_id = 2;
2263
+ }
2264
+
2265
+ message DescribeWorkflowRuleResponse {
2266
+ // The rule that was read.
2267
+ temporal.api.rules.v1.WorkflowRule rule = 1;
2268
+ }
2269
+
2270
+ message DeleteWorkflowRuleRequest {
2271
+ string namespace = 1;
2272
+
2273
+ // ID of the rule to delete. Unique within the namespace.
2274
+ string rule_id = 2;
2275
+ }
2276
+
2277
+ message DeleteWorkflowRuleResponse {
2278
+ }
2279
+
2280
+ message ListWorkflowRulesRequest {
2281
+ string namespace = 1;
2282
+ bytes next_page_token = 2;
2283
+ }
2284
+
2285
+ message ListWorkflowRulesResponse {
2286
+ repeated temporal.api.rules.v1.WorkflowRule rules = 1;
2287
+ bytes next_page_token = 2;
2288
+ }
2289
+
2290
+ message TriggerWorkflowRuleRequest {
2291
+ string namespace = 1;
2292
+
2293
+ // Execution info of the workflow which scheduled this activity
2294
+ temporal.api.common.v1.WorkflowExecution execution = 2;
2295
+
2296
+ // Either provide id of existing rule, or rule specification
2297
+ oneof rule {
2298
+ string id = 4;
2299
+ // Note: Rule ID and expiration date are not used in the trigger request.
2300
+ temporal.api.rules.v1.WorkflowRuleSpec spec = 5;
2301
+ }
2302
+
2303
+ // The identity of the client who initiated this request
2304
+ string identity = 3;
2305
+ }
2306
+
2307
+ message TriggerWorkflowRuleResponse {
2308
+ // True is the rule was applied, based on the rule conditions (predicate/visibility_query).
2309
+ bool applied = 1;
2310
+ }
@@ -1,25 +1,3 @@
1
- // The MIT License
2
- //
3
- // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
4
- //
5
- // Permission is hereby granted, free of charge, to any person obtaining a copy
6
- // of this software and associated documentation files (the "Software"), to deal
7
- // in the Software without restriction, including without limitation the rights
8
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- // copies of the Software, and to permit persons to whom the Software is
10
- // furnished to do so, subject to the following conditions:
11
- //
12
- // The above copyright notice and this permission notice shall be included in
13
- // all copies or substantial portions of the Software.
14
- //
15
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- // THE SOFTWARE.
22
-
23
1
  syntax = "proto3";
24
2
 
25
3
  package temporal.api.workflowservice.v1;
@@ -789,9 +767,9 @@ service WorkflowService {
789
767
  // Experimental. This API might significantly change or be removed in a future release.
790
768
  rpc DescribeWorkerDeploymentVersion (DescribeWorkerDeploymentVersionRequest) returns (DescribeWorkerDeploymentVersionResponse) {
791
769
  option (google.api.http) = {
792
- get: "/namespaces/{namespace}/worker-deployment-versions/{version}"
770
+ get: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}"
793
771
  additional_bindings {
794
- get: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{version}"
772
+ get: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}"
795
773
  }
796
774
  };
797
775
  }
@@ -900,9 +878,9 @@ service WorkflowService {
900
878
  // Experimental. This API might significantly change or be removed in a future release.
901
879
  rpc DeleteWorkerDeploymentVersion (DeleteWorkerDeploymentVersionRequest) returns (DeleteWorkerDeploymentVersionResponse) {
902
880
  option (google.api.http) = {
903
- delete: "/namespaces/{namespace}/worker-deployment-versions/{version}"
881
+ delete: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}"
904
882
  additional_bindings {
905
- delete: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{version}"
883
+ delete: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}"
906
884
  }
907
885
  };
908
886
  }
@@ -936,10 +914,10 @@ service WorkflowService {
936
914
  // Experimental. This API might significantly change or be removed in a future release.
937
915
  rpc UpdateWorkerDeploymentVersionMetadata (UpdateWorkerDeploymentVersionMetadataRequest) returns (UpdateWorkerDeploymentVersionMetadataResponse) {
938
916
  option (google.api.http) = {
939
- post: "/namespaces/{namespace}/worker-deployment-versions/{version}/update-metadata"
917
+ post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata"
940
918
  body: "*"
941
919
  additional_bindings {
942
- post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{version}/update-metadata"
920
+ post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata"
943
921
  body: "*"
944
922
  }
945
923
  };
@@ -1132,4 +1110,67 @@ service WorkflowService {
1132
1110
  }
1133
1111
  };
1134
1112
  }
1113
+
1114
+ // Create a new workflow rule. The rules are used to control the workflow execution.
1115
+ // The rule will be applied to all running and new workflows in the namespace.
1116
+ // If the rule with such ID already exist this call will fail
1117
+ // Note: the rules are part of namespace configuration and will be stored in the namespace config.
1118
+ // Namespace config is eventually consistent.
1119
+ rpc CreateWorkflowRule (CreateWorkflowRuleRequest) returns (CreateWorkflowRuleResponse) {
1120
+ option (google.api.http) = {
1121
+ post: "/namespaces/{namespace}/workflow-rules"
1122
+ body: "*"
1123
+ additional_bindings {
1124
+ post: "/api/v1/namespaces/{namespace}/workflow-rules"
1125
+ body: "*"
1126
+ }
1127
+ };
1128
+ }
1129
+
1130
+ // DescribeWorkflowRule return the rule specification for existing rule id.
1131
+ // If there is no rule with such id - NOT FOUND error will be returned.
1132
+ rpc DescribeWorkflowRule (DescribeWorkflowRuleRequest) returns (DescribeWorkflowRuleResponse) {
1133
+ option (google.api.http) = {
1134
+ get: "/namespaces/{namespace}/workflow-rules/{rule_id}"
1135
+ additional_bindings {
1136
+ get: "/api/v1/namespaces/{namespace}/workflow-rules/{rule_id}"
1137
+ }
1138
+ };
1139
+ }
1140
+
1141
+ // Delete rule by rule id
1142
+ rpc DeleteWorkflowRule (DeleteWorkflowRuleRequest) returns (DeleteWorkflowRuleResponse) {
1143
+ option (google.api.http) = {
1144
+ delete: "/namespaces/{namespace}/workflow-rules/{rule_id}"
1145
+ additional_bindings {
1146
+ delete: "/api/v1/namespaces/{namespace}/workflow-rules/{rule_id}"
1147
+ }
1148
+ };
1149
+ }
1150
+
1151
+ // Return all namespace workflow rules
1152
+ rpc ListWorkflowRules (ListWorkflowRulesRequest) returns (ListWorkflowRulesResponse) {
1153
+ option (google.api.http) = {
1154
+ get: "/namespaces/{namespace}/workflow-rules"
1155
+ additional_bindings {
1156
+ get: "/api/v1/namespaces/{namespace}/workflow-rules"
1157
+ }
1158
+ };
1159
+ }
1160
+
1161
+ // TriggerWorkflowRule allows to:
1162
+ // * trigger existing rule for a specific workflow execution;
1163
+ // * trigger rule for a specific workflow execution without creating a rule;
1164
+ // This is useful for one-off operations.
1165
+ rpc TriggerWorkflowRule (TriggerWorkflowRuleRequest) returns (TriggerWorkflowRuleResponse) {
1166
+ option (google.api.http) = {
1167
+ post: "/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule"
1168
+ body: "*"
1169
+ additional_bindings {
1170
+ post: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule"
1171
+ body: "*"
1172
+ }
1173
+ };
1174
+ }
1175
+
1135
1176
  }
@@ -57,6 +57,8 @@ message Start {
57
57
  // (or not) during activity scheduling as the service can override the provided one in case its
58
58
  // values are not specified or exceed configured system limits.
59
59
  temporal.api.common.v1.RetryPolicy retry_policy = 16;
60
+ // Priority of this activity. Local activities will always have this field set to the default.
61
+ temporal.api.common.v1.Priority priority = 18;
60
62
 
61
63
  // Set to true if this is a local activity. Note that heartbeating does not apply to local
62
64
  // activities.
@@ -65,7 +67,19 @@ message Start {
65
67
 
66
68
  // Attempt to cancel a running activity
67
69
  message Cancel {
70
+ // Primary cancellation reason
68
71
  ActivityCancelReason reason = 1;
72
+ // Activity cancellation details, surfaces all cancellation reasons.
73
+ ActivityCancellationDetails details = 2;
74
+ }
75
+
76
+ message ActivityCancellationDetails {
77
+ bool is_not_found = 1;
78
+ bool is_cancelled = 2;
79
+ bool is_paused = 3;
80
+ bool is_timed_out = 4;
81
+ bool is_worker_shutdown = 5;
82
+ bool is_reset = 6;
69
83
  }
70
84
 
71
85
  enum ActivityCancelReason {
@@ -77,6 +91,10 @@ enum ActivityCancelReason {
77
91
  TIMED_OUT = 2;
78
92
  // Core is shutting down and the graceful timeout has elapsed
79
93
  WORKER_SHUTDOWN = 3;
94
+ // Activity was paused
95
+ PAUSED = 4;
96
+ // Activity was reset
97
+ RESET = 5;
80
98
  }
81
99
 
82
100
 
@@ -29,4 +29,9 @@ enum VersioningIntent {
29
29
  // Indicates that the command should run on the target task queue's current overall-default
30
30
  // build ID.
31
31
  DEFAULT = 2;
32
+ }
33
+
34
+ message WorkerDeploymentVersion {
35
+ string deployment_name = 1;
36
+ string build_id = 2;
32
37
  }
@@ -68,4 +68,19 @@ enum NexusTaskCancelReason {
68
68
  TIMED_OUT = 0;
69
69
  // The worker is shutting down
70
70
  WORKER_SHUTDOWN = 1;
71
- }
71
+ }
72
+
73
+ // Controls at which point to report back to lang when a nexus operation is cancelled
74
+ enum NexusOperationCancellationType {
75
+ // Wait for operation cancellation completion. Default.
76
+ WAIT_CANCELLATION_COMPLETED = 0;
77
+ // Do not request cancellation of the nexus operation if already scheduled
78
+ ABANDON = 1;
79
+
80
+ // Initiate a cancellation request for the Nexus operation and immediately report cancellation
81
+ // to the caller. Note that it doesn't guarantee that cancellation is delivered to the operation if calling workflow exits before the delivery is done.
82
+ // If you want to ensure that cancellation is delivered to the operation, use WAIT_CANCELLATION_REQUESTED.
83
+ TRY_CANCEL = 2;
84
+ // Request cancellation of the operation and wait for confirmation that the request was received.
85
+ WAIT_CANCELLATION_REQUESTED = 3;
86
+ }