@temporalio/core-bridge 1.12.0 → 1.12.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 (116) hide show
  1. package/Cargo.lock +64 -119
  2. package/Cargo.toml +1 -1
  3. package/index.js +3 -2
  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 +1 -2
  11. package/sdk-core/.github/workflows/per-pr.yml +2 -0
  12. package/sdk-core/AGENTS.md +7 -0
  13. package/sdk-core/Cargo.toml +9 -5
  14. package/sdk-core/README.md +6 -5
  15. package/sdk-core/client/Cargo.toml +3 -2
  16. package/sdk-core/client/src/lib.rs +17 -8
  17. package/sdk-core/client/src/metrics.rs +57 -23
  18. package/sdk-core/client/src/raw.rs +33 -15
  19. package/sdk-core/core/Cargo.toml +11 -9
  20. package/sdk-core/core/benches/workflow_replay.rs +114 -15
  21. package/sdk-core/core/src/core_tests/activity_tasks.rs +18 -18
  22. package/sdk-core/core/src/core_tests/child_workflows.rs +4 -4
  23. package/sdk-core/core/src/core_tests/determinism.rs +6 -6
  24. package/sdk-core/core/src/core_tests/local_activities.rs +20 -20
  25. package/sdk-core/core/src/core_tests/mod.rs +40 -5
  26. package/sdk-core/core/src/core_tests/queries.rs +25 -16
  27. package/sdk-core/core/src/core_tests/replay_flag.rs +3 -3
  28. package/sdk-core/core/src/core_tests/updates.rs +3 -3
  29. package/sdk-core/core/src/core_tests/workers.rs +9 -7
  30. package/sdk-core/core/src/core_tests/workflow_tasks.rs +40 -42
  31. package/sdk-core/core/src/ephemeral_server/mod.rs +1 -19
  32. package/sdk-core/core/src/lib.rs +10 -1
  33. package/sdk-core/core/src/pollers/poll_buffer.rs +2 -2
  34. package/sdk-core/core/src/replay/mod.rs +3 -3
  35. package/sdk-core/core/src/telemetry/metrics.rs +306 -152
  36. package/sdk-core/core/src/telemetry/mod.rs +11 -4
  37. package/sdk-core/core/src/telemetry/otel.rs +134 -131
  38. package/sdk-core/core/src/telemetry/prometheus_meter.rs +885 -0
  39. package/sdk-core/core/src/telemetry/prometheus_server.rs +48 -28
  40. package/sdk-core/core/src/test_help/mod.rs +27 -12
  41. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +7 -7
  42. package/sdk-core/core/src/worker/activities.rs +4 -4
  43. package/sdk-core/core/src/worker/client/mocks.rs +10 -3
  44. package/sdk-core/core/src/worker/client.rs +68 -5
  45. package/sdk-core/core/src/worker/heartbeat.rs +229 -0
  46. package/sdk-core/core/src/worker/mod.rs +35 -14
  47. package/sdk-core/core/src/worker/tuner/resource_based.rs +4 -4
  48. package/sdk-core/core/src/worker/workflow/history_update.rs +71 -19
  49. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +1 -2
  50. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -1
  51. package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +31 -48
  52. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +1 -2
  53. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +3 -3
  54. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +4 -1
  55. package/sdk-core/core/src/worker/workflow/managed_run.rs +1 -1
  56. package/sdk-core/core/src/worker/workflow/mod.rs +15 -15
  57. package/sdk-core/core-api/Cargo.toml +2 -2
  58. package/sdk-core/core-api/src/envconfig.rs +204 -99
  59. package/sdk-core/core-api/src/lib.rs +9 -0
  60. package/sdk-core/core-api/src/telemetry/metrics.rs +548 -100
  61. package/sdk-core/core-api/src/worker.rs +11 -5
  62. package/sdk-core/core-c-bridge/Cargo.toml +49 -0
  63. package/sdk-core/core-c-bridge/build.rs +26 -0
  64. package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +817 -0
  65. package/sdk-core/core-c-bridge/src/client.rs +679 -0
  66. package/sdk-core/core-c-bridge/src/lib.rs +245 -0
  67. package/sdk-core/core-c-bridge/src/metric.rs +682 -0
  68. package/sdk-core/core-c-bridge/src/random.rs +61 -0
  69. package/sdk-core/core-c-bridge/src/runtime.rs +445 -0
  70. package/sdk-core/core-c-bridge/src/testing.rs +282 -0
  71. package/sdk-core/core-c-bridge/src/tests/context.rs +644 -0
  72. package/sdk-core/core-c-bridge/src/tests/mod.rs +178 -0
  73. package/sdk-core/core-c-bridge/src/tests/utils.rs +108 -0
  74. package/sdk-core/core-c-bridge/src/worker.rs +1069 -0
  75. package/sdk-core/etc/deps.svg +64 -64
  76. package/sdk-core/sdk/src/activity_context.rs +6 -4
  77. package/sdk-core/sdk/src/lib.rs +49 -27
  78. package/sdk-core/sdk/src/workflow_future.rs +18 -25
  79. package/sdk-core/sdk-core-protos/protos/api_upstream/README.md +4 -0
  80. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +0 -2
  81. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +630 -83
  82. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +632 -78
  83. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +4 -4
  84. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +6 -4
  85. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +2 -2
  86. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +32 -2
  87. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +10 -1
  88. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/deployment.proto +26 -0
  89. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
  90. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +4 -4
  91. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +2 -2
  92. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +47 -31
  93. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +4 -4
  94. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/schedule/v1/message.proto +7 -1
  95. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/worker/v1/message.proto +134 -0
  96. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +14 -11
  97. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +148 -37
  98. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +21 -0
  99. package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +4 -4
  100. package/sdk-core/sdk-core-protos/src/history_builder.rs +9 -5
  101. package/sdk-core/sdk-core-protos/src/lib.rs +96 -6
  102. package/sdk-core/test-utils/src/lib.rs +11 -3
  103. package/sdk-core/tests/cloud_tests.rs +3 -3
  104. package/sdk-core/tests/heavy_tests.rs +11 -3
  105. package/sdk-core/tests/integ_tests/client_tests.rs +12 -13
  106. package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +1 -1
  107. package/sdk-core/tests/integ_tests/metrics_tests.rs +188 -83
  108. package/sdk-core/tests/integ_tests/polling_tests.rs +1 -1
  109. package/sdk-core/tests/integ_tests/queries_tests.rs +56 -40
  110. package/sdk-core/tests/integ_tests/update_tests.rs +2 -7
  111. package/sdk-core/tests/integ_tests/worker_tests.rs +3 -4
  112. package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +3 -7
  113. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +3 -5
  114. package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +24 -17
  115. package/src/client.rs +6 -0
  116. package/src/metrics.rs +6 -6
@@ -77,10 +77,10 @@ message BatchOperationReset {
77
77
  // Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
78
78
  temporal.api.common.v1.ResetOptions options = 4;
79
79
 
80
- // Reset type (deprecated, use `options`).
81
- temporal.api.enums.v1.ResetType reset_type = 1;
82
- // History event reapply options (deprecated, use `options`).
83
- temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2;
80
+ // Deprecated. Use `options`.
81
+ temporal.api.enums.v1.ResetType reset_type = 1 [deprecated = true];
82
+ // Deprecated. Use `options`.
83
+ temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2 [deprecated = true];
84
84
  // Operations to perform after the workflow has been reset. These operations will be applied
85
85
  // to the *new* run of the workflow execution in the order they are provided.
86
86
  // All operations are applied to the workflow before the first new workflow task is generated
@@ -106,7 +106,7 @@ message RequestCancelExternalWorkflowExecutionCommandAttributes {
106
106
  string workflow_id = 2;
107
107
  string run_id = 3;
108
108
  // Deprecated.
109
- string control = 4;
109
+ string control = 4 [deprecated = true];
110
110
  // Set this to true if the workflow being cancelled is a child of the workflow originating this
111
111
  // command. The request will be rejected if it is set to true and the target workflow is *not*
112
112
  // a child of the requesting workflow.
@@ -123,7 +123,7 @@ message SignalExternalWorkflowExecutionCommandAttributes {
123
123
  // Serialized value(s) to provide with the signal.
124
124
  temporal.api.common.v1.Payloads input = 4;
125
125
  // Deprecated
126
- string control = 5;
126
+ string control = 5 [deprecated = true];
127
127
  // Set this to true if the workflow being cancelled is a child of the workflow originating this
128
128
  // command. The request will be rejected if it is set to true and the target workflow is *not*
129
129
  // a child of the requesting workflow.
@@ -176,7 +176,8 @@ message ContinueAsNewWorkflowExecutionCommandAttributes {
176
176
  temporal.api.common.v1.SearchAttributes search_attributes = 14;
177
177
  // If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
178
178
  // the assignment rules will be used to independently assign a Build ID to the new execution.
179
- bool inherit_build_id = 15;
179
+ // Deprecated. Only considered for versioning v0.2.
180
+ bool inherit_build_id = 15 [deprecated = true];
180
181
 
181
182
  // `workflow_execution_timeout` is omitted as it shouldn't be overridden from within a workflow.
182
183
  }
@@ -206,7 +207,8 @@ message StartChildWorkflowExecutionCommandAttributes {
206
207
  temporal.api.common.v1.SearchAttributes search_attributes = 16;
207
208
  // If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment
208
209
  // rules of the child's Task Queue will be used to independently assign a Build ID to it.
209
- bool inherit_build_id = 17;
210
+ // Deprecated. Only considered for versioning v0.2.
211
+ bool inherit_build_id = 17 [deprecated = true];
210
212
  // Priority metadata. If this message is not present, or any fields are not
211
213
  // present, they inherit the values from the workflow.
212
214
  temporal.api.common.v1.Priority priority = 18;
@@ -154,9 +154,9 @@ message ResetOptions {
154
154
  string build_id = 4;
155
155
  }
156
156
 
157
- // Event types to be reapplied (deprecated)
157
+ // Deprecated. Use `options`.
158
158
  // Default: RESET_REAPPLY_TYPE_SIGNAL
159
- temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 10;
159
+ temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 10 [deprecated = true];
160
160
 
161
161
  // If true, limit the reset to only within the current run. (Applies to build_id targets and
162
162
  // possibly others in the future.)
@@ -97,6 +97,9 @@ message WorkerDeploymentVersionInfo {
97
97
  // Deprecated. Use `deployment_version`.
98
98
  string version = 1 [deprecated = true];
99
99
 
100
+ // The status of the Worker Deployment Version.
101
+ temporal.api.enums.v1.WorkerDeploymentVersionStatus status = 14;
102
+
100
103
  // Required.
101
104
  WorkerDeploymentVersion deployment_version = 11;
102
105
  string deployment_name = 2;
@@ -107,19 +110,25 @@ message WorkerDeploymentVersionInfo {
107
110
 
108
111
  // (-- api-linter: core::0140::prepositions=disabled
109
112
  // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
110
- // Nil if not current.
113
+ // Unset if not current.
111
114
  google.protobuf.Timestamp current_since_time = 5;
112
115
 
113
116
  // (-- api-linter: core::0140::prepositions=disabled
114
117
  // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
115
- // Nil if not ramping. Updated when the version first starts ramping, not on each ramp change.
118
+ // Unset if not ramping. Updated when the version first starts ramping, not on each ramp change.
116
119
  google.protobuf.Timestamp ramping_since_time = 6;
117
120
 
121
+ // Timestamp when this version first became current or ramping.
122
+ google.protobuf.Timestamp first_activation_time = 12;
123
+ // Timestamp when this version last stopped being current or ramping.
124
+ google.protobuf.Timestamp last_deactivation_time = 13;
125
+
118
126
  // Range: [0, 100]. Must be zero if the version is not ramping (i.e. `ramping_since_time` is nil).
119
127
  // Can be in the range [0, 100] if the version is ramping.
120
128
  float ramp_percentage = 7;
121
129
 
122
130
  // All the Task Queues that have ever polled from this Deployment version.
131
+ // Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead.
123
132
  repeated VersionTaskQueueInfo task_queue_infos = 8;
124
133
  message VersionTaskQueueInfo {
125
134
  string name = 1;
@@ -190,10 +199,31 @@ message WorkerDeploymentInfo {
190
199
  // Deprecated. Use `deployment_version`.
191
200
  string version = 1 [deprecated = true];
192
201
 
202
+ // The status of the Worker Deployment Version.
203
+ temporal.api.enums.v1.WorkerDeploymentVersionStatus status = 11;
204
+
193
205
  // Required.
194
206
  WorkerDeploymentVersion deployment_version = 4;
195
207
  google.protobuf.Timestamp create_time = 2;
208
+ // Deprecated. Use `drainage_info` instead.
196
209
  enums.v1.VersionDrainageStatus drainage_status = 3;
210
+ // Information about workflow drainage to help the user determine when it is safe
211
+ // to decommission a Version. Not present while version is current or ramping
212
+ VersionDrainageInfo drainage_info = 5;
213
+ // Unset if not current.
214
+ // (-- api-linter: core::0140::prepositions=disabled
215
+ // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
216
+ google.protobuf.Timestamp current_since_time = 6;
217
+ // Unset if not ramping. Updated when the version first starts ramping, not on each ramp change.
218
+ // (-- api-linter: core::0140::prepositions=disabled
219
+ // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
220
+ google.protobuf.Timestamp ramping_since_time = 7;
221
+ // Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed.
222
+ google.protobuf.Timestamp routing_update_time = 8;
223
+ // Timestamp when this version first became current or ramping.
224
+ google.protobuf.Timestamp first_activation_time = 9;
225
+ // Timestamp when this version last stopped being current or ramping.
226
+ google.protobuf.Timestamp last_deactivation_time = 10;
197
227
  }
198
228
  }
199
229
 
@@ -96,4 +96,13 @@ enum ApplicationErrorCategory {
96
96
  APPLICATION_ERROR_CATEGORY_UNSPECIFIED = 0;
97
97
  // Expected application error with little/no severity.
98
98
  APPLICATION_ERROR_CATEGORY_BENIGN = 1;
99
- }
99
+ }
100
+
101
+ // (-- api-linter: core::0216::synonyms=disabled
102
+ // aip.dev/not-precedent: It seems we have both state and status, and status is a better fit for workers. --)
103
+ enum WorkerStatus {
104
+ WORKER_STATUS_UNSPECIFIED = 0;
105
+ WORKER_STATUS_RUNNING = 1;
106
+ WORKER_STATUS_SHUTTING_DOWN = 2;
107
+ WORKER_STATUS_SHUTDOWN = 3;
108
+ }
@@ -72,3 +72,29 @@ enum WorkerVersioningMode {
72
72
  // VersioningBehavior enum.)
73
73
  WORKER_VERSIONING_MODE_VERSIONED = 2;
74
74
  }
75
+
76
+ // (-- api-linter: core::0216::synonyms=disabled
77
+ // aip.dev/not-precedent: Call this status because it is . --)
78
+ // Specify the status of a Worker Deployment Version.
79
+ // Experimental. Worker Deployments are experimental and might significantly change in the future.
80
+ enum WorkerDeploymentVersionStatus {
81
+ WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED = 0;
82
+ // The Worker Deployment Version has been created inside the Worker Deployment but is not used by any
83
+ // workflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting
84
+ // this Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.
85
+ WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE = 1;
86
+ // The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions
87
+ // and tasks of existing unversioned or AutoUpgrade workflows are routed to this version.
88
+ WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT = 2;
89
+ // The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are
90
+ // routed to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.
91
+ WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING = 3;
92
+ // The Worker Deployment Version is not used by new workflows but is still used by
93
+ // open pinned workflows. The version cannot be decommissioned safely.
94
+ WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING = 4;
95
+ // The Worker Deployment Version is not used by new or open workflows, but might be still needed by
96
+ // Queries sent to closed workflows. The version can be decommissioned safely if user does
97
+ // not query closed workflows. If the user does query closed workflows for some time x after
98
+ // workflows are closed, they should decommission the version after it has been drained for that duration.
99
+ WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5;
100
+ }
@@ -79,6 +79,8 @@ enum WorkflowTaskFailedCause {
79
79
  // for the workflow's namespace).
80
80
  // Check the workflow task failure message for more information.
81
81
  WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED = 35;
82
+ // A workflow task failed because a grpc message was too large.
83
+ WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE = 36;
82
84
  }
83
85
 
84
86
  enum StartChildWorkflowExecutionFailedCause {
@@ -22,9 +22,9 @@ enum ResetReapplyExcludeType {
22
22
  RESET_REAPPLY_EXCLUDE_TYPE_CANCEL_REQUEST = 4 [deprecated=true];
23
23
  }
24
24
 
25
- // Event types to include when reapplying events. Deprecated: applications
26
- // should use ResetReapplyExcludeType to specify exclusions from this set, and
27
- // new event types should be added to ResetReapplyExcludeType instead of here.
25
+ // Deprecated: applications should use ResetReapplyExcludeType to specify
26
+ // exclusions from this set, and new event types should be added to ResetReapplyExcludeType
27
+ // instead of here.
28
28
  enum ResetReapplyType {
29
29
  RESET_REAPPLY_TYPE_UNSPECIFIED = 0;
30
30
  // Signals are reapplied when workflow is reset.
@@ -35,7 +35,7 @@ enum ResetReapplyType {
35
35
  RESET_REAPPLY_TYPE_ALL_ELIGIBLE = 3;
36
36
  }
37
37
 
38
- // Reset type options. Deprecated, see temporal.api.common.v1.ResetOptions.
38
+ // Deprecated, see temporal.api.common.v1.ResetOptions.
39
39
  enum ResetType {
40
40
  RESET_TYPE_UNSPECIFIED = 0;
41
41
  // Resets to event of the first workflow task completed, or if it does not exist, the event after task scheduled.
@@ -77,8 +77,8 @@ message NexusOperationFailureInfo {
77
77
  string operation = 4;
78
78
  // Operation ID - may be empty if the operation completed synchronously.
79
79
  //
80
- // Deprecated: Renamed to operation_token.
81
- string operation_id = 5;
80
+ // Deprecated. Renamed to operation_token.
81
+ string operation_id = 5 [deprecated = true];
82
82
  // Operation token - may be empty if the operation completed synchronously.
83
83
  string operation_token = 6;
84
84
  }
@@ -46,7 +46,7 @@ message WorkflowExecutionStartedEventAttributes {
46
46
  google.protobuf.Duration workflow_run_timeout = 8;
47
47
  // Timeout of a single workflow task.
48
48
  google.protobuf.Duration workflow_task_timeout = 9;
49
- // Run id of the previous workflow which continued-as-new or retired or cron executed into this
49
+ // Run id of the previous workflow which continued-as-new or retried or cron executed into this
50
50
  // workflow.
51
51
  string continued_execution_run_id = 10;
52
52
  temporal.api.enums.v1.ContinueAsNewInitiator initiator = 11;
@@ -84,7 +84,7 @@ message WorkflowExecutionStartedEventAttributes {
84
84
  // If this workflow intends to use anything other than the current overall default version for
85
85
  // the queue, then we include it here.
86
86
  // Deprecated. [cleanup-experimental-wv]
87
- temporal.api.common.v1.WorkerVersionStamp source_version_stamp = 29;
87
+ temporal.api.common.v1.WorkerVersionStamp source_version_stamp = 29 [deprecated = true];
88
88
  // Completion callbacks attached when this workflow was started.
89
89
  repeated temporal.api.common.v1.Callback completion_callbacks = 30;
90
90
 
@@ -117,26 +117,40 @@ message WorkflowExecutionStartedEventAttributes {
117
117
  temporal.api.common.v1.WorkflowExecution root_workflow_execution = 31;
118
118
  // When present, this execution is assigned to the build ID of its parent or previous execution.
119
119
  // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
120
- string inherited_build_id = 32;
120
+ string inherited_build_id = 32 [deprecated = true];
121
121
  // Versioning override applied to this workflow when it was started.
122
+ // Children, crons, retries, and continue-as-new will inherit source run's override if pinned
123
+ // and if the new workflow's Task Queue belongs to the override version.
122
124
  temporal.api.workflow.v1.VersioningOverride versioning_override = 33;
123
125
  // When present, it means this is a child workflow of a parent that is Pinned to this Worker
124
126
  // Deployment Version. In this case, child workflow will start as Pinned to this Version instead
125
127
  // of starting on the Current Version of its Task Queue.
126
128
  // This is set only if the child workflow is starting on a Task Queue belonging to the same
127
129
  // Worker Deployment Version.
128
- // Deprecated. Use `parent_pinned_deployment_version`.
130
+ // Deprecated. Use `parent_versioning_info`.
129
131
  string parent_pinned_worker_deployment_version = 34 [deprecated = true];
130
132
 
131
- // When present, it means this is a child workflow of a parent that is Pinned to this Worker
132
- // Deployment Version. In this case, child workflow will start as Pinned to this Version instead
133
- // of starting on the Current Version of its Task Queue.
134
- // This is set only if the child workflow is starting on a Task Queue belonging to the same
135
- // Worker Deployment Version.
136
- temporal.api.deployment.v1.WorkerDeploymentVersion parent_pinned_deployment_version = 36;
137
-
138
133
  // Priority metadata
139
134
  temporal.api.common.v1.Priority priority = 35;
135
+
136
+ reserved 36;
137
+ reserved "parent_pinned_deployment_version";
138
+
139
+ // If present, the new workflow should start on this version with pinned base behavior.
140
+ // Child of pinned parent will inherit the parent's version if the Child's Task Queue belongs to that version.
141
+ //
142
+ // New run initiated by workflow ContinueAsNew of pinned run, will inherit the previous run's version if the
143
+ // new run's Task Queue belongs to that version.
144
+ //
145
+ // New run initiated by workflow Cron will never inherit.
146
+ //
147
+ // New run initiated by workflow Retry will only inherit if the retried run is effectively pinned at the time
148
+ // of retry, and the retried run inherited a pinned version when it started (ie. it is a child of a pinned
149
+ // parent, or a CaN of a pinned run, and is running on a Task Queue in the inherited version).
150
+ //
151
+ // Pinned override is inherited if Task Queue of new run is compatible with the override version.
152
+ // Override is inherited separately and takes precedence over inherited base version.
153
+ temporal.api.deployment.v1.WorkerDeploymentVersion inherited_pinned_version = 37;
140
154
  }
141
155
 
142
156
  message WorkflowExecutionCompletedEventAttributes {
@@ -183,7 +197,7 @@ message WorkflowExecutionContinuedAsNewEventAttributes {
183
197
  // Deprecated. If a workflow's retry policy would cause a new run to start when the current one
184
198
  // has failed, this field would be populated with that failure. Now (when supported by server
185
199
  // and sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set.
186
- temporal.api.failure.v1.Failure failure = 10;
200
+ temporal.api.failure.v1.Failure failure = 10 [deprecated = true];
187
201
  // TODO: Is this the result of *this* workflow as it continued-as-new?
188
202
  temporal.api.common.v1.Payloads last_completion_result = 11;
189
203
  temporal.api.common.v1.Header header = 12;
@@ -191,7 +205,8 @@ message WorkflowExecutionContinuedAsNewEventAttributes {
191
205
  temporal.api.common.v1.SearchAttributes search_attributes = 14;
192
206
  // If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
193
207
  // the assignment rules will be used to independently assign a Build ID to the new execution.
194
- bool inherit_build_id = 15;
208
+ // Deprecated. Only considered for versioning v0.2.
209
+ bool inherit_build_id = 15 [deprecated = true];
195
210
 
196
211
  // workflow_execution_timeout is omitted as it shouldn't be overridden from within a workflow.
197
212
  }
@@ -301,7 +316,7 @@ message WorkflowTaskFailedEventAttributes {
301
316
  string new_run_id = 7;
302
317
  // TODO: ?
303
318
  int64 fork_event_version = 8;
304
- // DEPRECATED since 1.21 - This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
319
+ // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
305
320
  // If a worker explicitly failed this task, its binary id
306
321
  string binary_checksum = 9 [deprecated = true];
307
322
  // Version info of the worker who processed this workflow task. If present, the `build_id` field
@@ -512,7 +527,7 @@ message WorkflowExecutionSignaledEventAttributes {
512
527
  // Headers that were passed by the sender of the signal and copied by temporal
513
528
  // server into the workflow task.
514
529
  temporal.api.common.v1.Header header = 4;
515
- // This field is deprecated and never respected. It should always be set to false.
530
+ // Deprecated. This field is never respected and should always be set to false.
516
531
  bool skip_generate_workflow_task = 5 [deprecated = true];
517
532
  // When signal origin is a workflow execution, this field is set.
518
533
  temporal.api.common.v1.WorkflowExecution external_workflow_execution = 6;
@@ -534,8 +549,8 @@ message RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {
534
549
  string namespace = 2;
535
550
  string namespace_id = 7;
536
551
  temporal.api.common.v1.WorkflowExecution workflow_execution = 3;
537
- // Deprecated
538
- string control = 4;
552
+ // Deprecated.
553
+ string control = 4 [deprecated = true];
539
554
  // Workers are expected to set this to true if the workflow they are requesting to cancel is
540
555
  // a child of the workflow which issued the request
541
556
  bool child_workflow_only = 5;
@@ -555,8 +570,8 @@ message RequestCancelExternalWorkflowExecutionFailedEventAttributes {
555
570
  // id of the `REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED` event this failure
556
571
  // corresponds to
557
572
  int64 initiated_event_id = 5;
558
- // Deprecated
559
- string control = 6;
573
+ // Deprecated.
574
+ string control = 6 [deprecated = true];
560
575
  }
561
576
 
562
577
  message ExternalWorkflowExecutionCancelRequestedEventAttributes {
@@ -582,8 +597,8 @@ message SignalExternalWorkflowExecutionInitiatedEventAttributes {
582
597
  string signal_name = 4;
583
598
  // Serialized arguments to provide to the signal handler
584
599
  temporal.api.common.v1.Payloads input = 5;
585
- // Deprecated
586
- string control = 6;
600
+ // Deprecated.
601
+ string control = 6 [deprecated = true];
587
602
  // Workers are expected to set this to true if the workflow they are requesting to cancel is
588
603
  // a child of the workflow which issued the request
589
604
  bool child_workflow_only = 7;
@@ -600,8 +615,8 @@ message SignalExternalWorkflowExecutionFailedEventAttributes {
600
615
  string namespace_id = 7;
601
616
  temporal.api.common.v1.WorkflowExecution workflow_execution = 4;
602
617
  int64 initiated_event_id = 5;
603
- // Deprecated
604
- string control = 6;
618
+ // Deprecated.
619
+ string control = 6 [deprecated = true];
605
620
  }
606
621
 
607
622
  message ExternalWorkflowExecutionSignaledEventAttributes {
@@ -612,8 +627,8 @@ message ExternalWorkflowExecutionSignaledEventAttributes {
612
627
  string namespace = 2;
613
628
  string namespace_id = 5;
614
629
  temporal.api.common.v1.WorkflowExecution workflow_execution = 3;
615
- // Deprecated
616
- string control = 4;
630
+ // Deprecated.
631
+ string control = 4 [deprecated = true];
617
632
  }
618
633
 
619
634
  message UpsertWorkflowSearchAttributesEventAttributes {
@@ -648,8 +663,8 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
648
663
  google.protobuf.Duration workflow_task_timeout = 8;
649
664
  // Default: PARENT_CLOSE_POLICY_TERMINATE.
650
665
  temporal.api.enums.v1.ParentClosePolicy parent_close_policy = 9;
651
- // Deprecated
652
- string control = 10;
666
+ // Deprecated.
667
+ string control = 10 [deprecated = true];
653
668
  // The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
654
669
  int64 workflow_task_completed_event_id = 11;
655
670
  // Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE.
@@ -662,7 +677,8 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
662
677
  temporal.api.common.v1.SearchAttributes search_attributes = 17;
663
678
  // If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment
664
679
  // rules of the child's Task Queue will be used to independently assign a Build ID to it.
665
- bool inherit_build_id = 19;
680
+ // Deprecated. Only considered for versioning v0.2.
681
+ bool inherit_build_id = 19 [deprecated = true];
666
682
  // Priority metadata
667
683
  temporal.api.common.v1.Priority priority = 20;
668
684
  }
@@ -675,8 +691,8 @@ message StartChildWorkflowExecutionFailedEventAttributes {
675
691
  string workflow_id = 2;
676
692
  temporal.api.common.v1.WorkflowType workflow_type = 3;
677
693
  temporal.api.enums.v1.StartChildWorkflowExecutionFailedCause cause = 4;
678
- // Deprecated
679
- string control = 5;
694
+ // Deprecated.
695
+ string control = 5 [deprecated = true];
680
696
  // Id of the `START_CHILD_WORKFLOW_EXECUTION_INITIATED` event which this event corresponds to
681
697
  int64 initiated_event_id = 6;
682
698
  // The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
@@ -893,7 +909,7 @@ message NexusOperationStartedEventAttributes {
893
909
  // This ID is used when canceling the operation.
894
910
  //
895
911
  // Deprecated: Renamed to operation_token.
896
- string operation_id = 3;
912
+ string operation_id = 3 [deprecated = true];
897
913
 
898
914
  // The request ID allocated at schedule time.
899
915
  string request_id = 4;
@@ -68,8 +68,8 @@ message CancelOperationRequest {
68
68
  string operation = 2;
69
69
  // Operation ID as originally generated by a Handler.
70
70
  //
71
- // Deprecated: Renamed to operation_token.
72
- string operation_id = 3;
71
+ // Deprecated. Renamed to operation_token.
72
+ string operation_id = 3 [deprecated = true];
73
73
 
74
74
  // Operation token as originally generated by a Handler.
75
75
  string operation_token = 4;
@@ -103,8 +103,8 @@ message StartOperationResponse {
103
103
  // The operation will complete asynchronously.
104
104
  // The returned ID can be used to reference this operation.
105
105
  message Async {
106
- // Deprecated: Renamed to operation_token.
107
- string operation_id = 1;
106
+ // Deprecated. Renamed to operation_token.
107
+ string operation_id = 1 [deprecated = true];
108
108
  repeated Link links = 2;
109
109
  string operation_token = 3;
110
110
  }
@@ -167,7 +167,8 @@ message ScheduleSpec {
167
167
  // Interval-based specifications of times.
168
168
  repeated IntervalSpec interval = 2;
169
169
  // Any timestamps matching any of exclude_* will be skipped.
170
- repeated CalendarSpec exclude_calendar = 3 [deprecated = true]; // use exclude_structured_calendar
170
+ // Deprecated. Use exclude_structured_calendar.
171
+ repeated CalendarSpec exclude_calendar = 3 [deprecated = true];
171
172
  repeated StructuredCalendarSpec exclude_structured_calendar = 9;
172
173
  // If start_time is set, any timestamps before start_time will be skipped.
173
174
  // (Together, start_time and end_time make an inclusive interval.)
@@ -277,6 +278,10 @@ message ScheduleState {
277
278
  message TriggerImmediatelyRequest {
278
279
  // If set, override overlap policy for this one request.
279
280
  temporal.api.enums.v1.ScheduleOverlapPolicy overlap_policy = 1;
281
+
282
+ // Timestamp used for the identity of the target workflow.
283
+ // If not set the default value is the current time.
284
+ google.protobuf.Timestamp scheduled_time = 2;
280
285
  }
281
286
 
282
287
  message BackfillRequest {
@@ -342,6 +347,7 @@ message ScheduleInfo {
342
347
  google.protobuf.Timestamp create_time = 6;
343
348
  google.protobuf.Timestamp update_time = 7;
344
349
 
350
+ // Deprecated.
345
351
  string invalid_schedule_error = 8 [deprecated = true];
346
352
  }
347
353
 
@@ -0,0 +1,134 @@
1
+ syntax = "proto3";
2
+
3
+ package temporal.api.worker.v1;
4
+
5
+ option go_package = "go.temporal.io/api/worker/v1;worker";
6
+ option java_package = "io.temporal.api.worker.v1";
7
+ option java_multiple_files = true;
8
+ option java_outer_classname = "MessageProto";
9
+ option ruby_package = "Temporalio::Api::Worker::V1";
10
+ option csharp_namespace = "Temporalio.Api.Worker.V1";
11
+
12
+ import "google/protobuf/duration.proto";
13
+ import "google/protobuf/timestamp.proto";
14
+ import "temporal/api/deployment/v1/message.proto";
15
+ import "temporal/api/enums/v1/common.proto";
16
+
17
+ message WorkerPollerInfo {
18
+ // Number of polling RPCs that are currently in flight.
19
+ int32 current_pollers = 1;
20
+
21
+ google.protobuf.Timestamp last_successful_poll_time = 2;
22
+
23
+ // Set true if the number of concurrent pollers is auto-scaled
24
+ bool is_autoscaling = 3;
25
+ }
26
+
27
+ message WorkerSlotsInfo {
28
+ // Number of slots available for the worker to specific tasks.
29
+ // May be -1 if the upper bound is not known.
30
+ int32 current_available_slots = 1;
31
+ // Number of slots used by the worker for specific tasks.
32
+ int32 current_used_slots = 2;
33
+
34
+ // Kind of the slot supplier, which is used to determine how the slots are allocated.
35
+ // Possible values: "Fixed | ResourceBased | Custom String"
36
+ string slot_supplier_kind = 3;
37
+
38
+ // Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
39
+ // by the worker since the worker started. This is a cumulative counter.
40
+ int32 total_processed_tasks = 4;
41
+ // Total number of failed tasks processed by the worker so far.
42
+ int32 total_failed_tasks = 5;
43
+
44
+ // Number of tasks processed in since the last heartbeat from the worker.
45
+ // This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
46
+ // Contains both successful and failed tasks.
47
+ int32 last_interval_processed_tasks = 6;
48
+ // Number of failed tasks processed since the last heartbeat from the worker.
49
+ int32 last_interval_failure_tasks = 7;
50
+ }
51
+
52
+ // Holds everything needed to identify the worker host/process context
53
+ message WorkerHostInfo {
54
+ // Worker host identifier.
55
+ string host_name = 1;
56
+
57
+
58
+ // Worker process identifier. This id should be unique for all _processes_
59
+ // running workers in the namespace, and should be shared by all workers
60
+ // in the same process.
61
+ // This will be used to build the worker command nexus task queue name:
62
+ // "temporal-sys/worker-commands/{process_key}"
63
+ string process_key = 5;
64
+
65
+ // Worker process identifier. Unlike process_key, this id only needs to be unique
66
+ // within one host (so using e.g. a unix pid would be appropriate).
67
+ string process_id = 2;
68
+
69
+ // System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
70
+ // cores on the host pegged.
71
+ float current_host_cpu_usage = 3;
72
+ // System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
73
+ // all available memory on the host is used.
74
+ float current_host_mem_usage = 4;
75
+ }
76
+
77
+ // Worker info message, contains information about the worker and its current state.
78
+ // All information is provided by the worker itself.
79
+ // (-- api-linter: core::0140::prepositions=disabled
80
+ // aip.dev/not-precedent: Removing those words make names less clear. --)
81
+ message WorkerHeartbeat {
82
+ // Worker identifier, should be unique for the namespace.
83
+ // It is distinct from worker identity, which is not necessarily namespace-unique.
84
+ string worker_instance_key = 1;
85
+
86
+ // Worker identity, set by the client, may not be unique.
87
+ // Usually host_name+(user group name)+process_id, but can be overwritten by the user.
88
+ string worker_identity = 2;
89
+
90
+ // Worker host information.
91
+ WorkerHostInfo host_info = 3;
92
+
93
+ // Task queue this worker is polling for tasks.
94
+ string task_queue = 4;
95
+
96
+ temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;
97
+
98
+ string sdk_name = 6;
99
+ string sdk_version = 7;
100
+
101
+ // Worker status. Defined by SDK.
102
+ temporal.api.enums.v1.WorkerStatus status = 8;
103
+
104
+ // Worker start time.
105
+ // It can be used to determine worker uptime. (current time - start time)
106
+ google.protobuf.Timestamp start_time = 9;
107
+
108
+ // Timestamp of this heartbeat, coming from the worker. Worker should set it to "now".
109
+ // Note that this timestamp comes directly from the worker and is subject to workers' clock skew.
110
+ google.protobuf.Timestamp heartbeat_time = 10;
111
+ // Elapsed time since the last heartbeat from the worker.
112
+ google.protobuf.Duration elapsed_since_last_heartbeat = 11;
113
+
114
+ WorkerSlotsInfo workflow_task_slots_info = 12;
115
+ WorkerSlotsInfo activity_task_slots_info = 13;
116
+ WorkerSlotsInfo nexus_task_slots_info = 14;
117
+ WorkerSlotsInfo local_activity_slots_info = 15;
118
+
119
+ WorkerPollerInfo workflow_poller_info = 16;
120
+ WorkerPollerInfo workflow_sticky_poller_info = 17;
121
+ WorkerPollerInfo activity_poller_info = 18;
122
+ WorkerPollerInfo nexus_poller_info = 19;
123
+
124
+ // A Workflow Task found a cached Workflow Execution to run against.
125
+ int32 total_sticky_cache_hit = 20;
126
+ // A Workflow Task did not find a cached Workflow execution to run against.
127
+ int32 total_sticky_cache_miss = 21;
128
+ // Current cache size, expressed in number of Workflow Executions.
129
+ int32 current_sticky_cache_size = 22;
130
+ }
131
+
132
+ message WorkerInfo {
133
+ WorkerHeartbeat worker_heartbeat = 1;
134
+ }