@temporalio/core-bridge 1.11.7 → 1.11.8

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 (191) hide show
  1. package/Cargo.lock +504 -341
  2. package/package.json +3 -3
  3. package/releases/aarch64-apple-darwin/index.node +0 -0
  4. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  5. package/releases/x86_64-apple-darwin/index.node +0 -0
  6. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  7. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  8. package/sdk-core/.cargo/config.toml +5 -0
  9. package/sdk-core/.github/workflows/per-pr.yml +59 -5
  10. package/sdk-core/Cargo.toml +3 -2
  11. package/sdk-core/client/Cargo.toml +3 -3
  12. package/sdk-core/client/src/lib.rs +154 -161
  13. package/sdk-core/client/src/metrics.rs +15 -8
  14. package/sdk-core/client/src/proxy.rs +1 -1
  15. package/sdk-core/client/src/raw.rs +176 -33
  16. package/sdk-core/client/src/retry.rs +102 -465
  17. package/sdk-core/client/src/worker_registry/mod.rs +2 -2
  18. package/sdk-core/client/src/workflow_handle/mod.rs +19 -1
  19. package/sdk-core/core/Cargo.toml +12 -14
  20. package/sdk-core/core/benches/workflow_replay.rs +1 -1
  21. package/sdk-core/core/src/abstractions.rs +2 -2
  22. package/sdk-core/core/src/core_tests/activity_tasks.rs +99 -46
  23. package/sdk-core/core/src/core_tests/child_workflows.rs +68 -9
  24. package/sdk-core/core/src/core_tests/determinism.rs +2 -2
  25. package/sdk-core/core/src/core_tests/local_activities.rs +20 -33
  26. package/sdk-core/core/src/core_tests/mod.rs +7 -8
  27. package/sdk-core/core/src/core_tests/queries.rs +79 -79
  28. package/sdk-core/core/src/core_tests/replay_flag.rs +5 -5
  29. package/sdk-core/core/src/core_tests/updates.rs +6 -6
  30. package/sdk-core/core/src/core_tests/workers.rs +19 -22
  31. package/sdk-core/core/src/core_tests/workflow_cancels.rs +3 -3
  32. package/sdk-core/core/src/core_tests/workflow_tasks.rs +154 -106
  33. package/sdk-core/core/src/ephemeral_server/mod.rs +66 -10
  34. package/sdk-core/core/src/internal_flags.rs +103 -12
  35. package/sdk-core/core/src/lib.rs +21 -13
  36. package/sdk-core/core/src/pollers/mod.rs +200 -6
  37. package/sdk-core/core/src/pollers/poll_buffer.rs +32 -8
  38. package/sdk-core/core/src/protosext/mod.rs +7 -7
  39. package/sdk-core/core/src/protosext/protocol_messages.rs +2 -2
  40. package/sdk-core/core/src/replay/mod.rs +8 -9
  41. package/sdk-core/core/src/retry_logic.rs +8 -6
  42. package/sdk-core/core/src/telemetry/log_export.rs +4 -4
  43. package/sdk-core/core/src/telemetry/metrics.rs +111 -25
  44. package/sdk-core/core/src/telemetry/mod.rs +11 -4
  45. package/sdk-core/core/src/telemetry/otel.rs +108 -144
  46. package/sdk-core/core/src/telemetry/prometheus_server.rs +1 -4
  47. package/sdk-core/core/src/test_help/mod.rs +27 -21
  48. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +7 -5
  49. package/sdk-core/core/src/worker/activities/local_activities.rs +9 -9
  50. package/sdk-core/core/src/worker/activities.rs +34 -46
  51. package/sdk-core/core/src/worker/client/mocks.rs +24 -2
  52. package/sdk-core/core/src/worker/client.rs +169 -33
  53. package/sdk-core/core/src/worker/mod.rs +132 -56
  54. package/sdk-core/core/src/worker/nexus.rs +410 -0
  55. package/sdk-core/core/src/worker/tuner/resource_based.rs +27 -5
  56. package/sdk-core/core/src/worker/tuner.rs +29 -2
  57. package/sdk-core/core/src/worker/workflow/driven_workflow.rs +8 -3
  58. package/sdk-core/core/src/worker/workflow/history_update.rs +5 -8
  59. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +83 -87
  60. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +38 -38
  61. package/sdk-core/core/src/worker/workflow/machines/cancel_nexus_op_state_machine.rs +117 -0
  62. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +8 -18
  63. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +114 -108
  64. package/sdk-core/core/src/worker/workflow/machines/complete_workflow_state_machine.rs +16 -31
  65. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +7 -14
  66. package/sdk-core/core/src/worker/workflow/machines/fail_workflow_state_machine.rs +8 -15
  67. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +34 -75
  68. package/sdk-core/core/src/worker/workflow/machines/mod.rs +26 -48
  69. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +10 -17
  70. package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +543 -0
  71. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +22 -31
  72. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +53 -51
  73. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +40 -45
  74. package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +2 -2
  75. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +8 -10
  76. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +24 -30
  77. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +182 -116
  78. package/sdk-core/core/src/worker/workflow/machines/workflow_task_state_machine.rs +4 -8
  79. package/sdk-core/core/src/worker/workflow/managed_run.rs +75 -45
  80. package/sdk-core/core/src/worker/workflow/mod.rs +104 -55
  81. package/sdk-core/core/src/worker/workflow/run_cache.rs +23 -4
  82. package/sdk-core/core/src/worker/workflow/wft_extraction.rs +4 -4
  83. package/sdk-core/core/src/worker/workflow/wft_poller.rs +3 -3
  84. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +32 -13
  85. package/sdk-core/core-api/Cargo.toml +2 -3
  86. package/sdk-core/core-api/src/errors.rs +22 -20
  87. package/sdk-core/core-api/src/lib.rs +24 -5
  88. package/sdk-core/core-api/src/telemetry/metrics.rs +27 -1
  89. package/sdk-core/core-api/src/telemetry.rs +37 -3
  90. package/sdk-core/core-api/src/worker.rs +36 -3
  91. package/sdk-core/docker/docker-compose-ci.yaml +25 -0
  92. package/sdk-core/etc/otel-collector-ci.yaml +36 -0
  93. package/sdk-core/etc/otel-collector-config.yaml +3 -3
  94. package/sdk-core/etc/prometheus.yaml +1 -1
  95. package/sdk-core/fsm/Cargo.toml +1 -1
  96. package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +1 -1
  97. package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +3 -4
  98. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +1 -1
  99. package/sdk-core/fsm/rustfsm_trait/Cargo.toml +1 -1
  100. package/sdk-core/sdk/Cargo.toml +1 -2
  101. package/sdk-core/sdk/src/activity_context.rs +1 -1
  102. package/sdk-core/sdk/src/interceptors.rs +1 -1
  103. package/sdk-core/sdk/src/lib.rs +126 -54
  104. package/sdk-core/sdk/src/workflow_context/options.rs +184 -74
  105. package/sdk-core/sdk/src/workflow_context.rs +193 -79
  106. package/sdk-core/sdk/src/workflow_future.rs +151 -131
  107. package/sdk-core/sdk-core-protos/Cargo.toml +3 -4
  108. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -1
  109. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/account/v1/message.proto +46 -0
  110. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +254 -5
  111. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +108 -2
  112. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +94 -15
  113. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +102 -4
  114. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +84 -0
  115. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +25 -10
  116. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +14 -1
  117. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/resource/v1/message.proto +25 -0
  118. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/sink/v1/message.proto +41 -0
  119. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/usage/v1/message.proto +59 -0
  120. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +2 -0
  121. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/create-release.yml +135 -0
  122. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/push-to-buf.yml +20 -0
  123. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/trigger-api-go-delete-release.yml +13 -0
  124. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/trigger-api-go-publish-release.yml +13 -0
  125. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +13 -21
  126. package/sdk-core/sdk-core-protos/protos/api_upstream/Makefile +2 -2
  127. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +1 -0
  128. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +3386 -1047
  129. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +3529 -1144
  130. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +39 -1
  131. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +6 -0
  132. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +39 -1
  133. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +252 -0
  134. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +1 -0
  135. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +6 -0
  136. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/deployment.proto +96 -0
  137. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/event_type.proto +2 -0
  138. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
  139. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/nexus.proto +42 -0
  140. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +2 -0
  141. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/workflow.proto +43 -2
  142. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/errordetails/v1/message.proto +13 -1
  143. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +14 -0
  144. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +70 -12
  145. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +12 -0
  146. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/query/v1/message.proto +9 -2
  147. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +46 -2
  148. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +206 -0
  149. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +482 -97
  150. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +230 -43
  151. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/core_interface.proto +6 -0
  152. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/nexus/nexus.proto +71 -0
  153. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +46 -2
  154. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +55 -9
  155. package/sdk-core/sdk-core-protos/src/history_builder.rs +5 -5
  156. package/sdk-core/sdk-core-protos/src/history_info.rs +5 -6
  157. package/sdk-core/sdk-core-protos/src/lib.rs +414 -34
  158. package/sdk-core/sdk-core-protos/src/task_token.rs +1 -1
  159. package/sdk-core/test-utils/Cargo.toml +3 -11
  160. package/sdk-core/test-utils/src/canned_histories.rs +1 -1
  161. package/sdk-core/test-utils/src/lib.rs +159 -85
  162. package/sdk-core/tests/fuzzy_workflow.rs +3 -3
  163. package/sdk-core/tests/heavy_tests.rs +3 -3
  164. package/sdk-core/tests/integ_tests/client_tests.rs +171 -20
  165. package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +45 -39
  166. package/sdk-core/tests/integ_tests/heartbeat_tests.rs +7 -6
  167. package/sdk-core/tests/integ_tests/metrics_tests.rs +492 -35
  168. package/sdk-core/tests/integ_tests/polling_tests.rs +7 -5
  169. package/sdk-core/tests/integ_tests/queries_tests.rs +14 -17
  170. package/sdk-core/tests/integ_tests/update_tests.rs +47 -44
  171. package/sdk-core/tests/integ_tests/visibility_tests.rs +4 -3
  172. package/sdk-core/tests/integ_tests/worker_tests.rs +5 -5
  173. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +15 -13
  174. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +28 -14
  175. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +7 -1
  176. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +57 -4
  177. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +1 -1
  178. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +24 -18
  179. package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +506 -0
  180. package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +1 -1
  181. package/sdk-core/tests/integ_tests/workflow_tests/priority.rs +104 -0
  182. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +34 -31
  183. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +1 -1
  184. package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +10 -7
  185. package/sdk-core/tests/integ_tests/workflow_tests.rs +152 -116
  186. package/sdk-core/tests/main.rs +36 -6
  187. package/sdk-core/tests/runner.rs +30 -9
  188. package/src/conversions/slot_supplier_bridge.rs +4 -0
  189. package/src/conversions.rs +1 -0
  190. package/src/worker.rs +5 -7
  191. package/sdk-core/core/src/worker/activities/activity_task_poller_stream.rs +0 -78
@@ -39,6 +39,7 @@ import "temporal/api/common/v1/message.proto";
39
39
 
40
40
  import "temporal/api/enums/v1/failed_cause.proto";
41
41
  import "temporal/api/enums/v1/namespace.proto";
42
+ import "temporal/api/failure/v1/message.proto";
42
43
 
43
44
  message NotFoundFailure {
44
45
  string current_cluster = 1;
@@ -56,6 +57,13 @@ message NamespaceNotActiveFailure {
56
57
  string active_cluster = 3;
57
58
  }
58
59
 
60
+ // NamespaceUnavailableFailure is returned by the service when a request addresses a namespace that is unavailable. For
61
+ // example, when a namespace is in the process of failing over between clusters.
62
+ // This is a transient error that should be automatically retried by clients.
63
+ message NamespaceUnavailableFailure {
64
+ string namespace = 1;
65
+ }
66
+
59
67
  message NamespaceInvalidStateFailure {
60
68
  string namespace = 1;
61
69
  // Current state of the requested namespace.
@@ -87,6 +95,10 @@ message CancellationAlreadyRequestedFailure {
87
95
  }
88
96
 
89
97
  message QueryFailedFailure {
98
+ // The full reason for this query failure. May not be available if the response is generated by an old
99
+ // SDK. This field can be encoded by the SDK's failure converter to support E2E encryption of messages and stack
100
+ // traces.
101
+ temporal.api.failure.v1.Failure failure = 1;
90
102
  }
91
103
 
92
104
  message PermissionDeniedFailure {
@@ -130,4 +142,4 @@ message MultiOperationExecutionFailure {
130
142
  string message = 2;
131
143
  repeated google.protobuf.Any details = 3;
132
144
  }
133
- }
145
+ }
@@ -33,6 +33,7 @@ option csharp_namespace = "Temporalio.Api.Failure.V1";
33
33
 
34
34
  import "temporal/api/common/v1/message.proto";
35
35
  import "temporal/api/enums/v1/workflow.proto";
36
+ import "temporal/api/enums/v1/nexus.proto";
36
37
 
37
38
  import "google/protobuf/duration.proto";
38
39
 
@@ -95,7 +96,19 @@ message NexusOperationFailureInfo {
95
96
  // Operation name.
96
97
  string operation = 4;
97
98
  // Operation ID - may be empty if the operation completed synchronously.
99
+ //
100
+ // Deprecated: Renamed to operation_token.
98
101
  string operation_id = 5;
102
+ // Operation token - may be empty if the operation completed synchronously.
103
+ string operation_token = 6;
104
+ }
105
+
106
+ message NexusHandlerFailureInfo {
107
+ // The Nexus error type as defined in the spec:
108
+ // https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
109
+ string type = 1;
110
+ // Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
111
+ temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;
99
112
  }
100
113
 
101
114
  message Failure {
@@ -131,6 +144,7 @@ message Failure {
131
144
  ActivityFailureInfo activity_failure_info = 11;
132
145
  ChildWorkflowExecutionFailureInfo child_workflow_execution_failure_info = 12;
133
146
  NexusOperationFailureInfo nexus_operation_execution_failure_info = 13;
147
+ NexusHandlerFailureInfo nexus_handler_failure_info = 14;
134
148
  }
135
149
  }
136
150
 
@@ -39,6 +39,7 @@ import "temporal/api/enums/v1/failed_cause.proto";
39
39
  import "temporal/api/enums/v1/update.proto";
40
40
  import "temporal/api/enums/v1/workflow.proto";
41
41
  import "temporal/api/common/v1/message.proto";
42
+ import "temporal/api/deployment/v1/message.proto";
42
43
  import "temporal/api/failure/v1/message.proto";
43
44
  import "temporal/api/taskqueue/v1/message.proto";
44
45
  import "temporal/api/update/v1/message.proto";
@@ -104,7 +105,7 @@ message WorkflowExecutionStartedEventAttributes {
104
105
  string workflow_id = 28;
105
106
  // If this workflow intends to use anything other than the current overall default version for
106
107
  // the queue, then we include it here.
107
- // Deprecated. use `inherited_build_id` instead
108
+ // Deprecated. [cleanup-experimental-wv]
108
109
  temporal.api.common.v1.WorkerVersionStamp source_version_stamp = 29;
109
110
  // Completion callbacks attached when this workflow was started.
110
111
  repeated temporal.api.common.v1.Callback completion_callbacks = 30;
@@ -128,7 +129,19 @@ message WorkflowExecutionStartedEventAttributes {
128
129
  // - The root workflow of W1 is W1 and the root workflow of W2 is W2.
129
130
  temporal.api.common.v1.WorkflowExecution root_workflow_execution = 31;
130
131
  // When present, this execution is assigned to the build ID of its parent or previous execution.
132
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
131
133
  string inherited_build_id = 32;
134
+ // Versioning override applied to this workflow when it was started.
135
+ temporal.api.workflow.v1.VersioningOverride versioning_override = 33;
136
+ // When present, it means this is a child workflow of a parent that is Pinned to this Worker
137
+ // Deployment Version. In this case, child workflow will start as Pinned to this Version instead
138
+ // of starting on the Current Version of its Task Queue.
139
+ // This is set only if the child workflow is starting on a Task Queue belonging to the same
140
+ // Worker Deployment Version.
141
+ string parent_pinned_worker_deployment_version = 34;
142
+
143
+ // Priority metadata
144
+ temporal.api.common.v1.Priority priority = 35;
132
145
  }
133
146
 
134
147
  message WorkflowExecutionCompletedEventAttributes {
@@ -215,9 +228,11 @@ message WorkflowTaskStartedEventAttributes {
215
228
  // just the event id of this event, so we don't include it explicitly here.
216
229
  int64 history_size_bytes = 5;
217
230
  // Version info of the worker to whom this task was dispatched.
231
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
218
232
  temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
219
233
  // Used by server internally to properly reapply build ID redirects to an execution
220
234
  // when rebuilding it from events.
235
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
221
236
  int64 build_id_redirect_counter = 7;
222
237
  }
223
238
 
@@ -233,7 +248,7 @@ message WorkflowTaskCompletedEventAttributes {
233
248
  // Version info of the worker who processed this workflow task. If present, the `build_id` field
234
249
  // within is also used as `binary_checksum`, which may be omitted in that case (it may also be
235
250
  // populated to preserve compatibility).
236
- // Deprecated. Use the info inside the corresponding WorkflowTaskStartedEvent
251
+ // Deprecated. Use `deployment` and `versioning_behavior` instead.
237
252
  temporal.api.common.v1.WorkerVersionStamp worker_version = 5;
238
253
  // Data the SDK wishes to record for itself, but server need not interpret, and does not
239
254
  // directly impact workflow state.
@@ -241,6 +256,24 @@ message WorkflowTaskCompletedEventAttributes {
241
256
 
242
257
  // Local usage data sent during workflow task completion and recorded here for posterity
243
258
  temporal.api.common.v1.MeteringMetadata metering_metadata = 13;
259
+
260
+ // The deployment that completed this task. May or may not be set for unversioned workers,
261
+ // depending on whether a value is sent by the SDK. This value updates workflow execution's
262
+ // `versioning_info.deployment`.
263
+ // Deprecated. Replaced with `worker_deployment_version`.
264
+ temporal.api.deployment.v1.Deployment deployment = 7 [deprecated = true];
265
+ // Versioning behavior sent by the worker that completed this task for this particular workflow
266
+ // execution. UNSPECIFIED means the task was completed by an unversioned worker. This value
267
+ // updates workflow execution's `versioning_info.behavior`.
268
+ temporal.api.enums.v1.VersioningBehavior versioning_behavior = 8;
269
+ // The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`
270
+ // is set. This value updates workflow execution's `versioning_info.version`.
271
+ // Experimental. Worker Deployments are experimental and might significantly change in the future.
272
+ string worker_deployment_version = 9;
273
+ // The name of Worker Deployment that completed this task. Must be set if `versioning_behavior`
274
+ // is set. This value updates workflow execution's `worker_deployment_name`.
275
+ // Experimental. Worker Deployments are experimental and might significantly change in the future.
276
+ string worker_deployment_name = 10;
244
277
  }
245
278
 
246
279
  message WorkflowTaskTimedOutEventAttributes {
@@ -318,6 +351,9 @@ message ActivityTaskScheduledEventAttributes {
318
351
  // If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,
319
352
  // Assignment rules of the activity's Task Queue will be used to determine the Build ID.
320
353
  bool use_workflow_build_id = 13;
354
+ // Priority metadata. If this message is not present, or any fields are not
355
+ // present, they inherit the values from the workflow.
356
+ temporal.api.common.v1.Priority priority = 14;
321
357
  }
322
358
 
323
359
  message ActivityTaskStartedEventAttributes {
@@ -333,9 +369,11 @@ message ActivityTaskStartedEventAttributes {
333
369
  // been retried.
334
370
  temporal.api.failure.v1.Failure last_failure = 5;
335
371
  // Version info of the worker to whom this task was dispatched.
372
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
336
373
  temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
337
374
  // Used by server internally to properly reapply build ID redirects to an execution
338
375
  // when rebuilding it from events.
376
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
339
377
  int64 build_id_redirect_counter = 7;
340
378
  }
341
379
 
@@ -472,8 +510,8 @@ message WorkflowExecutionSignaledEventAttributes {
472
510
  // Headers that were passed by the sender of the signal and copied by temporal
473
511
  // server into the workflow task.
474
512
  temporal.api.common.v1.Header header = 4;
475
- // Indicates the signal did not generate a new workflow task when received.
476
- bool skip_generate_workflow_task = 5;
513
+ // This field is deprecated and never respected. It should always be set to false.
514
+ bool skip_generate_workflow_task = 5 [deprecated = true];
477
515
  // When signal origin is a workflow execution, this field is set.
478
516
  temporal.api.common.v1.WorkflowExecution external_workflow_execution = 6;
479
517
  }
@@ -623,6 +661,8 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
623
661
  // If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment
624
662
  // rules of the child's Task Queue will be used to independently assign a Build ID to it.
625
663
  bool inherit_build_id = 19;
664
+ // Priority metadata
665
+ temporal.api.common.v1.Priority priority = 20;
626
666
  }
627
667
 
628
668
  message StartChildWorkflowExecutionFailedEventAttributes {
@@ -723,19 +763,30 @@ message ChildWorkflowExecutionTerminatedEventAttributes {
723
763
  int64 started_event_id = 5;
724
764
  }
725
765
 
766
+ message WorkflowExecutionOptionsUpdatedEventAttributes {
767
+ // Versioning override upserted in this event.
768
+ // Ignored if nil or if unset_versioning_override is true.
769
+ temporal.api.workflow.v1.VersioningOverride versioning_override = 1;
770
+ // Versioning override removed in this event.
771
+ bool unset_versioning_override = 2;
772
+ // Request ID attachedto the running workflow execution so that subsequent requests with same
773
+ // request ID will be deduped.
774
+ string attached_request_id = 3;
775
+ // Completion callbacks attached to the running workflow execution.
776
+ repeated temporal.api.common.v1.Callback attached_completion_callbacks = 4;
777
+ }
778
+
779
+ // Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes
726
780
  message WorkflowPropertiesModifiedExternallyEventAttributes {
727
- // If set to a nonempty string, future workflow tasks for this workflow shall be dispatched on
728
- // the provided queue.
781
+ // Not used.
729
782
  string new_task_queue = 1;
730
- // If set, update the workflow task timeout to this value.
783
+ // Not used.
731
784
  google.protobuf.Duration new_workflow_task_timeout = 2;
732
- // If set, update the workflow run timeout to this value. May be set to 0 for no timeout.
785
+ // Not used.
733
786
  google.protobuf.Duration new_workflow_run_timeout = 3;
734
- // If set, update the workflow execution timeout to this value. May be set to 0 for no timeout.
787
+ // Not used.
735
788
  google.protobuf.Duration new_workflow_execution_timeout = 4;
736
- // If set, update the workflow memo with the provided values. The values will be merged with
737
- // the existing memo. If the user wants to delete values, a default/empty Payload should be
738
- // used as the value for the key being deleted.
789
+ // Not used.
739
790
  temporal.api.common.v1.Memo upserted_memo = 5;
740
791
  }
741
792
 
@@ -838,10 +889,16 @@ message NexusOperationStartedEventAttributes {
838
889
  int64 scheduled_event_id = 1;
839
890
  // The operation ID returned by the Nexus handler in the response to the StartOperation request.
840
891
  // This ID is used when canceling the operation.
892
+ //
893
+ // Deprecated: Renamed to operation_token.
841
894
  string operation_id = 3;
842
895
 
843
896
  // The request ID allocated at schedule time.
844
897
  string request_id = 4;
898
+
899
+ // The operation token returned by the Nexus handler in the response to the StartOperation request.
900
+ // This token is used when canceling the operation.
901
+ string operation_token = 5;
845
902
  }
846
903
 
847
904
  // Nexus operation completed successfully.
@@ -980,6 +1037,7 @@ message HistoryEvent {
980
1037
  NexusOperationCanceledEventAttributes nexus_operation_canceled_event_attributes = 57;
981
1038
  NexusOperationTimedOutEventAttributes nexus_operation_timed_out_event_attributes = 58;
982
1039
  NexusOperationCancelRequestedEventAttributes nexus_operation_cancel_requested_event_attributes = 59;
1040
+ WorkflowExecutionOptionsUpdatedEventAttributes workflow_execution_options_updated_event_attributes = 60;
983
1041
  }
984
1042
  }
985
1043
 
@@ -31,12 +31,14 @@ option csharp_namespace = "Temporalio.Api.Nexus.V1";
31
31
 
32
32
  import "google/protobuf/timestamp.proto";
33
33
  import "temporal/api/common/v1/message.proto";
34
+ import "temporal/api/enums/v1/nexus.proto";
34
35
 
35
36
  // A general purpose failure message.
36
37
  // See: https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure
37
38
  message Failure {
38
39
  string message = 1;
39
40
  map<string, string> metadata = 2;
41
+ // UTF-8 encoded JSON serializable details.
40
42
  bytes details = 3;
41
43
  }
42
44
 
@@ -44,6 +46,8 @@ message HandlerError {
44
46
  // See https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
45
47
  string error_type = 1;
46
48
  Failure failure = 2;
49
+ // Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
50
+ temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 3;
47
51
  }
48
52
 
49
53
  message UnsuccessfulOperationError {
@@ -83,7 +87,12 @@ message CancelOperationRequest {
83
87
  // Type of operation to cancel.
84
88
  string operation = 2;
85
89
  // Operation ID as originally generated by a Handler.
90
+ //
91
+ // Deprecated: Renamed to operation_token.
86
92
  string operation_id = 3;
93
+
94
+ // Operation token as originally generated by a Handler.
95
+ string operation_token = 4;
87
96
  }
88
97
 
89
98
  // A Nexus request.
@@ -108,13 +117,16 @@ message StartOperationResponse {
108
117
  // An operation completed successfully.
109
118
  message Sync {
110
119
  temporal.api.common.v1.Payload payload = 1;
120
+ repeated Link links = 2;
111
121
  }
112
122
 
113
123
  // The operation will complete asynchronously.
114
124
  // The returned ID can be used to reference this operation.
115
125
  message Async {
126
+ // Deprecated: Renamed to operation_token.
116
127
  string operation_id = 1;
117
128
  repeated Link links = 2;
129
+ string operation_token = 3;
118
130
  }
119
131
 
120
132
  oneof variant {
@@ -34,6 +34,7 @@ option csharp_namespace = "Temporalio.Api.Query.V1";
34
34
  import "temporal/api/enums/v1/query.proto";
35
35
  import "temporal/api/enums/v1/workflow.proto";
36
36
  import "temporal/api/common/v1/message.proto";
37
+ import "temporal/api/failure/v1/message.proto";
37
38
 
38
39
  // See https://docs.temporal.io/docs/concepts/queries/
39
40
  message WorkflowQuery {
@@ -41,7 +42,7 @@ message WorkflowQuery {
41
42
  string query_type = 1;
42
43
  // Serialized arguments that will be provided to the query handler.
43
44
  temporal.api.common.v1.Payloads query_args = 2;
44
- // Headers that were passed by the caller of the query and copied by temporal
45
+ // Headers that were passed by the caller of the query and copied by temporal
45
46
  // server into the workflow task.
46
47
  temporal.api.common.v1.Header header = 3;
47
48
  }
@@ -50,10 +51,16 @@ message WorkflowQuery {
50
51
  message WorkflowQueryResult {
51
52
  // Did the query succeed or fail?
52
53
  temporal.api.enums.v1.QueryResultType result_type = 1;
53
- // Set when the query succeeds with the results
54
+ // Set when the query succeeds with the results.
55
+ // Mutually exclusive with `error_message` and `failure`.
54
56
  temporal.api.common.v1.Payloads answer = 2;
55
57
  // Mutually exclusive with `answer`. Set when the query fails.
58
+ // See also the newer `failure` field.
56
59
  string error_message = 3;
60
+ // The full reason for this query failure. This field is newer than `error_message` and can be encoded by the SDK's
61
+ // failure converter to support E2E encryption of messages and stack traces.
62
+ // Mutually exclusive with `answer`. Set when the query fails.
63
+ temporal.api.failure.v1.Failure failure = 4;
57
64
  }
58
65
 
59
66
  message QueryRejected {
@@ -37,6 +37,7 @@ import "google/protobuf/wrappers.proto";
37
37
 
38
38
  import "temporal/api/enums/v1/task_queue.proto";
39
39
  import "temporal/api/common/v1/message.proto";
40
+ import "temporal/api/deployment/v1/message.proto";
40
41
 
41
42
  // See https://docs.temporal.io/docs/concepts/task-queues/
42
43
  message TaskQueue {
@@ -54,6 +55,34 @@ message TaskQueueMetadata {
54
55
  google.protobuf.DoubleValue max_tasks_per_second = 1;
55
56
  }
56
57
 
58
+ // Experimental. Worker Deployments are experimental and might significantly change in the future.
59
+ message TaskQueueVersioningInfo {
60
+ // Always present. Specifies which Deployment Version should receive new workflow
61
+ // executions and tasks of existing unversioned or AutoUpgrade workflows.
62
+ // Can be one of the following:
63
+ // - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
64
+ // - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
65
+ // with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
66
+ // Note: Current Version is overridden by the Ramping Version for a portion of traffic when a ramp
67
+ // is set (see `ramping_version`.)
68
+ string current_version = 1;
69
+ // When present, it means the traffic is being shifted from the Current Version to the Ramping
70
+ // Version.
71
+ // Must always be different from `current_version`. Can be one of the following:
72
+ // - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
73
+ // - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
74
+ // with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
75
+ // Note that it is possible to ramp from one Version to another Version, or from unversioned
76
+ // workers to a particular Version, or from a particular Version to unversioned workers.
77
+ string ramping_version = 2;
78
+ // Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
79
+ // Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
80
+ // not yet "promoted" to be the Current Version, likely due to pending validations.
81
+ float ramping_version_percentage = 3;
82
+ // Last time versioning information of this Task Queue changed.
83
+ google.protobuf.Timestamp update_time = 4;
84
+ }
85
+
57
86
  // Used for specifying versions the caller is interested in.
58
87
  message TaskQueueVersionSelection {
59
88
  // Include specific Build IDs.
@@ -163,7 +192,10 @@ message PollerInfo {
163
192
  double rate_per_second = 3;
164
193
  // If a worker has opted into the worker versioning feature while polling, its capabilities will
165
194
  // appear here.
166
- temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 4;
195
+ // Deprecated. Replaced by deployment_options.
196
+ temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 4 [deprecated = true];
197
+ // Worker deployment options that SDK sent to server.
198
+ temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 5;
167
199
  }
168
200
 
169
201
  message StickyExecutionAttributes {
@@ -291,4 +323,16 @@ message TimestampedBuildIdAssignmentRule {
291
323
  message TimestampedCompatibleBuildIdRedirectRule {
292
324
  CompatibleBuildIdRedirectRule rule = 1;
293
325
  google.protobuf.Timestamp create_time = 2;
294
- }
326
+ }
327
+
328
+ // Attached to task responses to give hints to the SDK about how it may adjust its number of
329
+ // pollers.
330
+ message PollerScalingDecision {
331
+ // How many poll requests to suggest should be added or removed, if any. As of now, server only
332
+ // scales up or down by 1. However, SDKs should allow for other values (while staying within
333
+ // defined min/max).
334
+ //
335
+ // The SDK is free to ignore this suggestion, EX: making more polls would not make sense because
336
+ // all slots are already occupied.
337
+ int32 poll_request_delta_suggestion = 1;
338
+ }