@temporalio/core-bridge 1.9.2 → 1.10.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 (177) hide show
  1. package/Cargo.lock +754 -473
  2. package/Cargo.toml +3 -3
  3. package/lib/index.d.ts +33 -2
  4. package/lib/index.js.map +1 -1
  5. package/package.json +4 -4
  6. package/releases/aarch64-apple-darwin/index.node +0 -0
  7. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  8. package/releases/x86_64-apple-darwin/index.node +0 -0
  9. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  10. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  11. package/scripts/build.js +4 -3
  12. package/sdk-core/.cargo/config.toml +2 -4
  13. package/sdk-core/.github/workflows/heavy.yml +1 -1
  14. package/sdk-core/.github/workflows/per-pr.yml +6 -4
  15. package/sdk-core/Cargo.toml +10 -3
  16. package/sdk-core/README.md +4 -6
  17. package/sdk-core/client/Cargo.toml +13 -5
  18. package/sdk-core/client/src/lib.rs +123 -34
  19. package/sdk-core/client/src/metrics.rs +70 -18
  20. package/sdk-core/client/src/proxy.rs +85 -0
  21. package/sdk-core/client/src/raw.rs +67 -5
  22. package/sdk-core/client/src/worker_registry/mod.rs +5 -3
  23. package/sdk-core/client/src/workflow_handle/mod.rs +3 -1
  24. package/sdk-core/core/Cargo.toml +31 -37
  25. package/sdk-core/core/src/abstractions/take_cell.rs +3 -3
  26. package/sdk-core/core/src/abstractions.rs +176 -108
  27. package/sdk-core/core/src/core_tests/activity_tasks.rs +4 -13
  28. package/sdk-core/core/src/core_tests/determinism.rs +2 -1
  29. package/sdk-core/core/src/core_tests/local_activities.rs +3 -3
  30. package/sdk-core/core/src/core_tests/mod.rs +3 -3
  31. package/sdk-core/core/src/core_tests/queries.rs +42 -5
  32. package/sdk-core/core/src/core_tests/workers.rs +2 -3
  33. package/sdk-core/core/src/core_tests/workflow_tasks.rs +115 -15
  34. package/sdk-core/core/src/ephemeral_server/mod.rs +109 -136
  35. package/sdk-core/core/src/internal_flags.rs +8 -8
  36. package/sdk-core/core/src/lib.rs +16 -11
  37. package/sdk-core/core/src/pollers/mod.rs +11 -5
  38. package/sdk-core/core/src/pollers/poll_buffer.rs +48 -29
  39. package/sdk-core/core/src/protosext/mod.rs +32 -32
  40. package/sdk-core/core/src/protosext/protocol_messages.rs +14 -24
  41. package/sdk-core/core/src/retry_logic.rs +2 -2
  42. package/sdk-core/core/src/telemetry/log_export.rs +10 -9
  43. package/sdk-core/core/src/telemetry/metrics.rs +233 -330
  44. package/sdk-core/core/src/telemetry/mod.rs +11 -38
  45. package/sdk-core/core/src/telemetry/otel.rs +355 -0
  46. package/sdk-core/core/src/telemetry/prometheus_server.rs +36 -23
  47. package/sdk-core/core/src/test_help/mod.rs +80 -59
  48. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +6 -6
  49. package/sdk-core/core/src/worker/activities/local_activities.rs +46 -43
  50. package/sdk-core/core/src/worker/activities.rs +45 -46
  51. package/sdk-core/core/src/worker/client/mocks.rs +8 -7
  52. package/sdk-core/core/src/worker/client.rs +40 -39
  53. package/sdk-core/core/src/worker/mod.rs +72 -42
  54. package/sdk-core/core/src/worker/slot_provider.rs +28 -28
  55. package/sdk-core/core/src/worker/slot_supplier.rs +1 -0
  56. package/sdk-core/core/src/worker/tuner/fixed_size.rs +52 -0
  57. package/sdk-core/core/src/worker/tuner/resource_based.rs +561 -0
  58. package/sdk-core/core/src/worker/tuner.rs +122 -0
  59. package/sdk-core/core/src/worker/workflow/driven_workflow.rs +6 -6
  60. package/sdk-core/core/src/worker/workflow/history_update.rs +27 -53
  61. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +4 -17
  62. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +1 -10
  63. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +4 -11
  64. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +17 -35
  65. package/sdk-core/core/src/worker/workflow/machines/complete_workflow_state_machine.rs +0 -8
  66. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +1 -5
  67. package/sdk-core/core/src/worker/workflow/machines/fail_workflow_state_machine.rs +0 -5
  68. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +0 -5
  69. package/sdk-core/core/src/worker/workflow/machines/mod.rs +0 -14
  70. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +0 -5
  71. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +0 -5
  72. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +1 -10
  73. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +3 -10
  74. package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +12 -8
  75. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +0 -10
  76. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +6 -13
  77. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +27 -37
  78. package/sdk-core/core/src/worker/workflow/machines/workflow_task_state_machine.rs +3 -14
  79. package/sdk-core/core/src/worker/workflow/managed_run.rs +84 -54
  80. package/sdk-core/core/src/worker/workflow/mod.rs +63 -160
  81. package/sdk-core/core/src/worker/workflow/run_cache.rs +22 -13
  82. package/sdk-core/core/src/worker/workflow/wft_extraction.rs +16 -3
  83. package/sdk-core/core/src/worker/workflow/wft_poller.rs +15 -12
  84. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +39 -78
  85. package/sdk-core/core-api/Cargo.toml +6 -5
  86. package/sdk-core/core-api/src/errors.rs +8 -0
  87. package/sdk-core/core-api/src/telemetry/metrics.rs +75 -4
  88. package/sdk-core/core-api/src/telemetry.rs +7 -1
  89. package/sdk-core/core-api/src/worker.rs +212 -56
  90. package/sdk-core/fsm/Cargo.toml +3 -0
  91. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +1 -1
  92. package/sdk-core/sdk/Cargo.toml +5 -7
  93. package/sdk-core/sdk/src/app_data.rs +3 -3
  94. package/sdk-core/sdk/src/lib.rs +5 -3
  95. package/sdk-core/sdk/src/workflow_context/options.rs +1 -1
  96. package/sdk-core/sdk/src/workflow_context.rs +10 -9
  97. package/sdk-core/sdk/src/workflow_future.rs +1 -1
  98. package/sdk-core/sdk-core-protos/Cargo.toml +8 -6
  99. package/sdk-core/sdk-core-protos/build.rs +1 -10
  100. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +3 -0
  101. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/ci.yml +26 -0
  102. package/sdk-core/sdk-core-protos/protos/api_upstream/Makefile +42 -20
  103. package/sdk-core/sdk-core-protos/protos/api_upstream/README.md +2 -0
  104. package/sdk-core/sdk-core-protos/protos/api_upstream/api-linter.yaml +36 -26
  105. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.lock +2 -0
  106. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/struct.proto +95 -0
  107. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +9632 -0
  108. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +7337 -0
  109. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/payload_description.txt +2 -0
  110. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +45 -11
  111. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +22 -4
  112. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/command_type.proto +2 -0
  113. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +44 -0
  114. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/event_type.proto +18 -3
  115. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +20 -0
  116. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +30 -0
  117. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/update.proto +7 -8
  118. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/workflow.proto +23 -5
  119. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/errordetails/v1/message.proto +20 -0
  120. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +25 -0
  121. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +141 -15
  122. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +12 -0
  123. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +193 -0
  124. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +73 -6
  125. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +46 -4
  126. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/schedule/v1/message.proto +4 -0
  127. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +2 -2
  128. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +116 -0
  129. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +134 -0
  130. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +274 -29
  131. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +57 -1
  132. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +10 -12
  133. package/sdk-core/sdk-core-protos/src/history_builder.rs +1 -1
  134. package/sdk-core/sdk-core-protos/src/lib.rs +54 -51
  135. package/sdk-core/sdk-core-protos/src/task_token.rs +11 -2
  136. package/sdk-core/test-utils/Cargo.toml +7 -4
  137. package/sdk-core/test-utils/src/histfetch.rs +1 -1
  138. package/sdk-core/test-utils/src/lib.rs +44 -62
  139. package/sdk-core/tests/fuzzy_workflow.rs +5 -2
  140. package/sdk-core/tests/heavy_tests.rs +114 -17
  141. package/sdk-core/tests/integ_tests/activity_functions.rs +1 -1
  142. package/sdk-core/tests/integ_tests/client_tests.rs +2 -2
  143. package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +38 -26
  144. package/sdk-core/tests/integ_tests/metrics_tests.rs +126 -17
  145. package/sdk-core/tests/integ_tests/polling_tests.rs +118 -2
  146. package/sdk-core/tests/integ_tests/update_tests.rs +3 -5
  147. package/sdk-core/tests/integ_tests/visibility_tests.rs +3 -3
  148. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +1 -1
  149. package/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +1 -1
  150. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +1 -1
  151. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
  152. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +3 -3
  153. package/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +5 -4
  154. package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +3 -2
  155. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +6 -10
  156. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +9 -7
  157. package/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +1 -1
  158. package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +14 -9
  159. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +1 -1
  160. package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +6 -13
  161. package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +9 -6
  162. package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +5 -5
  163. package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +1 -1
  164. package/sdk-core/tests/integ_tests/workflow_tests.rs +115 -11
  165. package/sdk-core/tests/main.rs +2 -2
  166. package/src/conversions.rs +57 -0
  167. package/src/lib.rs +1 -0
  168. package/src/runtime.rs +51 -35
  169. package/ts/index.ts +67 -3
  170. package/sdk-core/core/src/worker/workflow/workflow_stream/saved_wf_inputs.rs +0 -117
  171. package/sdk-core/core/src/worker/workflow/workflow_stream/tonic_status_serde.rs +0 -24
  172. package/sdk-core/sdk/src/payload_converter.rs +0 -11
  173. package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/Dockerfile +0 -2
  174. package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/docker-compose.yml +0 -15
  175. package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/pipeline.yml +0 -10
  176. package/sdk-core/test-utils/src/wf_input_saver.rs +0 -50
  177. package/sdk-core/tests/wf_input_replay.rs +0 -32
@@ -54,6 +54,29 @@ message TaskQueueMetadata {
54
54
  google.protobuf.DoubleValue max_tasks_per_second = 1;
55
55
  }
56
56
 
57
+ // Used for specifying versions the caller is interested in.
58
+ message TaskQueueVersionSelection {
59
+ // Include specific Build IDs.
60
+ repeated string build_ids = 1;
61
+ // Include the unversioned queue.
62
+ bool unversioned = 2;
63
+ // Include all active versions. A version is considered active if it has had new
64
+ // tasks or polls recently.
65
+ bool all_active = 3;
66
+ }
67
+
68
+ message TaskQueueVersionInfo {
69
+ // Task Queue info per Task Type. Key is the numerical value of the temporal.api.enums.v1.TaskQueueType enum.
70
+ map<int32, TaskQueueTypeInfo> types_info = 1;
71
+ temporal.api.enums.v1.BuildIdTaskReachability task_reachability = 2;
72
+ }
73
+
74
+ message TaskQueueTypeInfo {
75
+ // Unversioned workers (with `useVersioning=false`) are reported in unversioned result even if they set a Build ID.
76
+ repeated PollerInfo pollers = 1;
77
+ }
78
+
79
+ // Deprecated. Use `InternalTaskQueueStatus`. This is kept until `DescribeTaskQueue` supports legacy behavior.
57
80
  message TaskQueueStatus {
58
81
  int64 backlog_count_hint = 1;
59
82
  int64 read_level = 2;
@@ -111,3 +134,96 @@ message BuildIdReachability {
111
134
  // Reachability per task queue.
112
135
  repeated TaskQueueReachability task_queue_reachability = 2;
113
136
  }
137
+
138
+ message RampByPercentage {
139
+ // Acceptable range is [0,100).
140
+ float ramp_percentage = 1;
141
+ }
142
+
143
+ // These rules assign a Build ID to Unassigned Workflow Executions and
144
+ // Activities.
145
+ //
146
+ // Specifically, assignment rules are applied to the following Executions or
147
+ // Activities when they are scheduled in a Task Queue:
148
+ // - Generally, any new Workflow Execution, except:
149
+ // - When A Child Workflow or a Continue-As-New Execution inherits the
150
+ // Build ID from its parent/previous execution by setting the
151
+ // `inherit_build_id` flag.
152
+ // - Workflow Executions started Eagerly are assigned to the Build ID of
153
+ // the Starter.
154
+ // - An Activity that is scheduled on a Task Queue different from the one
155
+ // their Workflow runs on, unless the `use_workflow_build_id` flag is set.
156
+ //
157
+ // In absence of (applicable) redirect rules (`CompatibleBuildIdRedirectRule`s)
158
+ // the task will be dispatched to Workers of the Build ID determined by the
159
+ // assignment rules. Otherwise, the final Build ID will be determined by the
160
+ // redirect rules.
161
+ //
162
+ // When using Worker Versioning, in the steady state, for a given Task Queue,
163
+ // there should typically be exactly one assignment rule to send all Unassigned
164
+ // tasks to the latest Build ID. Existence of at least one such "unconditional"
165
+ // rule at all times is enforce by the system, unless the `force` flag is used
166
+ // by the user when replacing/deleting these rules (for exceptional cases).
167
+ //
168
+ // During a deployment, one or more additional rules can be added to assign a
169
+ // subset of the tasks to a new Build ID based on a "ramp percentage".
170
+ //
171
+ // When there are multiple assignment rules for a Task Queue, the rules are
172
+ // evaluated in order, starting from index 0. The first applicable rule will be
173
+ // applied and the rest will be ignored.
174
+ //
175
+ // In the event that no assignment rule is applicable on a task (or the Task
176
+ // Queue is simply not versioned), the tasks will be sent to unversioned
177
+ // workers, if available. Otherwise, they remain Unassigned, and will be
178
+ // retried for assignment, or dispatch to unversioned workers, at a later time
179
+ // depending on the availability of workers.
180
+ message BuildIdAssignmentRule {
181
+ string target_build_id = 1;
182
+
183
+ // If a ramp is provided, this rule will be applied only to a sample of
184
+ // tasks according to the provided percentage.
185
+ // This option can be used only on "terminal" Build IDs (the ones not used
186
+ // as source in any redirect rules).
187
+ oneof ramp {
188
+ // This ramp is useful for gradual Blue/Green deployments (and similar)
189
+ // where you want to send a certain portion of the traffic to the target
190
+ // Build ID.
191
+ RampByPercentage percentage_ramp = 3;
192
+ }
193
+ }
194
+
195
+ // These rules apply to tasks assigned to a particular Build ID
196
+ // (`source_build_id`) to redirect them to another *compatible* Build ID
197
+ // (`target_build_id`).
198
+ //
199
+ // It is user's responsibility to ensure that the target Build ID is compatible
200
+ // with the source Build ID (e.g. by using the Patching API).
201
+ //
202
+ // Most deployments are not expected to need these rules, however following
203
+ // situations can greatly benefit from redirects:
204
+ // - Need to move long-running Workflow Executions from an old Build ID to a
205
+ // newer one.
206
+ // - Need to hotfix some broken or stuck Workflow Executions.
207
+ //
208
+ // In steady state, redirect rules are beneficial when dealing with old
209
+ // Executions ran on now-decommissioned Build IDs:
210
+ // - To redirecting the Workflow Queries to the current (compatible) Build ID.
211
+ // - To be able to Reset an old Execution so it can run on the current
212
+ // (compatible) Build ID.
213
+ //
214
+ // Redirect rules can be chained, but only the last rule in the chain can have
215
+ // a ramp.
216
+ message CompatibleBuildIdRedirectRule {
217
+ string source_build_id = 1;
218
+ string target_build_id = 2;
219
+ }
220
+
221
+ message TimestampedBuildIdAssignmentRule {
222
+ BuildIdAssignmentRule rule = 1;
223
+ google.protobuf.Timestamp create_time = 2;
224
+ }
225
+
226
+ message TimestampedCompatibleBuildIdRedirectRule {
227
+ CompatibleBuildIdRedirectRule rule = 1;
228
+ google.protobuf.Timestamp create_time = 2;
229
+ }
@@ -32,8 +32,10 @@ option ruby_package = "Temporalio::Api::Workflow::V1";
32
32
  option csharp_namespace = "Temporalio.Api.Workflow.V1";
33
33
 
34
34
  import "google/protobuf/duration.proto";
35
+ import "google/protobuf/empty.proto";
35
36
  import "google/protobuf/timestamp.proto";
36
37
 
38
+ import "temporal/api/enums/v1/common.proto";
37
39
  import "temporal/api/enums/v1/workflow.proto";
38
40
  import "temporal/api/common/v1/message.proto";
39
41
  import "temporal/api/failure/v1/message.proto";
@@ -57,6 +59,37 @@ message WorkflowExecutionInfo {
57
59
  int64 history_size_bytes = 15;
58
60
  // If set, the most recent worker version stamp that appeared in a workflow task completion
59
61
  temporal.api.common.v1.WorkerVersionStamp most_recent_worker_version_stamp = 16;
62
+ // Workflow execution duration is defined as difference between close time and execution time.
63
+ // This field is only populated if the workflow is closed.
64
+ google.protobuf.Duration execution_duration = 17;
65
+ // Contains information about the root workflow execution.
66
+ // The root workflow execution is defined as follows:
67
+ // 1. A workflow without parent workflow is its own root workflow.
68
+ // 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
69
+ // Note: workflows continued as new or reseted may or may not have parents, check examples below.
70
+ //
71
+ // Examples:
72
+ // Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
73
+ // - The root workflow of all three workflows is W1.
74
+ // Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
75
+ // - The root workflow of all three workflows is W1.
76
+ // Scenario 3: Workflow W1 continued as new W2.
77
+ // - The root workflow of W1 is W1 and the root workflow of W2 is W2.
78
+ // Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
79
+ // - The root workflow of all three workflows is W1.
80
+ // Scenario 5: Workflow W1 is reseted, creating W2.
81
+ // - The root workflow of W1 is W1 and the root workflow of W2 is W2.
82
+ temporal.api.common.v1.WorkflowExecution root_execution = 18;
83
+ // The currently assigned build ID for this execution. Presence of this value means worker versioning is used
84
+ // for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
85
+ // when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
86
+ // again, the assigned build ID may change according to the latest versioning rules.
87
+ // Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
88
+ // this execution.
89
+ string assigned_build_id = 19;
90
+ // Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
91
+ // of using the assignment rules.
92
+ string inherited_build_id = 20;
60
93
  }
61
94
 
62
95
  message WorkflowExecutionConfig {
@@ -79,6 +112,20 @@ message PendingActivityInfo {
79
112
  google.protobuf.Timestamp expiration_time = 10;
80
113
  temporal.api.failure.v1.Failure last_failure = 11;
81
114
  string last_worker_identity = 12;
115
+ // Absence of `assigned_build_id` generally means this task is on an "unversioned" task queue.
116
+ // In rare cases, it can also mean that the task queue is versioned but we failed to write activity's
117
+ // independently-assigned build ID to the database. This case heals automatically once the task is dispatched.
118
+ oneof assigned_build_id {
119
+ // When present, it means this activity is assigned to the build ID of its workflow.
120
+ google.protobuf.Empty use_workflow_build_id = 13;
121
+ // This means the activity is independently versioned and not bound to the build ID of its workflow.
122
+ // The activity will use the build id in this field instead.
123
+ // If the task fails and is scheduled again, the assigned build ID may change according to the latest versioning
124
+ // rules.
125
+ string last_independently_assigned_build_id = 14;
126
+ }
127
+ // The version stamp of the worker to whom this activity was most recently dispatched
128
+ temporal.api.common.v1.WorkerVersionStamp last_worker_version_stamp = 15;
82
129
  }
83
130
 
84
131
  message PendingChildExecutionInfo {
@@ -152,3 +199,90 @@ message NewWorkflowExecutionInfo {
152
199
  temporal.api.common.v1.Header header = 13;
153
200
  }
154
201
 
202
+ // CallbackInfo contains the state of an attached workflow callback.
203
+ message CallbackInfo {
204
+ // Trigger for when the workflow is closed.
205
+ message WorkflowClosed {}
206
+
207
+ message Trigger {
208
+ oneof variant {
209
+ WorkflowClosed workflow_closed = 1;
210
+ }
211
+ }
212
+
213
+ // Information on how this callback should be invoked (e.g. its URL and type).
214
+ temporal.api.common.v1.Callback callback = 1;
215
+ // Trigger for this callback.
216
+ Trigger trigger = 2;
217
+ // The time when the callback was registered.
218
+ google.protobuf.Timestamp registration_time = 3;
219
+
220
+ temporal.api.enums.v1.CallbackState state = 4;
221
+ // The number of attempts made to deliver the callback.
222
+ // This number represents a minimum bound since the attempt is incremented after the callback request completes.
223
+ int32 attempt = 5;
224
+
225
+ // The time when the last attempt completed.
226
+ google.protobuf.Timestamp last_attempt_complete_time = 6;
227
+ // The last attempt's failure, if any.
228
+ temporal.api.failure.v1.Failure last_attempt_failure = 7;
229
+ // The time when the next attempt is scheduled.
230
+ google.protobuf.Timestamp next_attempt_schedule_time = 8;
231
+ }
232
+
233
+ // PendingNexusOperationInfo contains the state of a pending Nexus operation.
234
+ message PendingNexusOperationInfo {
235
+ // Endpoint name.
236
+ // Resolved to a URL via the cluster's endpoint registry.
237
+ string endpoint = 1;
238
+ // Service name.
239
+ string service = 2;
240
+ // Operation name.
241
+ string operation = 3;
242
+
243
+ // Operation ID. Only set for asynchronous operations after a successful StartOperation call.
244
+ string operation_id = 4;
245
+
246
+ // Schedule-to-close timeout for this operation.
247
+ // This is the only timeout settable by a workflow.
248
+ // (-- api-linter: core::0140::prepositions=disabled
249
+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
250
+ google.protobuf.Duration schedule_to_close_timeout = 5;
251
+
252
+ // The time when the operation was scheduled.
253
+ google.protobuf.Timestamp scheduled_time = 6;
254
+
255
+ temporal.api.enums.v1.PendingNexusOperationState state = 7;
256
+
257
+ // The number of attempts made to deliver the start operation request.
258
+ // This number represents a minimum bound since the attempt is incremented after the request completes.
259
+ int32 attempt = 8;
260
+
261
+ // The time when the last attempt completed.
262
+ google.protobuf.Timestamp last_attempt_complete_time = 9;
263
+ // The last attempt's failure, if any.
264
+ temporal.api.failure.v1.Failure last_attempt_failure = 10;
265
+ // The time when the next attempt is scheduled.
266
+ google.protobuf.Timestamp next_attempt_schedule_time = 11;
267
+
268
+ NexusOperationCancellationInfo cancellation_info = 12;
269
+ }
270
+
271
+ // NexusOperationCancellationInfo contains the state of a nexus operation cancellation.
272
+ message NexusOperationCancellationInfo {
273
+ // The time when cancellation was requested.
274
+ google.protobuf.Timestamp requested_time = 1;
275
+
276
+ temporal.api.enums.v1.NexusOperationCancellationState state = 2;
277
+
278
+ // The number of attempts made to deliver the cancel operation request.
279
+ // This number represents a minimum bound since the attempt is incremented after the request completes.
280
+ int32 attempt = 3;
281
+
282
+ // The time when the last attempt completed.
283
+ google.protobuf.Timestamp last_attempt_complete_time = 4;
284
+ // The last attempt's failure, if any.
285
+ temporal.api.failure.v1.Failure last_attempt_failure = 5;
286
+ // The time when the next attempt is scheduled.
287
+ google.protobuf.Timestamp next_attempt_schedule_time = 6;
288
+ }