@temporalio/core-bridge 1.13.0 → 1.13.2

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 (181) hide show
  1. package/Cargo.lock +239 -382
  2. package/Cargo.toml +11 -11
  3. package/lib/native.d.ts +10 -3
  4. package/package.json +3 -3
  5. package/releases/aarch64-apple-darwin/index.node +0 -0
  6. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  7. package/releases/x86_64-apple-darwin/index.node +0 -0
  8. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  9. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  10. package/sdk-core/.cargo/config.toml +71 -11
  11. package/sdk-core/.clippy.toml +1 -0
  12. package/sdk-core/.github/workflows/heavy.yml +2 -0
  13. package/sdk-core/.github/workflows/per-pr.yml +50 -18
  14. package/sdk-core/ARCHITECTURE.md +44 -48
  15. package/sdk-core/Cargo.toml +26 -7
  16. package/sdk-core/README.md +4 -0
  17. package/sdk-core/arch_docs/diagrams/TimerMachine_Coverage.puml +14 -0
  18. package/sdk-core/arch_docs/diagrams/initial_event_history.png +0 -0
  19. package/sdk-core/arch_docs/sdks_intro.md +299 -0
  20. package/sdk-core/client/Cargo.toml +8 -7
  21. package/sdk-core/client/src/callback_based.rs +1 -2
  22. package/sdk-core/client/src/lib.rs +485 -299
  23. package/sdk-core/client/src/metrics.rs +32 -8
  24. package/sdk-core/client/src/proxy.rs +124 -5
  25. package/sdk-core/client/src/raw.rs +598 -307
  26. package/sdk-core/client/src/replaceable.rs +253 -0
  27. package/sdk-core/client/src/retry.rs +9 -6
  28. package/sdk-core/client/src/worker_registry/mod.rs +19 -3
  29. package/sdk-core/client/src/workflow_handle/mod.rs +20 -17
  30. package/sdk-core/core/Cargo.toml +100 -31
  31. package/sdk-core/core/src/core_tests/activity_tasks.rs +55 -225
  32. package/sdk-core/core/src/core_tests/mod.rs +2 -8
  33. package/sdk-core/core/src/core_tests/queries.rs +3 -5
  34. package/sdk-core/core/src/core_tests/replay_flag.rs +3 -62
  35. package/sdk-core/core/src/core_tests/updates.rs +4 -5
  36. package/sdk-core/core/src/core_tests/workers.rs +4 -3
  37. package/sdk-core/core/src/core_tests/workflow_cancels.rs +10 -7
  38. package/sdk-core/core/src/core_tests/workflow_tasks.rs +28 -291
  39. package/sdk-core/core/src/ephemeral_server/mod.rs +15 -3
  40. package/sdk-core/core/src/internal_flags.rs +11 -1
  41. package/sdk-core/core/src/lib.rs +50 -36
  42. package/sdk-core/core/src/pollers/mod.rs +5 -5
  43. package/sdk-core/core/src/pollers/poll_buffer.rs +2 -2
  44. package/sdk-core/core/src/protosext/mod.rs +13 -5
  45. package/sdk-core/core/src/protosext/protocol_messages.rs +4 -11
  46. package/sdk-core/core/src/retry_logic.rs +256 -108
  47. package/sdk-core/core/src/telemetry/metrics.rs +1 -0
  48. package/sdk-core/core/src/telemetry/mod.rs +8 -2
  49. package/sdk-core/core/src/telemetry/prometheus_meter.rs +2 -2
  50. package/sdk-core/core/src/test_help/integ_helpers.rs +971 -0
  51. package/sdk-core/core/src/test_help/mod.rs +10 -1100
  52. package/sdk-core/core/src/test_help/unit_helpers.rs +218 -0
  53. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +42 -6
  54. package/sdk-core/core/src/worker/activities/local_activities.rs +19 -19
  55. package/sdk-core/core/src/worker/activities.rs +10 -3
  56. package/sdk-core/core/src/worker/client/mocks.rs +3 -3
  57. package/sdk-core/core/src/worker/client.rs +130 -93
  58. package/sdk-core/core/src/worker/heartbeat.rs +12 -13
  59. package/sdk-core/core/src/worker/mod.rs +31 -21
  60. package/sdk-core/core/src/worker/nexus.rs +14 -3
  61. package/sdk-core/core/src/worker/slot_provider.rs +9 -0
  62. package/sdk-core/core/src/worker/tuner.rs +159 -0
  63. package/sdk-core/core/src/worker/workflow/history_update.rs +3 -265
  64. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +1 -54
  65. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +0 -82
  66. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +0 -67
  67. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -192
  68. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +0 -43
  69. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +6 -554
  70. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +0 -71
  71. package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +102 -3
  72. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +10 -539
  73. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +0 -139
  74. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +1 -119
  75. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +6 -63
  76. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +9 -4
  77. package/sdk-core/core/src/worker/workflow/mod.rs +5 -1
  78. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +8 -3
  79. package/sdk-core/core-api/Cargo.toml +4 -4
  80. package/sdk-core/core-api/src/envconfig.rs +153 -54
  81. package/sdk-core/core-api/src/lib.rs +68 -0
  82. package/sdk-core/core-api/src/telemetry/metrics.rs +2 -1
  83. package/sdk-core/core-api/src/telemetry.rs +13 -0
  84. package/sdk-core/core-c-bridge/Cargo.toml +13 -8
  85. package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +184 -22
  86. package/sdk-core/core-c-bridge/src/client.rs +462 -184
  87. package/sdk-core/core-c-bridge/src/envconfig.rs +314 -0
  88. package/sdk-core/core-c-bridge/src/lib.rs +1 -0
  89. package/sdk-core/core-c-bridge/src/random.rs +4 -4
  90. package/sdk-core/core-c-bridge/src/runtime.rs +22 -23
  91. package/sdk-core/core-c-bridge/src/testing.rs +1 -4
  92. package/sdk-core/core-c-bridge/src/tests/context.rs +31 -31
  93. package/sdk-core/core-c-bridge/src/tests/mod.rs +32 -28
  94. package/sdk-core/core-c-bridge/src/tests/utils.rs +7 -7
  95. package/sdk-core/core-c-bridge/src/worker.rs +319 -66
  96. package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +6 -1
  97. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +5 -5
  98. package/sdk-core/sdk/Cargo.toml +8 -2
  99. package/sdk-core/sdk/src/activity_context.rs +1 -1
  100. package/sdk-core/sdk/src/app_data.rs +1 -1
  101. package/sdk-core/sdk/src/interceptors.rs +1 -4
  102. package/sdk-core/sdk/src/lib.rs +1 -5
  103. package/sdk-core/sdk/src/workflow_context/options.rs +10 -1
  104. package/sdk-core/sdk/src/workflow_future.rs +1 -1
  105. package/sdk-core/sdk-core-protos/Cargo.toml +6 -6
  106. package/sdk-core/sdk-core-protos/build.rs +10 -23
  107. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/create-release.yml +9 -1
  108. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +254 -5
  109. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +234 -5
  110. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +1 -1
  111. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +6 -0
  112. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +6 -2
  113. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +60 -2
  114. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +30 -6
  115. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +2 -0
  116. package/sdk-core/{test-utils → sdk-core-protos}/src/canned_histories.rs +5 -5
  117. package/sdk-core/sdk-core-protos/src/history_builder.rs +2 -2
  118. package/sdk-core/sdk-core-protos/src/lib.rs +25 -9
  119. package/sdk-core/sdk-core-protos/src/test_utils.rs +89 -0
  120. package/sdk-core/sdk-core-protos/src/utilities.rs +14 -5
  121. package/sdk-core/tests/c_bridge_smoke_test.c +10 -0
  122. package/sdk-core/tests/cloud_tests.rs +10 -8
  123. package/sdk-core/tests/common/http_proxy.rs +134 -0
  124. package/sdk-core/{test-utils/src/lib.rs → tests/common/mod.rs} +214 -281
  125. package/sdk-core/{test-utils/src → tests/common}/workflows.rs +4 -3
  126. package/sdk-core/tests/fuzzy_workflow.rs +1 -1
  127. package/sdk-core/tests/global_metric_tests.rs +8 -7
  128. package/sdk-core/tests/heavy_tests.rs +7 -3
  129. package/sdk-core/tests/integ_tests/client_tests.rs +111 -24
  130. package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +14 -9
  131. package/sdk-core/tests/integ_tests/heartbeat_tests.rs +4 -4
  132. package/sdk-core/tests/integ_tests/metrics_tests.rs +114 -14
  133. package/sdk-core/tests/integ_tests/pagination_tests.rs +273 -0
  134. package/sdk-core/tests/integ_tests/polling_tests.rs +311 -93
  135. package/sdk-core/tests/integ_tests/queries_tests.rs +4 -4
  136. package/sdk-core/tests/integ_tests/update_tests.rs +13 -7
  137. package/sdk-core/tests/integ_tests/visibility_tests.rs +26 -9
  138. package/sdk-core/tests/integ_tests/worker_tests.rs +668 -13
  139. package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +40 -24
  140. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +244 -11
  141. package/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +1 -1
  142. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +78 -2
  143. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +61 -2
  144. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +465 -7
  145. package/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +41 -2
  146. package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +315 -3
  147. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +1 -1
  148. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1990 -14
  149. package/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +65 -2
  150. package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +123 -23
  151. package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +525 -3
  152. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +65 -16
  153. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +32 -23
  154. package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +126 -5
  155. package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +1 -2
  156. package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +124 -8
  157. package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +62 -2
  158. package/sdk-core/tests/integ_tests/workflow_tests.rs +67 -8
  159. package/sdk-core/tests/main.rs +26 -17
  160. package/sdk-core/tests/manual_tests.rs +5 -1
  161. package/sdk-core/tests/runner.rs +22 -40
  162. package/sdk-core/tests/shared_tests/mod.rs +1 -1
  163. package/sdk-core/tests/shared_tests/priority.rs +1 -1
  164. package/sdk-core/{core/benches/workflow_replay.rs → tests/workflow_replay_bench.rs} +10 -5
  165. package/src/client.rs +97 -20
  166. package/src/helpers/callbacks.rs +4 -4
  167. package/src/helpers/errors.rs +7 -1
  168. package/src/helpers/handles.rs +1 -0
  169. package/src/helpers/try_from_js.rs +4 -3
  170. package/src/lib.rs +3 -2
  171. package/src/metrics.rs +3 -0
  172. package/src/runtime.rs +5 -2
  173. package/src/worker.rs +9 -12
  174. package/ts/native.ts +13 -3
  175. package/sdk-core/arch_docs/diagrams/workflow_internals.svg +0 -1
  176. package/sdk-core/core/src/core_tests/child_workflows.rs +0 -281
  177. package/sdk-core/core/src/core_tests/determinism.rs +0 -318
  178. package/sdk-core/core/src/core_tests/local_activities.rs +0 -1442
  179. package/sdk-core/test-utils/Cargo.toml +0 -38
  180. package/sdk-core/test-utils/src/histfetch.rs +0 -28
  181. package/sdk-core/test-utils/src/interceptors.rs +0 -46
@@ -1914,6 +1914,44 @@ paths:
1914
1914
  application/json:
1915
1915
  schema:
1916
1916
  $ref: '#/components/schemas/Status'
1917
+ /api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager:
1918
+ post:
1919
+ tags:
1920
+ - WorkflowService
1921
+ description: |-
1922
+ Set/unset the ManagerIdentity of a Worker Deployment.
1923
+ Experimental. This API might significantly change or be removed in a future release.
1924
+ operationId: SetWorkerDeploymentManager
1925
+ parameters:
1926
+ - name: namespace
1927
+ in: path
1928
+ required: true
1929
+ schema:
1930
+ type: string
1931
+ - name: deploymentName
1932
+ in: path
1933
+ required: true
1934
+ schema:
1935
+ type: string
1936
+ requestBody:
1937
+ content:
1938
+ application/json:
1939
+ schema:
1940
+ $ref: '#/components/schemas/SetWorkerDeploymentManagerRequest'
1941
+ required: true
1942
+ responses:
1943
+ "200":
1944
+ description: OK
1945
+ content:
1946
+ application/json:
1947
+ schema:
1948
+ $ref: '#/components/schemas/SetWorkerDeploymentManagerResponse'
1949
+ default:
1950
+ description: Default error response
1951
+ content:
1952
+ application/json:
1953
+ schema:
1954
+ $ref: '#/components/schemas/Status'
1917
1955
  /api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version:
1918
1956
  post:
1919
1957
  tags:
@@ -2087,6 +2125,38 @@ paths:
2087
2125
  application/json:
2088
2126
  schema:
2089
2127
  $ref: '#/components/schemas/Status'
2128
+ /api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}:
2129
+ get:
2130
+ tags:
2131
+ - WorkflowService
2132
+ description: DescribeWorker returns information about the specified worker.
2133
+ operationId: DescribeWorker
2134
+ parameters:
2135
+ - name: namespace
2136
+ in: path
2137
+ description: Namespace this worker belongs to.
2138
+ required: true
2139
+ schema:
2140
+ type: string
2141
+ - name: workerInstanceKey
2142
+ in: path
2143
+ description: Worker instance key to describe.
2144
+ required: true
2145
+ schema:
2146
+ type: string
2147
+ responses:
2148
+ "200":
2149
+ description: OK
2150
+ content:
2151
+ application/json:
2152
+ schema:
2153
+ $ref: '#/components/schemas/DescribeWorkerResponse'
2154
+ default:
2155
+ description: Default error response
2156
+ content:
2157
+ application/json:
2158
+ schema:
2159
+ $ref: '#/components/schemas/Status'
2090
2160
  /api/v1/namespaces/{namespace}/workers/fetch-config:
2091
2161
  post:
2092
2162
  tags:
@@ -2540,7 +2610,10 @@ paths:
2540
2610
  get:
2541
2611
  tags:
2542
2612
  - WorkflowService
2543
- description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service."
2613
+ description: |-
2614
+ GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
2615
+ order (starting from last event). Fails with`NotFound` if the specified workflow execution is
2616
+ unknown to the service.
2544
2617
  operationId: GetWorkflowExecutionHistoryReverse
2545
2618
  parameters:
2546
2619
  - name: namespace
@@ -5265,6 +5338,44 @@ paths:
5265
5338
  application/json:
5266
5339
  schema:
5267
5340
  $ref: '#/components/schemas/Status'
5341
+ /namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager:
5342
+ post:
5343
+ tags:
5344
+ - WorkflowService
5345
+ description: |-
5346
+ Set/unset the ManagerIdentity of a Worker Deployment.
5347
+ Experimental. This API might significantly change or be removed in a future release.
5348
+ operationId: SetWorkerDeploymentManager
5349
+ parameters:
5350
+ - name: namespace
5351
+ in: path
5352
+ required: true
5353
+ schema:
5354
+ type: string
5355
+ - name: deploymentName
5356
+ in: path
5357
+ required: true
5358
+ schema:
5359
+ type: string
5360
+ requestBody:
5361
+ content:
5362
+ application/json:
5363
+ schema:
5364
+ $ref: '#/components/schemas/SetWorkerDeploymentManagerRequest'
5365
+ required: true
5366
+ responses:
5367
+ "200":
5368
+ description: OK
5369
+ content:
5370
+ application/json:
5371
+ schema:
5372
+ $ref: '#/components/schemas/SetWorkerDeploymentManagerResponse'
5373
+ default:
5374
+ description: Default error response
5375
+ content:
5376
+ application/json:
5377
+ schema:
5378
+ $ref: '#/components/schemas/Status'
5268
5379
  /namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version:
5269
5380
  post:
5270
5381
  tags:
@@ -5438,6 +5549,38 @@ paths:
5438
5549
  application/json:
5439
5550
  schema:
5440
5551
  $ref: '#/components/schemas/Status'
5552
+ /namespaces/{namespace}/workers/describe/{workerInstanceKey}:
5553
+ get:
5554
+ tags:
5555
+ - WorkflowService
5556
+ description: DescribeWorker returns information about the specified worker.
5557
+ operationId: DescribeWorker
5558
+ parameters:
5559
+ - name: namespace
5560
+ in: path
5561
+ description: Namespace this worker belongs to.
5562
+ required: true
5563
+ schema:
5564
+ type: string
5565
+ - name: workerInstanceKey
5566
+ in: path
5567
+ description: Worker instance key to describe.
5568
+ required: true
5569
+ schema:
5570
+ type: string
5571
+ responses:
5572
+ "200":
5573
+ description: OK
5574
+ content:
5575
+ application/json:
5576
+ schema:
5577
+ $ref: '#/components/schemas/DescribeWorkerResponse'
5578
+ default:
5579
+ description: Default error response
5580
+ content:
5581
+ application/json:
5582
+ schema:
5583
+ $ref: '#/components/schemas/Status'
5441
5584
  /namespaces/{namespace}/workers/fetch-config:
5442
5585
  post:
5443
5586
  tags:
@@ -5891,7 +6034,10 @@ paths:
5891
6034
  get:
5892
6035
  tags:
5893
6036
  - WorkflowService
5894
- description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service."
6037
+ description: |-
6038
+ GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
6039
+ order (starting from last event). Fails with`NotFound` if the specified workflow execution is
6040
+ unknown to the service.
5895
6041
  operationId: GetWorkflowExecutionHistoryReverse
5896
6042
  parameters:
5897
6043
  - name: namespace
@@ -7921,6 +8067,11 @@ components:
7921
8067
  Only set if `report_task_queue_stats` is set to true in the request.
7922
8068
  (-- api-linter: core::0140::prepositions=disabled
7923
8069
  aip.dev/not-precedent: "by" is used to clarify the key. --)
8070
+ DescribeWorkerResponse:
8071
+ type: object
8072
+ properties:
8073
+ workerInfo:
8074
+ $ref: '#/components/schemas/WorkerInfo'
7924
8075
  DescribeWorkflowExecutionResponse:
7925
8076
  type: object
7926
8077
  properties:
@@ -8242,6 +8393,10 @@ components:
8242
8393
  type: string
8243
8394
  visibilityStore:
8244
8395
  type: string
8396
+ initialFailoverVersion:
8397
+ type: string
8398
+ failoverVersionIncrement:
8399
+ type: string
8245
8400
  description: GetClusterInfoResponse contains information about Temporal cluster.
8246
8401
  GetCurrentDeploymentResponse:
8247
8402
  type: object
@@ -9055,6 +9210,12 @@ components:
9055
9210
  asyncUpdate:
9056
9211
  type: boolean
9057
9212
  description: True if the namespace supports async update
9213
+ workerHeartbeats:
9214
+ type: boolean
9215
+ description: True if the namespace supports worker heartbeats
9216
+ reportedProblemsSearchAttribute:
9217
+ type: boolean
9218
+ description: True if the namespace supports reported problems search attribute
9058
9219
  description: Namespace capability details. Should contain what features are enabled in a namespace.
9059
9220
  NamespaceReplicationConfig:
9060
9221
  type: object
@@ -9461,7 +9622,9 @@ components:
9461
9622
  description: Only the activity with this ID will be paused.
9462
9623
  type:
9463
9624
  type: string
9464
- description: Pause all running activities of this type.
9625
+ description: |-
9626
+ Pause all running activities of this type.
9627
+ Note: Experimental - the behavior of pause by activity type might change in a future release.
9465
9628
  reason:
9466
9629
  type: string
9467
9630
  description: Reason to pause the activity.
@@ -9939,7 +10102,7 @@ components:
9939
10102
  configuration, and defaults to 5.
9940
10103
 
9941
10104
  If priority is not present (or zero), then the effective priority will be
9942
- the default priority, which is is calculated by (min+max)/2. With the
10105
+ the default priority, which is calculated by (min+max)/2. With the
9943
10106
  default max of 5, and min of 1, that comes out to 3.
9944
10107
  format: int32
9945
10108
  fairnessKey:
@@ -11347,6 +11510,12 @@ components:
11347
11510
  needed. If the request is unexpectedly rejected due to missing pollers, then that means the
11348
11511
  pollers have not reached to the server yet. Only set this if you expect those pollers to
11349
11512
  never arrive.
11513
+ allowNoPollers:
11514
+ type: boolean
11515
+ description: |-
11516
+ Optional. By default this request will be rejected if no pollers have been seen for the proposed
11517
+ Current Version, in order to protect users from routing tasks to pollers that do not exist, leading
11518
+ to possible timeouts. Pass `true` here to bypass this protection.
11350
11519
  description: Set/unset the Current Version of a Worker Deployment.
11351
11520
  SetWorkerDeploymentCurrentVersionResponse:
11352
11521
  type: object
@@ -11365,6 +11534,46 @@ components:
11365
11534
  allOf:
11366
11535
  - $ref: '#/components/schemas/WorkerDeploymentVersion'
11367
11536
  description: The version that was current before executing this operation.
11537
+ SetWorkerDeploymentManagerRequest:
11538
+ type: object
11539
+ properties:
11540
+ namespace:
11541
+ type: string
11542
+ deploymentName:
11543
+ type: string
11544
+ managerIdentity:
11545
+ type: string
11546
+ description: |-
11547
+ Arbitrary value for `manager_identity`.
11548
+ Empty will unset the field.
11549
+ self:
11550
+ type: boolean
11551
+ description: True will set `manager_identity` to `identity`.
11552
+ conflictToken:
11553
+ type: string
11554
+ description: |-
11555
+ Optional. This can be the value of conflict_token from a Describe, or another Worker
11556
+ Deployment API. Passing a non-nil conflict token will cause this request to fail if the
11557
+ Deployment's configuration has been modified between the API call that generated the
11558
+ token and this one.
11559
+ format: bytes
11560
+ identity:
11561
+ type: string
11562
+ description: Required. The identity of the client who initiated this request.
11563
+ description: Update the ManagerIdentity of a Worker Deployment.
11564
+ SetWorkerDeploymentManagerResponse:
11565
+ type: object
11566
+ properties:
11567
+ conflictToken:
11568
+ type: string
11569
+ description: |-
11570
+ This value is returned so that it can be optionally passed to APIs
11571
+ that write to the Worker Deployment state to ensure that the state
11572
+ did not change between this API call and a future write.
11573
+ format: bytes
11574
+ previousManagerIdentity:
11575
+ type: string
11576
+ description: What the `manager_identity` field was before this change.
11368
11577
  SetWorkerDeploymentRampingVersionRequest:
11369
11578
  type: object
11370
11579
  properties:
@@ -11415,6 +11624,12 @@ components:
11415
11624
  Note: this check only happens when the ramping version is about to change, not every time
11416
11625
  that the percentage changes. Also note that the check is against the deployment's Current
11417
11626
  Version, not the previous Ramping Version.
11627
+ allowNoPollers:
11628
+ type: boolean
11629
+ description: |-
11630
+ Optional. By default this request will be rejected if no pollers have been seen for the proposed
11631
+ Current Version, in order to protect users from routing tasks to pollers that do not exist, leading
11632
+ to possible timeouts. Pass `true` here to bypass this protection.
11418
11633
  description: Set/unset the Ramping Version of a Worker Deployment and its ramp percentage.
11419
11634
  SetWorkerDeploymentRampingVersionResponse:
11420
11635
  type: object
@@ -11960,6 +12175,10 @@ components:
11960
12175
  allOf:
11961
12176
  - $ref: '#/components/schemas/Priority'
11962
12177
  description: Priority metadata
12178
+ eagerWorkerDeploymentOptions:
12179
+ allOf:
12180
+ - $ref: '#/components/schemas/WorkerDeploymentOptions'
12181
+ description: Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`.
11963
12182
  StartWorkflowExecutionResponse:
11964
12183
  type: object
11965
12184
  properties:
@@ -12551,7 +12770,10 @@ components:
12551
12770
  type: object
12552
12771
  additionalProperties:
12553
12772
  type: string
12554
- description: "A key-value map for any customized purpose.\n If data already exists on the namespace, \n this will merge with the existing key values."
12773
+ description: |-
12774
+ A key-value map for any customized purpose.
12775
+ If data already exists on the namespace,
12776
+ this will merge with the existing key values.
12555
12777
  state:
12556
12778
  enum:
12557
12779
  - NAMESPACE_STATE_UNSPECIFIED
@@ -13093,6 +13315,13 @@ components:
13093
13315
  Identity of the last client who modified the configuration of this Deployment. Set to the
13094
13316
  `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
13095
13317
  `SetWorkerDeploymentRampingVersion`.
13318
+ managerIdentity:
13319
+ type: string
13320
+ description: |-
13321
+ Identity of the client that has the exclusive right to make changes to this Worker Deployment.
13322
+ Empty by default.
13323
+ If this is set, clients whose identity does not match `manager_identity` will not be able to make changes
13324
+ to this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed.
13096
13325
  description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future."
13097
13326
  WorkerDeploymentInfo_WorkerDeploymentVersionSummary:
13098
13327
  type: object
@@ -280,7 +280,7 @@ message Priority {
280
280
  // configuration, and defaults to 5.
281
281
  //
282
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
283
+ // the default priority, which is calculated by (min+max)/2. With the
284
284
  // default max of 5, and min of 1, that comes out to 3.
285
285
  int32 priority_key = 1;
286
286
 
@@ -195,6 +195,12 @@ message WorkerDeploymentInfo {
195
195
  // `SetWorkerDeploymentRampingVersion`.
196
196
  string last_modifier_identity = 5;
197
197
 
198
+ // Identity of the client that has the exclusive right to make changes to this Worker Deployment.
199
+ // Empty by default.
200
+ // If this is set, clients whose identity does not match `manager_identity` will not be able to make changes
201
+ // to this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed.
202
+ string manager_identity = 6;
203
+
198
204
  message WorkerDeploymentVersionSummary {
199
205
  // Deprecated. Use `deployment_version`.
200
206
  string version = 1 [deprecated = true];
@@ -34,6 +34,10 @@ message NamespaceInfo {
34
34
  bool sync_update = 2;
35
35
  // True if the namespace supports async update
36
36
  bool async_update = 3;
37
+ // True if the namespace supports worker heartbeats
38
+ bool worker_heartbeats = 4;
39
+ // True if the namespace supports reported problems search attribute
40
+ bool reported_problems_search_attribute = 5;
37
41
  }
38
42
 
39
43
  // Whether scheduled workflows are supported on this namespace. This is only needed
@@ -68,8 +72,8 @@ message UpdateNamespaceInfo {
68
72
  string description = 1;
69
73
  string owner_email = 2;
70
74
  // A key-value map for any customized purpose.
71
- // If data already exists on the namespace,
72
- // this will merge with the existing key values.
75
+ // If data already exists on the namespace,
76
+ // this will merge with the existing key values.
73
77
  map<string, string> data = 3;
74
78
  // New namespace state, server will reject if transition is not allowed.
75
79
  // Allowed transitions are:
@@ -194,6 +194,8 @@ message StartWorkflowExecutionRequest {
194
194
  temporal.api.workflow.v1.OnConflictOptions on_conflict_options = 26;
195
195
  // Priority metadata
196
196
  temporal.api.common.v1.Priority priority = 27;
197
+ // Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`.
198
+ temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28;
197
199
  }
198
200
 
199
201
  message StartWorkflowExecutionResponse {
@@ -1157,6 +1159,8 @@ message GetClusterInfoResponse {
1157
1159
  int32 history_shard_count = 6;
1158
1160
  string persistence_store = 7;
1159
1161
  string visibility_store = 8;
1162
+ int64 initial_failover_version = 9;
1163
+ int64 failover_version_increment = 10;
1160
1164
  }
1161
1165
 
1162
1166
  message GetSystemInfoRequest {
@@ -1938,6 +1942,7 @@ message PauseActivityRequest {
1938
1942
  // Only the activity with this ID will be paused.
1939
1943
  string id = 4;
1940
1944
  // Pause all running activities of this type.
1945
+ // Note: Experimental - the behavior of pause by activity type might change in a future release.
1941
1946
  string type = 5;
1942
1947
  }
1943
1948
 
@@ -2163,6 +2168,10 @@ message SetWorkerDeploymentCurrentVersionRequest {
2163
2168
  // pollers have not reached to the server yet. Only set this if you expect those pollers to
2164
2169
  // never arrive.
2165
2170
  bool ignore_missing_task_queues = 6;
2171
+ // Optional. By default this request will be rejected if no pollers have been seen for the proposed
2172
+ // Current Version, in order to protect users from routing tasks to pollers that do not exist, leading
2173
+ // to possible timeouts. Pass `true` here to bypass this protection.
2174
+ bool allow_no_pollers = 9;
2166
2175
  }
2167
2176
 
2168
2177
  message SetWorkerDeploymentCurrentVersionResponse {
@@ -2215,6 +2224,10 @@ message SetWorkerDeploymentRampingVersionRequest {
2215
2224
  // that the percentage changes. Also note that the check is against the deployment's Current
2216
2225
  // Version, not the previous Ramping Version.
2217
2226
  bool ignore_missing_task_queues = 7;
2227
+ // Optional. By default this request will be rejected if no pollers have been seen for the proposed
2228
+ // Current Version, in order to protect users from routing tasks to pollers that do not exist, leading
2229
+ // to possible timeouts. Pass `true` here to bypass this protection.
2230
+ bool allow_no_pollers = 10;
2218
2231
  }
2219
2232
 
2220
2233
  message SetWorkerDeploymentRampingVersionResponse {
@@ -2248,8 +2261,8 @@ message ListWorkerDeploymentsResponse {
2248
2261
  google.protobuf.Timestamp create_time = 2;
2249
2262
  temporal.api.deployment.v1.RoutingConfig routing_config = 3;
2250
2263
  // Summary of the version that was added most recently in the Worker Deployment.
2251
- temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4;
2252
- // Summary of the current version of the Worker Deployment.
2264
+ temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4;
2265
+ // Summary of the current version of the Worker Deployment.
2253
2266
  temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary current_version_summary = 5;
2254
2267
  // Summary of the ramping version of the Worker Deployment.
2255
2268
  temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary ramping_version_summary = 6;
@@ -2309,6 +2322,39 @@ message UpdateWorkerDeploymentVersionMetadataResponse {
2309
2322
  temporal.api.deployment.v1.VersionMetadata metadata = 1;
2310
2323
  }
2311
2324
 
2325
+ // Update the ManagerIdentity of a Worker Deployment.
2326
+ message SetWorkerDeploymentManagerRequest {
2327
+ string namespace = 1;
2328
+ string deployment_name = 2;
2329
+
2330
+ oneof new_manager_identity {
2331
+ // Arbitrary value for `manager_identity`.
2332
+ // Empty will unset the field.
2333
+ string manager_identity = 3;
2334
+
2335
+ // True will set `manager_identity` to `identity`.
2336
+ bool self = 4;
2337
+ }
2338
+
2339
+ // Optional. This can be the value of conflict_token from a Describe, or another Worker
2340
+ // Deployment API. Passing a non-nil conflict token will cause this request to fail if the
2341
+ // Deployment's configuration has been modified between the API call that generated the
2342
+ // token and this one.
2343
+ bytes conflict_token = 5;
2344
+
2345
+ // Required. The identity of the client who initiated this request.
2346
+ string identity = 6;
2347
+ }
2348
+
2349
+ message SetWorkerDeploymentManagerResponse {
2350
+ // This value is returned so that it can be optionally passed to APIs
2351
+ // that write to the Worker Deployment state to ensure that the state
2352
+ // did not change between this API call and a future write.
2353
+ bytes conflict_token = 1;
2354
+
2355
+ // What the `manager_identity` field was before this change.
2356
+ string previous_manager_identity = 2;
2357
+ }
2312
2358
 
2313
2359
  // Returns the Current Deployment of a deployment series.
2314
2360
  // [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later
@@ -2537,3 +2583,15 @@ message UpdateWorkerConfigResponse {
2537
2583
  // Once we support sending update to a multiple workers - it will be converted into a batch job, and job id will be returned.
2538
2584
  }
2539
2585
  }
2586
+
2587
+ message DescribeWorkerRequest {
2588
+ // Namespace this worker belongs to.
2589
+ string namespace = 1;
2590
+
2591
+ // Worker instance key to describe.
2592
+ string worker_instance_key = 2;
2593
+ }
2594
+
2595
+ message DescribeWorkerResponse {
2596
+ temporal.api.worker.v1.WorkerInfo worker_info = 1;
2597
+ }
@@ -133,9 +133,9 @@ service WorkflowService {
133
133
  }
134
134
  };
135
135
  }
136
-
137
- // GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
138
- // order (starting from last event). Fails with`NotFound` if the specified workflow execution is
136
+
137
+ // GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
138
+ // order (starting from last event). Fails with`NotFound` if the specified workflow execution is
139
139
  // unknown to the service.
140
140
  rpc GetWorkflowExecutionHistoryReverse (GetWorkflowExecutionHistoryReverseRequest) returns (GetWorkflowExecutionHistoryReverseResponse) {
141
141
  option (google.api.http) = {
@@ -458,7 +458,8 @@ service WorkflowService {
458
458
  };
459
459
  }
460
460
 
461
- // ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order.
461
+ // ScanWorkflowExecutions _was_ a visibility API to list large amount of workflow executions in a specific namespace without order.
462
+ // It has since been deprecated in favor of `ListWorkflowExecutions` and rewritten to use `ListWorkflowExecutions` internally.
462
463
  //
463
464
  // Deprecated: Replaced with `ListWorkflowExecutions`.
464
465
  // (-- api-linter: core::0127::http-annotation=disabled
@@ -669,8 +670,8 @@ service WorkflowService {
669
670
  // members are compatible with one another.
670
671
  //
671
672
  // A single build id may be mapped to multiple task queues using this API for cases where a single process hosts
672
- // multiple workers.
673
- //
673
+ // multiple workers.
674
+ //
674
675
  // To query which workers can be retired, use the `GetWorkerTaskReachability` API.
675
676
  //
676
677
  // NOTE: The number of task queues mapped to a single build id is limited by the `limit.taskQueuesPerBuildId`
@@ -923,6 +924,19 @@ service WorkflowService {
923
924
  };
924
925
  }
925
926
 
927
+ // Set/unset the ManagerIdentity of a Worker Deployment.
928
+ // Experimental. This API might significantly change or be removed in a future release.
929
+ rpc SetWorkerDeploymentManager (SetWorkerDeploymentManagerRequest) returns (SetWorkerDeploymentManagerResponse) {
930
+ option (google.api.http) = {
931
+ post: "/namespaces/{namespace}/worker-deployments/{deployment_name}/set-manager"
932
+ body: "*"
933
+ additional_bindings {
934
+ post: "/api/v1/namespaces/{namespace}/worker-deployments/{deployment_name}/set-manager"
935
+ body: "*"
936
+ }
937
+ };
938
+ }
939
+
926
940
  // Invokes the specified Update function on user Workflow code.
927
941
  rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) {
928
942
  option (google.api.http) = {
@@ -1235,4 +1249,14 @@ service WorkflowService {
1235
1249
  }
1236
1250
  };
1237
1251
  }
1252
+
1253
+ // DescribeWorker returns information about the specified worker.
1254
+ rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) {
1255
+ option (google.api.http) = {
1256
+ get: "/namespaces/{namespace}/workers/describe/{worker_instance_key}"
1257
+ additional_bindings {
1258
+ get: "/api/v1/namespaces/{namespace}/workers/describe/{worker_instance_key}"
1259
+ }
1260
+ };
1261
+ }
1238
1262
  }
@@ -92,6 +92,8 @@ message WorkflowActivation {
92
92
  // build id, if this worker was using the deprecated Build ID-only
93
93
  // feature(s).
94
94
  common.WorkerDeploymentVersion deployment_version_for_current_task = 9;
95
+ // The last seen SDK version from the most recent WFT completed event
96
+ string last_sdk_version = 10;
95
97
  }
96
98
 
97
99
  message WorkflowActivationJob {
@@ -1,8 +1,5 @@
1
- use prost::Message;
2
- use rand::RngCore;
3
- use std::{fs::File, io::Write, path::PathBuf};
4
- use temporal_sdk_core::replay::TestHistoryBuilder;
5
- use temporal_sdk_core_protos::{
1
+ use crate::{
2
+ TestHistoryBuilder,
6
3
  coresdk::common::NamespacedWorkflowExecution,
7
4
  temporal::api::{
8
5
  common::v1::{Payload, WorkflowExecution},
@@ -11,6 +8,9 @@ use temporal_sdk_core_protos::{
11
8
  history::v1::*,
12
9
  },
13
10
  };
11
+ use prost::Message;
12
+ use rand::RngCore;
13
+ use std::{fs::File, io::Write, path::PathBuf};
14
14
 
15
15
  /// 1: EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
16
16
  /// 2: EVENT_TYPE_WORKFLOW_TASK_SCHEDULED
@@ -23,7 +23,7 @@ use crate::{
23
23
  },
24
24
  };
25
25
  use anyhow::bail;
26
- use prost_wkt_types::Timestamp;
26
+ use prost_types::Timestamp;
27
27
  use std::{
28
28
  collections::HashMap,
29
29
  time::{Duration, SystemTime},
@@ -621,7 +621,7 @@ fn default_attribs(et: EventType) -> Result<Attributes> {
621
621
  EventType::WorkflowExecutionStarted => default_wes_attribs().into(),
622
622
  EventType::WorkflowTaskScheduled => WorkflowTaskScheduledEventAttributes::default().into(),
623
623
  EventType::TimerStarted => TimerStartedEventAttributes::default().into(),
624
- _ => bail!("Don't know how to construct default attrs for {:?}", et),
624
+ _ => bail!("Don't know how to construct default attrs for {et:?}"),
625
625
  })
626
626
  }
627
627