@temporalio/core-bridge 1.15.0 → 1.16.1

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 (209) hide show
  1. package/Cargo.lock +172 -70
  2. package/lib/native.d.ts +1 -1
  3. package/package.json +2 -2
  4. package/releases/aarch64-apple-darwin/index.node +0 -0
  5. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  6. package/releases/x86_64-apple-darwin/index.node +0 -0
  7. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  8. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  9. package/sdk-core/.github/workflows/per-pr.yml +6 -6
  10. package/sdk-core/AGENTS.md +41 -30
  11. package/sdk-core/Cargo.toml +3 -0
  12. package/sdk-core/README.md +15 -9
  13. package/sdk-core/crates/client/Cargo.toml +4 -0
  14. package/sdk-core/crates/client/README.md +139 -0
  15. package/sdk-core/crates/client/src/async_activity_handle.rs +297 -0
  16. package/sdk-core/crates/client/src/callback_based.rs +7 -0
  17. package/sdk-core/crates/client/src/errors.rs +294 -0
  18. package/sdk-core/crates/client/src/{raw.rs → grpc.rs} +280 -159
  19. package/sdk-core/crates/client/src/lib.rs +920 -1326
  20. package/sdk-core/crates/client/src/metrics.rs +24 -33
  21. package/sdk-core/crates/client/src/options_structs.rs +457 -0
  22. package/sdk-core/crates/client/src/replaceable.rs +5 -4
  23. package/sdk-core/crates/client/src/request_extensions.rs +8 -9
  24. package/sdk-core/crates/client/src/retry.rs +99 -54
  25. package/sdk-core/crates/client/src/{worker/mod.rs → worker.rs} +1 -1
  26. package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
  27. package/sdk-core/crates/common/Cargo.toml +61 -2
  28. package/sdk-core/crates/common/build.rs +742 -12
  29. package/sdk-core/crates/common/protos/api_upstream/.github/workflows/ci.yml +2 -0
  30. package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
  31. package/sdk-core/crates/common/protos/api_upstream/buf.yaml +0 -3
  32. package/sdk-core/crates/common/protos/api_upstream/cmd/check-path-conflicts/main.go +137 -0
  33. package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv2.json +1166 -770
  34. package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +1243 -750
  35. package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +2 -2
  36. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +4 -3
  37. package/sdk-core/crates/common/protos/api_upstream/temporal/api/failure/v1/message.proto +1 -0
  38. package/sdk-core/crates/common/protos/api_upstream/temporal/api/history/v1/message.proto +4 -0
  39. package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +6 -0
  40. package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +16 -1
  41. package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +64 -6
  42. package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +88 -33
  43. package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +4 -2
  44. package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +4 -0
  45. package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +5 -5
  46. package/sdk-core/crates/common/src/activity_definition.rs +20 -0
  47. package/sdk-core/crates/common/src/data_converters.rs +770 -0
  48. package/sdk-core/crates/common/src/envconfig.rs +5 -0
  49. package/sdk-core/crates/common/src/lib.rs +15 -211
  50. package/sdk-core/crates/common/src/payload_visitor.rs +648 -0
  51. package/sdk-core/crates/common/src/priority.rs +110 -0
  52. package/sdk-core/crates/common/src/protos/canned_histories.rs +3 -0
  53. package/sdk-core/crates/common/src/protos/history_builder.rs +45 -0
  54. package/sdk-core/crates/common/src/protos/history_info.rs +2 -0
  55. package/sdk-core/crates/common/src/protos/mod.rs +122 -27
  56. package/sdk-core/crates/common/src/protos/task_token.rs +3 -3
  57. package/sdk-core/crates/common/src/protos/utilities.rs +11 -0
  58. package/sdk-core/crates/{sdk-core → common}/src/telemetry/log_export.rs +5 -7
  59. package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
  60. package/sdk-core/crates/common/src/telemetry/metrics.rs +268 -223
  61. package/sdk-core/crates/{sdk-core → common}/src/telemetry/otel.rs +8 -13
  62. package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_meter.rs +49 -50
  63. package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_server.rs +2 -3
  64. package/sdk-core/crates/common/src/telemetry.rs +264 -4
  65. package/sdk-core/crates/common/src/worker.rs +68 -603
  66. package/sdk-core/crates/common/src/workflow_definition.rs +60 -0
  67. package/sdk-core/crates/macros/Cargo.toml +5 -1
  68. package/sdk-core/crates/macros/src/activities_definitions.rs +585 -0
  69. package/sdk-core/crates/macros/src/fsm_impl.rs +507 -0
  70. package/sdk-core/crates/macros/src/lib.rs +138 -512
  71. package/sdk-core/crates/macros/src/macro_utils.rs +106 -0
  72. package/sdk-core/crates/macros/src/workflow_definitions.rs +1224 -0
  73. package/sdk-core/crates/sdk/Cargo.toml +19 -6
  74. package/sdk-core/crates/sdk/README.md +415 -0
  75. package/sdk-core/crates/sdk/src/activities.rs +417 -0
  76. package/sdk-core/crates/sdk/src/interceptors.rs +1 -1
  77. package/sdk-core/crates/sdk/src/lib.rs +757 -442
  78. package/sdk-core/crates/sdk/src/workflow_context/options.rs +45 -35
  79. package/sdk-core/crates/sdk/src/workflow_context.rs +1033 -289
  80. package/sdk-core/crates/sdk/src/workflow_future.rs +277 -213
  81. package/sdk-core/crates/sdk/src/workflows.rs +711 -0
  82. package/sdk-core/crates/sdk-core/Cargo.toml +57 -64
  83. package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +41 -35
  84. package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +1 -1
  85. package/sdk-core/crates/sdk-core/src/abstractions.rs +6 -10
  86. package/sdk-core/crates/sdk-core/src/core_tests/activity_tasks.rs +6 -5
  87. package/sdk-core/crates/sdk-core/src/core_tests/mod.rs +13 -15
  88. package/sdk-core/crates/sdk-core/src/core_tests/queries.rs +21 -25
  89. package/sdk-core/crates/sdk-core/src/core_tests/replay_flag.rs +7 -10
  90. package/sdk-core/crates/sdk-core/src/core_tests/updates.rs +14 -17
  91. package/sdk-core/crates/sdk-core/src/core_tests/workers.rs +493 -26
  92. package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +4 -8
  93. package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +7 -7
  94. package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
  95. package/sdk-core/crates/sdk-core/src/lib.rs +41 -111
  96. package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
  97. package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +118 -19
  98. package/sdk-core/crates/sdk-core/src/protosext/mod.rs +2 -2
  99. package/sdk-core/crates/sdk-core/src/replay/mod.rs +14 -5
  100. package/sdk-core/crates/sdk-core/src/telemetry/metrics.rs +179 -196
  101. package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -280
  102. package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +6 -9
  103. package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
  104. package/sdk-core/crates/sdk-core/src/worker/activities/local_activities.rs +11 -14
  105. package/sdk-core/crates/sdk-core/src/worker/activities.rs +16 -19
  106. package/sdk-core/crates/sdk-core/src/worker/client/mocks.rs +9 -5
  107. package/sdk-core/crates/sdk-core/src/worker/client.rs +103 -81
  108. package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +7 -11
  109. package/sdk-core/crates/sdk-core/src/worker/mod.rs +1124 -229
  110. package/sdk-core/crates/sdk-core/src/worker/nexus.rs +145 -23
  111. package/sdk-core/crates/sdk-core/src/worker/slot_provider.rs +2 -2
  112. package/sdk-core/crates/sdk-core/src/worker/tuner/fixed_size.rs +2 -2
  113. package/sdk-core/crates/sdk-core/src/worker/tuner/resource_based.rs +13 -13
  114. package/sdk-core/crates/sdk-core/src/worker/tuner.rs +28 -8
  115. package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
  116. package/sdk-core/crates/sdk-core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +21 -22
  117. package/sdk-core/crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs +19 -4
  118. package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +14 -18
  119. package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +4 -6
  120. package/sdk-core/crates/sdk-core/src/worker/workflow/run_cache.rs +4 -7
  121. package/sdk-core/crates/sdk-core/src/worker/workflow/wft_extraction.rs +2 -4
  122. package/sdk-core/crates/sdk-core/src/worker/workflow/wft_poller.rs +8 -9
  123. package/sdk-core/crates/sdk-core/src/worker/workflow/workflow_stream.rs +1 -3
  124. package/sdk-core/crates/sdk-core/tests/activities_procmacro.rs +6 -0
  125. package/sdk-core/crates/sdk-core/tests/activities_trybuild/basic_pass.rs +54 -0
  126. package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.rs +18 -0
  127. package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.stderr +5 -0
  128. package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.rs +14 -0
  129. package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.stderr +5 -0
  130. package/sdk-core/crates/sdk-core/tests/activities_trybuild/multi_arg_pass.rs +48 -0
  131. package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_input_pass.rs +14 -0
  132. package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_return_type_pass.rs +19 -0
  133. package/sdk-core/crates/sdk-core/tests/cloud_tests.rs +14 -5
  134. package/sdk-core/crates/sdk-core/tests/common/activity_functions.rs +55 -0
  135. package/sdk-core/crates/sdk-core/tests/common/mod.rs +241 -196
  136. package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
  137. package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +3 -5
  138. package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -64
  139. package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +298 -252
  140. package/sdk-core/crates/sdk-core/tests/integ_tests/async_activity_client_tests.rs +230 -0
  141. package/sdk-core/crates/sdk-core/tests/integ_tests/client_tests.rs +94 -57
  142. package/sdk-core/crates/sdk-core/tests/integ_tests/data_converter_tests.rs +381 -0
  143. package/sdk-core/crates/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +16 -12
  144. package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +48 -40
  145. package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +327 -255
  146. package/sdk-core/crates/sdk-core/tests/integ_tests/pagination_tests.rs +50 -45
  147. package/sdk-core/crates/sdk-core/tests/integ_tests/polling_tests.rs +147 -126
  148. package/sdk-core/crates/sdk-core/tests/integ_tests/queries_tests.rs +103 -89
  149. package/sdk-core/crates/sdk-core/tests/integ_tests/update_tests.rs +609 -453
  150. package/sdk-core/crates/sdk-core/tests/integ_tests/visibility_tests.rs +80 -62
  151. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +360 -231
  152. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +248 -185
  153. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -43
  154. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_client_tests.rs +180 -0
  155. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/activities.rs +428 -315
  156. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -56
  157. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -28
  158. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -243
  159. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/client_interactions.rs +552 -0
  160. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +101 -42
  161. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -147
  162. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -28
  163. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1036
  164. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -41
  165. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +397 -238
  166. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +414 -189
  167. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/queries.rs +415 -0
  168. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/replay.rs +96 -36
  169. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/resets.rs +154 -137
  170. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -105
  171. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -38
  172. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -40
  173. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -54
  174. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +363 -226
  175. package/sdk-core/crates/sdk-core/tests/main.rs +17 -15
  176. package/sdk-core/crates/sdk-core/tests/manual_tests.rs +207 -152
  177. package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +65 -34
  178. package/sdk-core/crates/sdk-core/tests/shared_tests/priority.rs +107 -84
  179. package/sdk-core/crates/sdk-core/tests/workflows_procmacro.rs +6 -0
  180. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.rs +26 -0
  181. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.stderr +5 -0
  182. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/basic_pass.rs +49 -0
  183. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/minimal_pass.rs +21 -0
  184. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.rs +26 -0
  185. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.stderr +5 -0
  186. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.rs +21 -0
  187. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.stderr +5 -0
  188. package/sdk-core/crates/sdk-core-c-bridge/Cargo.toml +7 -1
  189. package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +14 -14
  190. package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +83 -74
  191. package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +9 -14
  192. package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +1 -2
  193. package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +13 -13
  194. package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +6 -6
  195. package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +3 -4
  196. package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +62 -75
  197. package/sdk-core/rustfmt.toml +2 -1
  198. package/src/client.rs +205 -318
  199. package/src/metrics.rs +22 -30
  200. package/src/runtime.rs +4 -5
  201. package/src/worker.rs +16 -19
  202. package/ts/native.ts +1 -1
  203. package/sdk-core/crates/client/src/workflow_handle/mod.rs +0 -212
  204. package/sdk-core/crates/common/src/errors.rs +0 -85
  205. package/sdk-core/crates/common/tests/worker_task_types_test.rs +0 -129
  206. package/sdk-core/crates/sdk/src/activity_context.rs +0 -238
  207. package/sdk-core/crates/sdk/src/app_data.rs +0 -37
  208. package/sdk-core/crates/sdk-core/tests/integ_tests/activity_functions.rs +0 -5
  209. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +0 -61
@@ -18,7 +18,7 @@ import "temporal/api/common/v1/message.proto";
18
18
  // Worker Deployment options set in SDK that need to be sent to server in every poll.
19
19
  // Experimental. Worker Deployments are experimental and might significantly change in the future.
20
20
  message WorkerDeploymentOptions {
21
- // Required. Worker Deployment name.
21
+ // Required when `worker_versioning_mode==VERSIONED`.
22
22
  string deployment_name = 1;
23
23
  // The Build ID of the worker. Required when `worker_versioning_mode==VERSIONED`, in which case,
24
24
  // the worker will be part of a Deployment Version.
@@ -311,4 +311,4 @@ message InheritedAutoUpgradeInfo {
311
311
  temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1;
312
312
  // The revision number of the source deployment version of the parent/previous workflow.
313
313
  int64 source_deployment_revision_number = 2;
314
- }
314
+ }
@@ -204,7 +204,8 @@ enum SuggestContinueAsNewReason {
204
204
  // Workflow's count of completed plus in-flight updates is too large.
205
205
  SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_UPDATES = 3;
206
206
 
207
- // Workflow's Target Worker Deployment Version is different from its
208
- // Current Version and the workflow is versioned.
209
- SUGGEST_CONTINUE_AS_NEW_REASON_TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED = 4;
207
+ // TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED is no longer a reason for suggest_continue_as_new.
208
+ // See target_worker_deployment_version_changed to find out if Target Version Changed.
209
+ reserved 4;
210
+ reserved "SUGGEST_CONTINUE_AS_NEW_REASON_TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED";
210
211
  }
@@ -66,6 +66,7 @@ message ChildWorkflowExecutionFailureInfo {
66
66
  temporal.api.enums.v1.RetryState retry_state = 6;
67
67
  }
68
68
 
69
+ // Representation of the Temporal SDK NexusOperationError object that is returned to workflow callers.
69
70
  message NexusOperationFailureInfo {
70
71
  // The NexusOperationScheduled event ID.
71
72
  int64 scheduled_event_id = 1;
@@ -280,6 +280,10 @@ message WorkflowTaskStartedEventAttributes {
280
280
  // The reason(s) that suggest_continue_as_new is true, if it is.
281
281
  // Unset if suggest_continue_as_new is false.
282
282
  repeated temporal.api.enums.v1.SuggestContinueAsNewReason suggest_continue_as_new_reasons = 8;
283
+ // True if Workflow's Target Worker Deployment Version is different from its Pinned Version and
284
+ // the workflow is Pinned.
285
+ // Experimental.
286
+ bool target_worker_deployment_version_changed = 9;
283
287
  // Total history size in bytes, which the workflow might use to decide when to
284
288
  // continue-as-new regardless of the suggestion. Note that history event count is
285
289
  // just the event id of this event, so we don't include it explicitly here.
@@ -42,6 +42,12 @@ message NamespaceInfo {
42
42
  bool workflow_pause = 6;
43
43
  // True if the namespace supports standalone activities
44
44
  bool standalone_activities = 7;
45
+ // True if the namespace supports server-side completion of outstanding worker polls on shutdown.
46
+ // When enabled, the server will complete polls for workers that send WorkerInstanceKey in their
47
+ // poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return
48
+ // an empty response. When this flag is true, workers should allow polls to return gracefully
49
+ // rather than terminating any open polls on shutdown.
50
+ bool worker_poll_complete_on_shutdown = 8;
45
51
  }
46
52
 
47
53
  // Namespace configured limits
@@ -12,14 +12,17 @@ option csharp_namespace = "Temporalio.Api.Nexus.V1";
12
12
  import "google/protobuf/timestamp.proto";
13
13
  import "temporal/api/common/v1/message.proto";
14
14
  import "temporal/api/enums/v1/nexus.proto";
15
+ import "temporal/api/failure/v1/message.proto";
15
16
 
16
17
  // A general purpose failure message.
17
18
  // See: https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure
18
19
  message Failure {
19
20
  string message = 1;
21
+ string stack_trace = 4;
20
22
  map<string, string> metadata = 2;
21
23
  // UTF-8 encoded JSON serializable details.
22
24
  bytes details = 3;
25
+ Failure cause = 5;
23
26
  }
24
27
 
25
28
  message HandlerError {
@@ -77,6 +80,12 @@ message CancelOperationRequest {
77
80
 
78
81
  // A Nexus request.
79
82
  message Request {
83
+ message Capabilities {
84
+ // If set, handlers may use temporal.api.failure.v1.Failure instances to return failures to the server.
85
+ // This also allows handler and operation errors to have their own messages and stack traces.
86
+ bool temporal_failure_responses = 1;
87
+ }
88
+
80
89
  // Headers extracted from the original request in the Temporal frontend.
81
90
  // When using Nexus over HTTP, this includes the request's HTTP headers ignoring multiple values.
82
91
  map<string, string> header = 1;
@@ -86,6 +95,8 @@ message Request {
86
95
  // aip.dev/not-precedent: Not following linter rules. --)
87
96
  google.protobuf.Timestamp scheduled_time = 2;
88
97
 
98
+ Capabilities capabilities = 100;
99
+
89
100
  oneof variant {
90
101
  StartOperationRequest start_operation = 3;
91
102
  CancelOperationRequest cancel_operation = 4;
@@ -117,7 +128,11 @@ message StartOperationResponse {
117
128
  Sync sync_success = 1;
118
129
  Async async_success = 2;
119
130
  // The operation completed unsuccessfully (failed or canceled).
120
- UnsuccessfulOperationError operation_error = 3;
131
+ // Deprecated. Use the failure variant instead.
132
+ UnsuccessfulOperationError operation_error = 3 [deprecated = true];
133
+ // The operation completed unsuccessfully (failed or canceled).
134
+ // Failure object must contain an ApplicationFailureInfo or CanceledFailureInfo object.
135
+ temporal.api.failure.v1.Failure failure = 4;
121
136
  }
122
137
  }
123
138
 
@@ -259,6 +259,9 @@ message PollWorkflowTaskQueueRequest {
259
259
  temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
260
260
  // The identity of the worker/client who is polling this task queue
261
261
  string identity = 3;
262
+ // A unique key for this worker instance, used for tracking worker lifecycle.
263
+ // This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
264
+ string worker_instance_key = 8;
262
265
  // Deprecated. Use deployment_options instead.
263
266
  // Each worker process should provide an ID unique to the specific set of code it is running
264
267
  // "checksum" in this field name isn't very accurate, it should be though of as an id.
@@ -270,6 +273,10 @@ message PollWorkflowTaskQueueRequest {
270
273
  // Worker deployment options that user has set in the worker.
271
274
  // Experimental. Worker Deployments are experimental and might significantly change in the future.
272
275
  temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 6;
276
+
277
+ // Removed in 1.55.0; was temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat
278
+ reserved 7;
279
+ reserved "worker_heartbeat";
273
280
  }
274
281
 
275
282
  message PollWorkflowTaskQueueResponse {
@@ -434,6 +441,9 @@ message PollActivityTaskQueueRequest {
434
441
  temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
435
442
  // The identity of the worker/client
436
443
  string identity = 3;
444
+ // A unique key for this worker instance, used for tracking worker lifecycle.
445
+ // This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
446
+ string worker_instance_key = 8;
437
447
  temporal.api.taskqueue.v1.TaskQueueMetadata task_queue_metadata = 4;
438
448
  // Information about this worker's build identifier and if it is choosing to use the versioning
439
449
  // feature. See the `WorkerVersionCapabilities` docstring for more.
@@ -441,16 +451,22 @@ message PollActivityTaskQueueRequest {
441
451
  temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 5 [deprecated = true];
442
452
  // Worker deployment options that user has set in the worker.
443
453
  temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 6;
454
+
455
+ // Removed in 1.55.0; was temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat
456
+ reserved 7;
457
+ reserved "worker_heartbeat";
444
458
  }
445
459
 
446
460
  message PollActivityTaskQueueResponse {
447
461
  // A unique identifier for this task
448
462
  bytes task_token = 1;
449
- // The namespace the workflow which requested this activity lives in
463
+ // The namespace of the activity. If this is a workflow activity then this is the namespace of
464
+ // the workflow also. If this is a standalone activity then the name of this field is
465
+ // misleading, but retained for compatibility with workflow activities.
450
466
  string workflow_namespace = 2;
451
- // Type of the requesting workflow
467
+ // Type of the requesting workflow (if this is a workflow activity).
452
468
  temporal.api.common.v1.WorkflowType workflow_type = 3;
453
- // Execution info of the requesting workflow
469
+ // Execution info of the requesting workflow (if this is a workflow activity)
454
470
  temporal.api.common.v1.WorkflowExecution workflow_execution = 4;
455
471
  temporal.api.common.v1.ActivityType activity_type = 5;
456
472
  // The autogenerated or user specified identifier of this activity. Can be used to complete the
@@ -1007,11 +1023,24 @@ message ResetStickyTaskQueueResponse {
1007
1023
 
1008
1024
  message ShutdownWorkerRequest {
1009
1025
  string namespace = 1;
1026
+ // sticky_task_queue may not always be populated. We want to ensure all workers
1027
+ // send a shutdown request to update worker state for heartbeating, as well
1028
+ // as cancel pending poll calls early, instead of waiting for timeouts.
1010
1029
  string sticky_task_queue = 2;
1011
1030
  string identity = 3;
1012
1031
  string reason = 4;
1013
-
1014
1032
  temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat = 5;
1033
+ // Technically this is also sent in the WorkerHeartbeat, but
1034
+ // since worker heartbeating can be turned off, this needs
1035
+ // to be a separate, top-level field.
1036
+ string worker_instance_key = 6;
1037
+ // Task queue name the worker is polling on. This allows server to cancel
1038
+ // all outstanding poll RPC calls from SDK. This avoids a race condition that
1039
+ // can lead to tasks being lost.
1040
+ string task_queue = 7;
1041
+ // Task queue types that help server cancel outstanding poll RPC
1042
+ // calls from SDK. This avoids a race condition that can lead to tasks being lost.
1043
+ repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 8;
1015
1044
  }
1016
1045
 
1017
1046
  message ShutdownWorkerResponse {
@@ -1368,6 +1397,30 @@ message ListSchedulesResponse {
1368
1397
  bytes next_page_token = 2;
1369
1398
  }
1370
1399
 
1400
+ message CountSchedulesRequest {
1401
+ string namespace = 1;
1402
+ // Visibility query, see https://docs.temporal.io/list-filter for the syntax.
1403
+ string query = 2;
1404
+ }
1405
+
1406
+ message CountSchedulesResponse {
1407
+ // If `query` is not grouping by any field, the count is an approximate number
1408
+ // of schedules that match the query.
1409
+ // If `query` is grouping by a field, the count is simply the sum of the counts
1410
+ // of the groups returned in the response. This number can be smaller than the
1411
+ // total number of schedules matching the query.
1412
+ int64 count = 1;
1413
+
1414
+ // Contains the groups if the request is grouping by a field.
1415
+ // The list might not be complete, and the counts of each group is approximate.
1416
+ repeated AggregationGroup groups = 2;
1417
+
1418
+ message AggregationGroup {
1419
+ repeated temporal.api.common.v1.Payload group_values = 1;
1420
+ int64 count = 2;
1421
+ }
1422
+ }
1423
+
1371
1424
  // [cleanup-wv-pre-release]
1372
1425
  message UpdateWorkerBuildIdCompatibilityRequest {
1373
1426
  message AddNewCompatibleVersion {
@@ -1797,6 +1850,9 @@ message PollNexusTaskQueueRequest {
1797
1850
  string namespace = 1;
1798
1851
  // The identity of the client who initiated this request.
1799
1852
  string identity = 2;
1853
+ // A unique key for this worker instance, used for tracking worker lifecycle.
1854
+ // This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
1855
+ string worker_instance_key = 8;
1800
1856
  temporal.api.taskqueue.v1.TaskQueue task_queue = 3;
1801
1857
  // Information about this worker's build identifier and if it is choosing to use the versioning
1802
1858
  // feature. See the `WorkerVersionCapabilities` docstring for more.
@@ -1837,8 +1893,10 @@ message RespondNexusTaskFailedRequest {
1837
1893
  string identity = 2;
1838
1894
  // A unique identifier for this task.
1839
1895
  bytes task_token = 3;
1840
- // The error the handler failed with.
1841
- temporal.api.nexus.v1.HandlerError error = 4;
1896
+ // Deprecated. Use the failure field instead.
1897
+ temporal.api.nexus.v1.HandlerError error = 4 [deprecated = true];
1898
+ // The error the handler failed with. Must contain a NexusHandlerFailureInfo object.
1899
+ temporal.api.failure.v1.Failure failure = 5;
1842
1900
  }
1843
1901
 
1844
1902
  message RespondNexusTaskFailedResponse {
@@ -111,16 +111,9 @@ service WorkflowService {
111
111
  // Upon failure, it returns `MultiOperationExecutionFailure` where the status code
112
112
  // equals the status code of the *first* operation that failed to be started.
113
113
  //
114
- // NOTE: Experimental API.
114
+ // (-- api-linter: core::0127::http-annotation=disabled
115
+ // aip.dev/not-precedent: To be exposed over HTTP in the future. --)
115
116
  rpc ExecuteMultiOperation (ExecuteMultiOperationRequest) returns (ExecuteMultiOperationResponse) {
116
- option (google.api.http) = {
117
- post: "/namespaces/{namespace}/workflows/execute-multi-operation"
118
- body: "*"
119
- additional_bindings {
120
- post: "/api/v1/namespaces/{namespace}/workflows/execute-multi-operation"
121
- body: "*"
122
- }
123
- };
124
117
  }
125
118
 
126
119
  // GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with
@@ -218,10 +211,10 @@ service WorkflowService {
218
211
  // indicates whether cancellation has been requested for the activity.
219
212
  rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) {
220
213
  option (google.api.http) = {
221
- post: "/namespaces/{namespace}/activities/heartbeat"
214
+ post: "/namespaces/{namespace}/activity-heartbeat"
222
215
  body: "*"
223
216
  additional_bindings {
224
- post: "/api/v1/namespaces/{namespace}/activities/heartbeat"
217
+ post: "/api/v1/namespaces/{namespace}/activity-heartbeat"
225
218
  body: "*"
226
219
  }
227
220
  };
@@ -234,10 +227,21 @@ service WorkflowService {
234
227
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
235
228
  rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) {
236
229
  option (google.api.http) = {
237
- post: "/namespaces/{namespace}/activities/heartbeat-by-id"
230
+ // Standalone
231
+ post: "/namespaces/{namespace}/activities/{activity_id}/heartbeat"
238
232
  body: "*"
239
233
  additional_bindings {
240
- post: "/api/v1/namespaces/{namespace}/activities/heartbeat-by-id"
234
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/heartbeat"
235
+ body: "*"
236
+ }
237
+
238
+ // Workflow
239
+ additional_bindings {
240
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/heartbeat"
241
+ body: "*"
242
+ }
243
+ additional_bindings {
244
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/heartbeat"
241
245
  body: "*"
242
246
  }
243
247
  };
@@ -251,10 +255,10 @@ service WorkflowService {
251
255
  // no longer valid due to activity timeout, already being completed, or never having existed.
252
256
  rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) {
253
257
  option (google.api.http) = {
254
- post: "/namespaces/{namespace}/activities/complete"
258
+ post: "/namespaces/{namespace}/activity-complete"
255
259
  body: "*"
256
260
  additional_bindings {
257
- post: "/api/v1/namespaces/{namespace}/activities/complete"
261
+ post: "/api/v1/namespaces/{namespace}/activity-complete"
258
262
  body: "*"
259
263
  }
260
264
  };
@@ -267,10 +271,21 @@ service WorkflowService {
267
271
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
268
272
  rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) {
269
273
  option (google.api.http) = {
270
- post: "/namespaces/{namespace}/activities/complete-by-id"
274
+ // Standalone
275
+ post: "/namespaces/{namespace}/activities/{activity_id}/complete"
271
276
  body: "*"
272
277
  additional_bindings {
273
- post: "/api/v1/namespaces/{namespace}/activities/complete-by-id"
278
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/complete"
279
+ body: "*"
280
+ }
281
+
282
+ // Workflow
283
+ additional_bindings {
284
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/complete"
285
+ body: "*"
286
+ }
287
+ additional_bindings {
288
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/complete"
274
289
  body: "*"
275
290
  }
276
291
  };
@@ -283,10 +298,10 @@ service WorkflowService {
283
298
  // longer valid due to activity timeout, already being completed, or never having existed.
284
299
  rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) {
285
300
  option (google.api.http) = {
286
- post: "/namespaces/{namespace}/activities/fail"
301
+ post: "/namespaces/{namespace}/activity-fail"
287
302
  body: "*"
288
303
  additional_bindings {
289
- post: "/api/v1/namespaces/{namespace}/activities/fail"
304
+ post: "/api/v1/namespaces/{namespace}/activity-fail"
290
305
  body: "*"
291
306
  }
292
307
  };
@@ -299,10 +314,21 @@ service WorkflowService {
299
314
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
300
315
  rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) {
301
316
  option (google.api.http) = {
302
- post: "/namespaces/{namespace}/activities/fail-by-id"
317
+ // Standalone
318
+ post: "/namespaces/{namespace}/activities/{activity_id}/fail"
303
319
  body: "*"
304
320
  additional_bindings {
305
- post: "/api/v1/namespaces/{namespace}/activities/fail-by-id"
321
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/fail"
322
+ body: "*"
323
+ }
324
+
325
+ // Workflow
326
+ additional_bindings {
327
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/fail"
328
+ body: "*"
329
+ }
330
+ additional_bindings {
331
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/fail"
306
332
  body: "*"
307
333
  }
308
334
  };
@@ -315,10 +341,10 @@ service WorkflowService {
315
341
  // no longer valid due to activity timeout, already being completed, or never having existed.
316
342
  rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) {
317
343
  option (google.api.http) = {
318
- post: "/namespaces/{namespace}/activities/cancel"
344
+ post: "/namespaces/{namespace}/activity-resolve-as-canceled"
319
345
  body: "*"
320
346
  additional_bindings {
321
- post: "/api/v1/namespaces/{namespace}/activities/cancel"
347
+ post: "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled"
322
348
  body: "*"
323
349
  }
324
350
  };
@@ -331,10 +357,21 @@ service WorkflowService {
331
357
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
332
358
  rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) {
333
359
  option (google.api.http) = {
334
- post: "/namespaces/{namespace}/activities/cancel-by-id"
360
+ // Standalone
361
+ post: "/namespaces/{namespace}/activities/{activity_id}/resolve-as-canceled"
335
362
  body: "*"
336
363
  additional_bindings {
337
- post: "/api/v1/namespaces/{namespace}/activities/cancel-by-id"
364
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/resolve-as-canceled"
365
+ body: "*"
366
+ }
367
+
368
+ // Workflow
369
+ additional_bindings {
370
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resolve-as-canceled"
371
+ body: "*"
372
+ }
373
+ additional_bindings {
374
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resolve-as-canceled"
338
375
  body: "*"
339
376
  }
340
377
  };
@@ -670,6 +707,16 @@ service WorkflowService {
670
707
  };
671
708
  }
672
709
 
710
+ // CountSchedules is a visibility API to count schedules in a specific namespace.
711
+ rpc CountSchedules (CountSchedulesRequest) returns (CountSchedulesResponse) {
712
+ option (google.api.http) = {
713
+ get: "/namespaces/{namespace}/schedule-count"
714
+ additional_bindings {
715
+ get: "/api/v1/namespaces/{namespace}/schedule-count"
716
+ }
717
+ };
718
+ }
719
+
673
720
  // Deprecated. Use `UpdateWorkerVersioningRules`.
674
721
  //
675
722
  // Allows users to specify sets of worker build id versions on a per task queue basis. Versions
@@ -1035,10 +1082,10 @@ service WorkflowService {
1035
1082
  // structured to work well for standalone activities.
1036
1083
  rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) {
1037
1084
  option (google.api.http) = {
1038
- post: "/namespaces/{namespace}/activities/update-options"
1085
+ post: "/namespaces/{namespace}/activities-deprecated/update-options"
1039
1086
  body: "*"
1040
1087
  additional_bindings {
1041
- post: "/api/v1/namespaces/{namespace}/activities/update-options"
1088
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/update-options"
1042
1089
  body: "*"
1043
1090
  }
1044
1091
  };
@@ -1076,10 +1123,10 @@ service WorkflowService {
1076
1123
  // structured to work well for standalone activities.
1077
1124
  rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) {
1078
1125
  option (google.api.http) = {
1079
- post: "/namespaces/{namespace}/activities/pause"
1126
+ post: "/namespaces/{namespace}/activities-deprecated/pause"
1080
1127
  body: "*"
1081
1128
  additional_bindings {
1082
- post: "/api/v1/namespaces/{namespace}/activities/pause"
1129
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/pause"
1083
1130
  body: "*"
1084
1131
  }
1085
1132
  };
@@ -1102,10 +1149,10 @@ service WorkflowService {
1102
1149
  // structured to work well for standalone activities.
1103
1150
  rpc UnpauseActivity (UnpauseActivityRequest) returns (UnpauseActivityResponse) {
1104
1151
  option (google.api.http) = {
1105
- post: "/namespaces/{namespace}/activities/unpause"
1152
+ post: "/namespaces/{namespace}/activities-deprecated/unpause"
1106
1153
  body: "*"
1107
1154
  additional_bindings {
1108
- post: "/api/v1/namespaces/{namespace}/activities/unpause"
1155
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/unpause"
1109
1156
  body: "*"
1110
1157
  }
1111
1158
  };
@@ -1132,10 +1179,10 @@ service WorkflowService {
1132
1179
  // structured to work well for standalone activities.
1133
1180
  rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) {
1134
1181
  option (google.api.http) = {
1135
- post: "/namespaces/{namespace}/activities/reset"
1182
+ post: "/namespaces/{namespace}/activities-deprecated/reset"
1136
1183
  body: "*"
1137
1184
  additional_bindings {
1138
- post: "/api/v1/namespaces/{namespace}/activities/reset"
1185
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/reset"
1139
1186
  body: "*"
1140
1187
  }
1141
1188
  };
@@ -1288,6 +1335,10 @@ service WorkflowService {
1288
1335
  option (google.api.http) = {
1289
1336
  post: "/namespaces/{namespace}/workflows/{workflow_id}/pause"
1290
1337
  body: "*"
1338
+ additional_bindings {
1339
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/pause"
1340
+ body: "*"
1341
+ }
1291
1342
  };
1292
1343
  }
1293
1344
 
@@ -1300,6 +1351,10 @@ service WorkflowService {
1300
1351
  option (google.api.http) = {
1301
1352
  post: "/namespaces/{namespace}/workflows/{workflow_id}/unpause"
1302
1353
  body: "*"
1354
+ additional_bindings {
1355
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/unpause"
1356
+ body: "*"
1357
+ }
1303
1358
  };
1304
1359
  }
1305
1360
 
@@ -28,13 +28,15 @@ message NexusTaskCompletion {
28
28
  // The handler completed (successfully or not). Note that the response kind must match the
29
29
  // request kind (start or cancel).
30
30
  temporal.api.nexus.v1.Response completed = 2;
31
- // The handler could not complete the request for some reason.
32
- temporal.api.nexus.v1.HandlerError error = 3;
31
+ // The handler could not complete the request for some reason. Deprecated, use failure.
32
+ temporal.api.nexus.v1.HandlerError error = 3 [deprecated = true];
33
33
  // The lang SDK acknowledges that it is responding to a `CancelNexusTask` and thus the
34
34
  // response is irrelevant. This is not the only way to respond to a cancel, the other
35
35
  // variants can still be used, but this variant should be used when the handler was aborted
36
36
  // by cancellation.
37
37
  bool ack_cancel = 4;
38
+ // The handler could not complete the request for some reason.
39
+ temporal.api.failure.v1.Failure failure = 5;
38
40
  }
39
41
  }
40
42
 
@@ -98,6 +98,10 @@ message WorkflowActivation {
98
98
  // For example, choose to AutoUpgrade on continue-as-new instead of inheriting the pinned version
99
99
  // of the previous run.
100
100
  repeated temporal.api.enums.v1.SuggestContinueAsNewReason suggest_continue_as_new_reasons = 11;
101
+ // True if Workflow's Target Worker Deployment Version is different from its Pinned Version and
102
+ // the workflow is Pinned.
103
+ // Experimental.
104
+ bool target_worker_deployment_version_changed = 12;
101
105
  }
102
106
 
103
107
  message WorkflowActivationJob {
@@ -209,7 +209,7 @@ message ContinueAsNewWorkflowExecution {
209
209
  map<string, temporal.api.common.v1.Payload> headers = 7;
210
210
  // If set, the new workflow will have these search attributes. If unset, re-uses the current
211
211
  // workflow's search attributes.
212
- map<string, temporal.api.common.v1.Payload> search_attributes = 8;
212
+ temporal.api.common.v1.SearchAttributes search_attributes = 8;
213
213
  // If set, the new workflow will have this retry policy. If unset, re-uses the current
214
214
  // workflow's retry policy.
215
215
  temporal.api.common.v1.RetryPolicy retry_policy = 9;
@@ -263,7 +263,7 @@ message StartChildWorkflowExecution {
263
263
  // Memo fields
264
264
  map<string, temporal.api.common.v1.Payload> memo = 16;
265
265
  // Search attributes
266
- map<string, temporal.api.common.v1.Payload> search_attributes = 17;
266
+ temporal.api.common.v1.SearchAttributes search_attributes = 17;
267
267
  // Defines behaviour of the underlying workflow when child workflow cancellation has been requested.
268
268
  child_workflow.ChildWorkflowCancellationType cancellation_type = 18;
269
269
  // Whether this child should run on a worker with a compatible build id or not.
@@ -317,9 +317,9 @@ message CancelSignalWorkflow {
317
317
  }
318
318
 
319
319
  message UpsertWorkflowSearchAttributes {
320
- // SearchAttributes fields - equivalent to indexed_fields on api. Key = search index, Value =
321
- // value?
322
- map<string, temporal.api.common.v1.Payload> search_attributes = 1;
320
+ // SearchAttributes to upsert. The indexed_fields map will be merged with existing search
321
+ // attributes, with these values taking precedence.
322
+ temporal.api.common.v1.SearchAttributes search_attributes = 1;
323
323
  }
324
324
 
325
325
  message ModifyWorkflowProperties {
@@ -0,0 +1,20 @@
1
+ //! Contains types for activity definitions, used by the code generated by the macros for defining
2
+ //! activities, or directly by users targeting activities in other languages.
3
+
4
+ use crate::data_converters::{TemporalDeserializable, TemporalSerializable};
5
+
6
+ /// Implement on a marker struct to define an activity.
7
+ ///
8
+ /// Typically, you will want to use the `#[activity]` attribute within an `#[activities]` macro to
9
+ /// define activities. However, this trait may be implemented manually if desired.
10
+ pub trait ActivityDefinition {
11
+ /// Type of the input argument to the workflow
12
+ type Input: TemporalDeserializable + TemporalSerializable + 'static;
13
+ /// Type of the output of the workflow
14
+ type Output: TemporalDeserializable + TemporalSerializable + 'static;
15
+
16
+ /// The name that will be used for the activity type.
17
+ fn name() -> &'static str
18
+ where
19
+ Self: Sized;
20
+ }