@temporalio/core-bridge 1.14.2-canary-release-testing.0 → 1.16.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 (233) hide show
  1. package/Cargo.lock +794 -650
  2. package/bridge-macros/src/derive_tryintojs.rs +40 -0
  3. package/lib/native.d.ts +24 -3
  4. package/package.json +4 -4
  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/.github/workflows/per-pr.yml +6 -6
  11. package/sdk-core/AGENTS.md +42 -31
  12. package/sdk-core/Cargo.toml +4 -1
  13. package/sdk-core/README.md +19 -13
  14. package/sdk-core/crates/client/Cargo.toml +4 -0
  15. package/sdk-core/crates/client/README.md +139 -0
  16. package/sdk-core/crates/client/src/async_activity_handle.rs +297 -0
  17. package/sdk-core/crates/client/src/callback_based.rs +7 -0
  18. package/sdk-core/crates/client/src/errors.rs +294 -0
  19. package/sdk-core/crates/client/src/{raw.rs → grpc.rs} +370 -159
  20. package/sdk-core/crates/client/src/lib.rs +920 -1326
  21. package/sdk-core/crates/client/src/metrics.rs +24 -33
  22. package/sdk-core/crates/client/src/options_structs.rs +457 -0
  23. package/sdk-core/crates/client/src/replaceable.rs +5 -4
  24. package/sdk-core/crates/client/src/request_extensions.rs +8 -9
  25. package/sdk-core/crates/client/src/retry.rs +99 -54
  26. package/sdk-core/crates/client/src/{worker/mod.rs → worker.rs} +104 -29
  27. package/sdk-core/crates/client/src/workflow_handle.rs +826 -0
  28. package/sdk-core/crates/common/Cargo.toml +62 -3
  29. package/sdk-core/crates/common/build.rs +742 -12
  30. package/sdk-core/crates/common/protos/api_upstream/.github/workflows/ci.yml +2 -0
  31. package/sdk-core/crates/common/protos/api_upstream/.github/workflows/create-release.yml +0 -5
  32. package/sdk-core/crates/common/protos/api_upstream/Makefile +2 -1
  33. package/sdk-core/crates/common/protos/api_upstream/README.md +8 -0
  34. package/sdk-core/crates/common/protos/api_upstream/cmd/check-path-conflicts/main.go +137 -0
  35. package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv2.json +3329 -2647
  36. package/sdk-core/crates/common/protos/api_upstream/openapi/openapiv3.yaml +2734 -708
  37. package/sdk-core/crates/common/protos/api_upstream/temporal/api/activity/v1/message.proto +155 -3
  38. package/sdk-core/crates/common/protos/api_upstream/temporal/api/command/v1/message.proto +26 -0
  39. package/sdk-core/crates/common/protos/api_upstream/temporal/api/common/v1/message.proto +8 -1
  40. package/sdk-core/crates/common/protos/api_upstream/temporal/api/deployment/v1/message.proto +27 -1
  41. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/activity.proto +81 -0
  42. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/event_type.proto +4 -0
  43. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +4 -0
  44. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +15 -0
  45. package/sdk-core/crates/common/protos/api_upstream/temporal/api/enums/v1/workflow.proto +63 -15
  46. package/sdk-core/crates/common/protos/api_upstream/temporal/api/errordetails/v1/message.proto +8 -0
  47. package/sdk-core/crates/common/protos/api_upstream/temporal/api/failure/v1/message.proto +1 -0
  48. package/sdk-core/crates/common/protos/api_upstream/temporal/api/history/v1/message.proto +111 -17
  49. package/sdk-core/crates/common/protos/api_upstream/temporal/api/namespace/v1/message.proto +21 -0
  50. package/sdk-core/crates/common/protos/api_upstream/temporal/api/nexus/v1/message.proto +20 -1
  51. package/sdk-core/crates/common/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +4 -0
  52. package/sdk-core/crates/common/protos/api_upstream/temporal/api/schedule/v1/message.proto +2 -2
  53. package/sdk-core/crates/common/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -0
  54. package/sdk-core/crates/common/protos/api_upstream/temporal/api/worker/v1/message.proto +4 -7
  55. package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflow/v1/message.proto +80 -22
  56. package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +347 -23
  57. package/sdk-core/crates/common/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +242 -43
  58. package/sdk-core/crates/common/protos/local/temporal/sdk/core/core_interface.proto +15 -0
  59. package/sdk-core/crates/common/protos/local/temporal/sdk/core/nexus/nexus.proto +9 -2
  60. package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +8 -0
  61. package/sdk-core/crates/common/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +22 -5
  62. package/sdk-core/crates/common/src/activity_definition.rs +20 -0
  63. package/sdk-core/crates/common/src/data_converters.rs +770 -0
  64. package/sdk-core/crates/common/src/envconfig.rs +5 -0
  65. package/sdk-core/crates/common/src/lib.rs +15 -211
  66. package/sdk-core/crates/common/src/payload_visitor.rs +648 -0
  67. package/sdk-core/crates/common/src/priority.rs +110 -0
  68. package/sdk-core/crates/common/src/protos/canned_histories.rs +19 -0
  69. package/sdk-core/crates/common/src/protos/history_builder.rs +45 -0
  70. package/sdk-core/crates/common/src/protos/history_info.rs +2 -0
  71. package/sdk-core/crates/common/src/protos/mod.rs +134 -27
  72. package/sdk-core/crates/common/src/protos/task_token.rs +3 -3
  73. package/sdk-core/crates/common/src/protos/utilities.rs +11 -0
  74. package/sdk-core/crates/{sdk-core → common}/src/telemetry/log_export.rs +11 -16
  75. package/sdk-core/crates/common/src/telemetry/metrics/core.rs +125 -0
  76. package/sdk-core/crates/common/src/telemetry/metrics.rs +272 -225
  77. package/sdk-core/crates/{sdk-core → common}/src/telemetry/otel.rs +8 -13
  78. package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_meter.rs +49 -50
  79. package/sdk-core/crates/{sdk-core → common}/src/telemetry/prometheus_server.rs +2 -3
  80. package/sdk-core/crates/common/src/telemetry.rs +278 -19
  81. package/sdk-core/crates/common/src/worker.rs +68 -636
  82. package/sdk-core/crates/common/src/workflow_definition.rs +60 -0
  83. package/sdk-core/crates/macros/Cargo.toml +5 -1
  84. package/sdk-core/crates/macros/src/activities_definitions.rs +585 -0
  85. package/sdk-core/crates/macros/src/fsm_impl.rs +507 -0
  86. package/sdk-core/crates/macros/src/lib.rs +138 -512
  87. package/sdk-core/crates/macros/src/macro_utils.rs +106 -0
  88. package/sdk-core/crates/macros/src/workflow_definitions.rs +1224 -0
  89. package/sdk-core/crates/sdk/Cargo.toml +19 -6
  90. package/sdk-core/crates/sdk/README.md +415 -0
  91. package/sdk-core/crates/sdk/src/activities.rs +417 -0
  92. package/sdk-core/crates/sdk/src/interceptors.rs +1 -1
  93. package/sdk-core/crates/sdk/src/lib.rs +759 -442
  94. package/sdk-core/crates/sdk/src/workflow_context/options.rs +64 -35
  95. package/sdk-core/crates/sdk/src/workflow_context.rs +1033 -289
  96. package/sdk-core/crates/sdk/src/workflow_future.rs +277 -213
  97. package/sdk-core/crates/sdk/src/workflows.rs +711 -0
  98. package/sdk-core/crates/sdk-core/Cargo.toml +59 -65
  99. package/sdk-core/crates/sdk-core/benches/workflow_replay_bench.rs +45 -54
  100. package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +1 -1
  101. package/sdk-core/crates/sdk-core/src/abstractions.rs +6 -10
  102. package/sdk-core/crates/sdk-core/src/core_tests/activity_tasks.rs +6 -5
  103. package/sdk-core/crates/sdk-core/src/core_tests/mod.rs +22 -21
  104. package/sdk-core/crates/sdk-core/src/core_tests/queries.rs +21 -25
  105. package/sdk-core/crates/sdk-core/src/core_tests/replay_flag.rs +7 -10
  106. package/sdk-core/crates/sdk-core/src/core_tests/updates.rs +14 -17
  107. package/sdk-core/crates/sdk-core/src/core_tests/workers.rs +647 -27
  108. package/sdk-core/crates/sdk-core/src/core_tests/workflow_tasks.rs +46 -41
  109. package/sdk-core/crates/sdk-core/src/ephemeral_server/mod.rs +13 -16
  110. package/sdk-core/crates/sdk-core/src/histfetch.rs +20 -10
  111. package/sdk-core/crates/sdk-core/src/lib.rs +60 -123
  112. package/sdk-core/crates/sdk-core/src/pollers/mod.rs +4 -9
  113. package/sdk-core/crates/sdk-core/src/pollers/poll_buffer.rs +411 -32
  114. package/sdk-core/crates/sdk-core/src/protosext/mod.rs +2 -2
  115. package/sdk-core/crates/sdk-core/src/replay/mod.rs +14 -5
  116. package/sdk-core/crates/sdk-core/src/telemetry/metrics.rs +183 -198
  117. package/sdk-core/crates/sdk-core/src/telemetry/mod.rs +3 -281
  118. package/sdk-core/crates/sdk-core/src/test_help/integ_helpers.rs +35 -16
  119. package/sdk-core/crates/sdk-core/src/test_help/unit_helpers.rs +3 -6
  120. package/sdk-core/crates/sdk-core/src/worker/activities/activity_heartbeat_manager.rs +1 -0
  121. package/sdk-core/crates/sdk-core/src/worker/activities/local_activities.rs +11 -14
  122. package/sdk-core/crates/sdk-core/src/worker/activities.rs +16 -19
  123. package/sdk-core/crates/sdk-core/src/worker/client/mocks.rs +11 -5
  124. package/sdk-core/crates/sdk-core/src/worker/client.rs +104 -86
  125. package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +10 -14
  126. package/sdk-core/crates/sdk-core/src/worker/mod.rs +1175 -241
  127. package/sdk-core/crates/sdk-core/src/worker/nexus.rs +150 -23
  128. package/sdk-core/crates/sdk-core/src/worker/slot_provider.rs +2 -2
  129. package/sdk-core/crates/sdk-core/src/worker/tuner/fixed_size.rs +2 -2
  130. package/sdk-core/crates/sdk-core/src/worker/tuner/resource_based.rs +25 -27
  131. package/sdk-core/crates/sdk-core/src/worker/tuner.rs +64 -44
  132. package/sdk-core/crates/sdk-core/src/worker/workflow/driven_workflow.rs +9 -3
  133. package/sdk-core/crates/sdk-core/src/worker/workflow/machines/patch_state_machine.rs +5 -8
  134. package/sdk-core/crates/sdk-core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +21 -22
  135. package/sdk-core/crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs +28 -4
  136. package/sdk-core/crates/sdk-core/src/worker/workflow/managed_run.rs +20 -41
  137. package/sdk-core/crates/sdk-core/src/worker/workflow/mod.rs +50 -9
  138. package/sdk-core/crates/sdk-core/src/worker/workflow/run_cache.rs +4 -7
  139. package/sdk-core/crates/sdk-core/src/worker/workflow/wft_extraction.rs +2 -4
  140. package/sdk-core/crates/sdk-core/src/worker/workflow/wft_poller.rs +8 -9
  141. package/sdk-core/crates/sdk-core/src/worker/workflow/workflow_stream.rs +1 -3
  142. package/sdk-core/crates/sdk-core/tests/activities_procmacro.rs +6 -0
  143. package/sdk-core/crates/sdk-core/tests/activities_trybuild/basic_pass.rs +54 -0
  144. package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.rs +18 -0
  145. package/sdk-core/crates/sdk-core/tests/activities_trybuild/invalid_self_type_fail.stderr +5 -0
  146. package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.rs +14 -0
  147. package/sdk-core/crates/sdk-core/tests/activities_trybuild/missing_context_fail.stderr +5 -0
  148. package/sdk-core/crates/sdk-core/tests/activities_trybuild/multi_arg_pass.rs +48 -0
  149. package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_input_pass.rs +14 -0
  150. package/sdk-core/crates/sdk-core/tests/activities_trybuild/no_return_type_pass.rs +19 -0
  151. package/sdk-core/crates/sdk-core/tests/cloud_tests.rs +14 -5
  152. package/sdk-core/crates/sdk-core/tests/common/activity_functions.rs +55 -0
  153. package/sdk-core/crates/sdk-core/tests/common/mod.rs +281 -236
  154. package/sdk-core/crates/sdk-core/tests/common/workflows.rs +41 -28
  155. package/sdk-core/crates/sdk-core/tests/global_metric_tests.rs +9 -14
  156. package/sdk-core/crates/sdk-core/tests/heavy_tests/fuzzy_workflow.rs +73 -66
  157. package/sdk-core/crates/sdk-core/tests/heavy_tests.rs +306 -268
  158. package/sdk-core/crates/sdk-core/tests/integ_tests/async_activity_client_tests.rs +230 -0
  159. package/sdk-core/crates/sdk-core/tests/integ_tests/client_tests.rs +94 -57
  160. package/sdk-core/crates/sdk-core/tests/integ_tests/data_converter_tests.rs +381 -0
  161. package/sdk-core/crates/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +37 -38
  162. package/sdk-core/crates/sdk-core/tests/integ_tests/heartbeat_tests.rs +49 -40
  163. package/sdk-core/crates/sdk-core/tests/integ_tests/metrics_tests.rs +447 -300
  164. package/sdk-core/crates/sdk-core/tests/integ_tests/pagination_tests.rs +50 -45
  165. package/sdk-core/crates/sdk-core/tests/integ_tests/polling_tests.rs +157 -157
  166. package/sdk-core/crates/sdk-core/tests/integ_tests/queries_tests.rs +103 -89
  167. package/sdk-core/crates/sdk-core/tests/integ_tests/update_tests.rs +609 -463
  168. package/sdk-core/crates/sdk-core/tests/integ_tests/visibility_tests.rs +80 -62
  169. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +389 -265
  170. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_tests.rs +250 -185
  171. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_versioning_tests.rs +52 -49
  172. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_client_tests.rs +180 -0
  173. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/activities.rs +437 -327
  174. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +82 -58
  175. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +56 -30
  176. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +364 -251
  177. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/client_interactions.rs +552 -0
  178. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +110 -46
  179. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +243 -149
  180. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/eager.rs +98 -32
  181. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +1475 -1040
  182. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +73 -43
  183. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +402 -245
  184. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/patches.rs +343 -207
  185. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/queries.rs +415 -0
  186. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/replay.rs +96 -36
  187. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/resets.rs +155 -140
  188. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/signals.rs +183 -113
  189. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +85 -44
  190. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/timers.rs +142 -48
  191. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +73 -56
  192. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests.rs +365 -242
  193. package/sdk-core/crates/sdk-core/tests/main.rs +22 -16
  194. package/sdk-core/crates/sdk-core/tests/manual_tests.rs +233 -187
  195. package/sdk-core/crates/sdk-core/tests/runner.rs +4 -6
  196. package/sdk-core/crates/sdk-core/tests/shared_tests/mod.rs +73 -27
  197. package/sdk-core/crates/sdk-core/tests/shared_tests/priority.rs +107 -84
  198. package/sdk-core/crates/sdk-core/tests/workflows_procmacro.rs +6 -0
  199. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.rs +26 -0
  200. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/async_query_fail.stderr +5 -0
  201. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/basic_pass.rs +49 -0
  202. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/minimal_pass.rs +21 -0
  203. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.rs +26 -0
  204. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/mut_query_fail.stderr +5 -0
  205. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.rs +21 -0
  206. package/sdk-core/crates/sdk-core/tests/workflows_trybuild/sync_run_fail.stderr +5 -0
  207. package/sdk-core/crates/sdk-core-c-bridge/Cargo.toml +8 -1
  208. package/sdk-core/crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h +37 -26
  209. package/sdk-core/crates/sdk-core-c-bridge/src/client.rs +180 -87
  210. package/sdk-core/crates/sdk-core-c-bridge/src/lib.rs +89 -5
  211. package/sdk-core/crates/sdk-core-c-bridge/src/metric.rs +10 -16
  212. package/sdk-core/crates/sdk-core-c-bridge/src/runtime.rs +59 -67
  213. package/sdk-core/crates/sdk-core-c-bridge/src/testing.rs +10 -10
  214. package/sdk-core/crates/sdk-core-c-bridge/src/tests/context.rs +57 -22
  215. package/sdk-core/crates/sdk-core-c-bridge/src/tests/mod.rs +108 -12
  216. package/sdk-core/crates/sdk-core-c-bridge/src/tests/utils.rs +9 -52
  217. package/sdk-core/crates/sdk-core-c-bridge/src/worker.rs +74 -91
  218. package/sdk-core/rustfmt.toml +2 -1
  219. package/src/client.rs +206 -289
  220. package/src/helpers/try_into_js.rs +88 -2
  221. package/src/metrics.rs +277 -35
  222. package/src/runtime.rs +94 -45
  223. package/src/testing.rs +9 -16
  224. package/src/worker.rs +86 -68
  225. package/ts/native.ts +39 -3
  226. package/sdk-core/crates/client/src/workflow_handle/mod.rs +0 -212
  227. package/sdk-core/crates/common/src/errors.rs +0 -85
  228. package/sdk-core/crates/common/tests/worker_task_types_test.rs +0 -129
  229. package/sdk-core/crates/macros/LICENSE.txt +0 -21
  230. package/sdk-core/crates/sdk/src/activity_context.rs +0 -238
  231. package/sdk-core/crates/sdk/src/app_data.rs +0 -37
  232. package/sdk-core/crates/sdk-core/tests/integ_tests/activity_functions.rs +0 -5
  233. package/sdk-core/crates/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +0 -61
@@ -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
@@ -205,16 +198,23 @@ service WorkflowService {
205
198
 
206
199
  // RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
207
200
  //
208
- // If worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
209
- // then it will be marked as timed out and an `ACTIVITY_TASK_TIMED_OUT` event will be written to
210
- // the workflow history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in
211
- // such situations, in that event, the SDK should request cancellation of the activity.
201
+ // If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
202
+ // then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or
203
+ // time out the activity.
204
+ //
205
+ // For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow
206
+ // history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,
207
+ // in that event, the SDK should request cancellation of the activity.
208
+ //
209
+ // The request may contain response `details` which will be persisted by the server and may be
210
+ // used by the activity to checkpoint progress. The `cancel_requested` field in the response
211
+ // indicates whether cancellation has been requested for the activity.
212
212
  rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) {
213
213
  option (google.api.http) = {
214
- post: "/namespaces/{namespace}/activities/heartbeat"
214
+ post: "/namespaces/{namespace}/activity-heartbeat"
215
215
  body: "*"
216
216
  additional_bindings {
217
- post: "/api/v1/namespaces/{namespace}/activities/heartbeat"
217
+ post: "/api/v1/namespaces/{namespace}/activity-heartbeat"
218
218
  body: "*"
219
219
  }
220
220
  };
@@ -227,10 +227,21 @@ service WorkflowService {
227
227
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
228
228
  rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) {
229
229
  option (google.api.http) = {
230
- post: "/namespaces/{namespace}/activities/heartbeat-by-id"
230
+ // Standalone
231
+ post: "/namespaces/{namespace}/activities/{activity_id}/heartbeat"
231
232
  body: "*"
232
233
  additional_bindings {
233
- 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"
234
245
  body: "*"
235
246
  }
236
247
  };
@@ -239,31 +250,42 @@ service WorkflowService {
239
250
  // RespondActivityTaskCompleted is called by workers when they successfully complete an activity
240
251
  // task.
241
252
  //
242
- // This results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
253
+ // For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
243
254
  // and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
244
255
  // no longer valid due to activity timeout, already being completed, or never having existed.
245
256
  rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) {
246
257
  option (google.api.http) = {
247
- post: "/namespaces/{namespace}/activities/complete"
258
+ post: "/namespaces/{namespace}/activity-complete"
248
259
  body: "*"
249
260
  additional_bindings {
250
- post: "/api/v1/namespaces/{namespace}/activities/complete"
261
+ post: "/api/v1/namespaces/{namespace}/activity-complete"
251
262
  body: "*"
252
263
  }
253
264
  };
254
265
  }
255
266
 
256
- // See `RecordActivityTaskCompleted`. This version allows clients to record completions by
267
+ // See `RespondActivityTaskCompleted`. This version allows clients to record completions by
257
268
  // namespace/workflow id/activity id instead of task token.
258
269
  //
259
270
  // (-- api-linter: core::0136::prepositions=disabled
260
271
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
261
272
  rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) {
262
273
  option (google.api.http) = {
263
- post: "/namespaces/{namespace}/activities/complete-by-id"
274
+ // Standalone
275
+ post: "/namespaces/{namespace}/activities/{activity_id}/complete"
264
276
  body: "*"
265
277
  additional_bindings {
266
- 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"
267
289
  body: "*"
268
290
  }
269
291
  };
@@ -276,10 +298,10 @@ service WorkflowService {
276
298
  // longer valid due to activity timeout, already being completed, or never having existed.
277
299
  rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) {
278
300
  option (google.api.http) = {
279
- post: "/namespaces/{namespace}/activities/fail"
301
+ post: "/namespaces/{namespace}/activity-fail"
280
302
  body: "*"
281
303
  additional_bindings {
282
- post: "/api/v1/namespaces/{namespace}/activities/fail"
304
+ post: "/api/v1/namespaces/{namespace}/activity-fail"
283
305
  body: "*"
284
306
  }
285
307
  };
@@ -292,10 +314,21 @@ service WorkflowService {
292
314
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
293
315
  rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) {
294
316
  option (google.api.http) = {
295
- post: "/namespaces/{namespace}/activities/fail-by-id"
317
+ // Standalone
318
+ post: "/namespaces/{namespace}/activities/{activity_id}/fail"
296
319
  body: "*"
297
320
  additional_bindings {
298
- 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"
299
332
  body: "*"
300
333
  }
301
334
  };
@@ -303,31 +336,42 @@ service WorkflowService {
303
336
 
304
337
  // RespondActivityTaskFailed is called by workers when processing an activity task fails.
305
338
  //
306
- // This results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
339
+ // For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
307
340
  // and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
308
341
  // no longer valid due to activity timeout, already being completed, or never having existed.
309
342
  rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) {
310
343
  option (google.api.http) = {
311
- post: "/namespaces/{namespace}/activities/cancel"
344
+ post: "/namespaces/{namespace}/activity-resolve-as-canceled"
312
345
  body: "*"
313
346
  additional_bindings {
314
- post: "/api/v1/namespaces/{namespace}/activities/cancel"
347
+ post: "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled"
315
348
  body: "*"
316
349
  }
317
350
  };
318
351
  }
319
352
 
320
- // See `RecordActivityTaskCanceled`. This version allows clients to record failures by
353
+ // See `RespondActivityTaskCanceled`. This version allows clients to record failures by
321
354
  // namespace/workflow id/activity id instead of task token.
322
355
  //
323
356
  // (-- api-linter: core::0136::prepositions=disabled
324
357
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
325
358
  rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) {
326
359
  option (google.api.http) = {
327
- post: "/namespaces/{namespace}/activities/cancel-by-id"
360
+ // Standalone
361
+ post: "/namespaces/{namespace}/activities/{activity_id}/resolve-as-canceled"
328
362
  body: "*"
329
363
  additional_bindings {
330
- 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"
331
375
  body: "*"
332
376
  }
333
377
  };
@@ -390,8 +434,9 @@ service WorkflowService {
390
434
 
391
435
  // ResetWorkflowExecution will reset an existing workflow execution to a specified
392
436
  // `WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current
393
- // execution instance.
394
- // TODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?
437
+ // execution instance. "Exclusive" means the identified completed event itself is not replayed
438
+ // in the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed
439
+ // immediately, and a new workflow task will be scheduled to retry it.
395
440
  rpc ResetWorkflowExecution (ResetWorkflowExecutionRequest) returns (ResetWorkflowExecutionResponse) {
396
441
  option (google.api.http) = {
397
442
  post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/reset"
@@ -662,6 +707,16 @@ service WorkflowService {
662
707
  };
663
708
  }
664
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
+
665
720
  // Deprecated. Use `UpdateWorkerVersioningRules`.
666
721
  //
667
722
  // Allows users to specify sets of worker build id versions on a per task queue basis. Versions
@@ -1023,12 +1078,14 @@ service WorkflowService {
1023
1078
 
1024
1079
  // UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.
1025
1080
  // If there are multiple pending activities of the provided type - all of them will be updated.
1081
+ // This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and
1082
+ // structured to work well for standalone activities.
1026
1083
  rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) {
1027
1084
  option (google.api.http) = {
1028
- post: "/namespaces/{namespace}/activities/update-options"
1085
+ post: "/namespaces/{namespace}/activities-deprecated/update-options"
1029
1086
  body: "*"
1030
1087
  additional_bindings {
1031
- post: "/api/v1/namespaces/{namespace}/activities/update-options"
1088
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/update-options"
1032
1089
  body: "*"
1033
1090
  }
1034
1091
  };
@@ -1062,12 +1119,14 @@ service WorkflowService {
1062
1119
  // - The activity should respond to the cancellation accordingly.
1063
1120
  //
1064
1121
  // Returns a `NotFound` error if there is no pending activity with the provided ID or type
1122
+ // This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and
1123
+ // structured to work well for standalone activities.
1065
1124
  rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) {
1066
1125
  option (google.api.http) = {
1067
- post: "/namespaces/{namespace}/activities/pause"
1126
+ post: "/namespaces/{namespace}/activities-deprecated/pause"
1068
1127
  body: "*"
1069
1128
  additional_bindings {
1070
- post: "/api/v1/namespaces/{namespace}/activities/pause"
1129
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/pause"
1071
1130
  body: "*"
1072
1131
  }
1073
1132
  };
@@ -1086,12 +1145,14 @@ service WorkflowService {
1086
1145
  // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.
1087
1146
  //
1088
1147
  // Returns a `NotFound` error if there is no pending activity with the provided ID or type
1148
+ // This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and
1149
+ // structured to work well for standalone activities.
1089
1150
  rpc UnpauseActivity (UnpauseActivityRequest) returns (UnpauseActivityResponse) {
1090
1151
  option (google.api.http) = {
1091
- post: "/namespaces/{namespace}/activities/unpause"
1152
+ post: "/namespaces/{namespace}/activities-deprecated/unpause"
1092
1153
  body: "*"
1093
1154
  additional_bindings {
1094
- post: "/api/v1/namespaces/{namespace}/activities/unpause"
1155
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/unpause"
1095
1156
  body: "*"
1096
1157
  }
1097
1158
  };
@@ -1114,12 +1175,14 @@ service WorkflowService {
1114
1175
  // 'keep_paused': if the activity is paused, it will remain paused.
1115
1176
  //
1116
1177
  // Returns a `NotFound` error if there is no pending activity with the provided ID or type.
1178
+ // This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and
1179
+ // structured to work well for standalone activities.
1117
1180
  rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) {
1118
1181
  option (google.api.http) = {
1119
- post: "/namespaces/{namespace}/activities/reset"
1182
+ post: "/namespaces/{namespace}/activities-deprecated/reset"
1120
1183
  body: "*"
1121
1184
  additional_bindings {
1122
- post: "/api/v1/namespaces/{namespace}/activities/reset"
1185
+ post: "/api/v1/namespaces/{namespace}/activities-deprecated/reset"
1123
1186
  body: "*"
1124
1187
  }
1125
1188
  };
@@ -1259,4 +1322,140 @@ service WorkflowService {
1259
1322
  }
1260
1323
  };
1261
1324
  }
1325
+
1326
+ // Note: This is an experimental API and the behavior may change in a future release.
1327
+ // PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in
1328
+ // - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history
1329
+ // - No new workflow tasks or activity tasks are dispatched.
1330
+ // - Any workflow task currently executing on the worker will be allowed to complete.
1331
+ // - Any activity task currently executing will be paused.
1332
+ // - All server-side events will continue to be processed by the server.
1333
+ // - Queries & Updates on a paused workflow will be rejected.
1334
+ rpc PauseWorkflowExecution (PauseWorkflowExecutionRequest) returns (PauseWorkflowExecutionResponse) {
1335
+ option (google.api.http) = {
1336
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/pause"
1337
+ body: "*"
1338
+ additional_bindings {
1339
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/pause"
1340
+ body: "*"
1341
+ }
1342
+ };
1343
+ }
1344
+
1345
+ // Note: This is an experimental API and the behavior may change in a future release.
1346
+ // UnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.
1347
+ // Unpausing a workflow execution results in
1348
+ // - The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history
1349
+ // - Workflow tasks and activity tasks are resumed.
1350
+ rpc UnpauseWorkflowExecution (UnpauseWorkflowExecutionRequest) returns (UnpauseWorkflowExecutionResponse) {
1351
+ option (google.api.http) = {
1352
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/unpause"
1353
+ body: "*"
1354
+ additional_bindings {
1355
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/unpause"
1356
+ body: "*"
1357
+ }
1358
+ };
1359
+ }
1360
+
1361
+ // StartActivityExecution starts a new activity execution.
1362
+ //
1363
+ // Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace
1364
+ // unless permitted by the specified ID conflict policy.
1365
+ rpc StartActivityExecution (StartActivityExecutionRequest) returns (StartActivityExecutionResponse) {
1366
+ option (google.api.http) = {
1367
+ post: "/namespaces/{namespace}/activities/{activity_id}"
1368
+ body: "*"
1369
+ additional_bindings {
1370
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}"
1371
+ body: "*"
1372
+ }
1373
+ };
1374
+ }
1375
+
1376
+ // DescribeActivityExecution returns information about an activity execution.
1377
+ // It can be used to:
1378
+ // - Get current activity info without waiting
1379
+ // - Long-poll for next state change and return new activity info
1380
+ // Response can optionally include activity input or outcome (if the activity has completed).
1381
+ rpc DescribeActivityExecution (DescribeActivityExecutionRequest) returns (DescribeActivityExecutionResponse) {
1382
+ option (google.api.http) = {
1383
+ get: "/namespaces/{namespace}/activities/{activity_id}"
1384
+ additional_bindings {
1385
+ get: "/api/v1/namespaces/{namespace}/activities/{activity_id}"
1386
+ }
1387
+ };
1388
+ }
1389
+
1390
+ // PollActivityExecution long-polls for an activity execution to complete and returns the
1391
+ // outcome (result or failure).
1392
+ rpc PollActivityExecution (PollActivityExecutionRequest) returns (PollActivityExecutionResponse) {
1393
+ option (google.api.http) = {
1394
+ get: "/namespaces/{namespace}/activities/{activity_id}/outcome"
1395
+ additional_bindings {
1396
+ get: "/api/v1/namespaces/{namespace}/activities/{activity_id}/outcome"
1397
+ }
1398
+ };
1399
+ }
1400
+
1401
+ // ListActivityExecutions is a visibility API to list activity executions in a specific namespace.
1402
+ rpc ListActivityExecutions (ListActivityExecutionsRequest) returns (ListActivityExecutionsResponse) {
1403
+ option (google.api.http) = {
1404
+ get: "/namespaces/{namespace}/activities"
1405
+ additional_bindings {
1406
+ get: "/api/v1/namespaces/{namespace}/activities"
1407
+ }
1408
+ };
1409
+ }
1410
+
1411
+ // CountActivityExecutions is a visibility API to count activity executions in a specific namespace.
1412
+ rpc CountActivityExecutions (CountActivityExecutionsRequest) returns (CountActivityExecutionsResponse) {
1413
+ option (google.api.http) = {
1414
+ get: "/namespaces/{namespace}/activity-count"
1415
+ additional_bindings {
1416
+ get: "/api/v1/namespaces/{namespace}/activity-count"
1417
+ }
1418
+ };
1419
+ }
1420
+
1421
+ // RequestCancelActivityExecution requests cancellation of an activity execution.
1422
+ //
1423
+ // Cancellation is cooperative: this call records the request, but the activity must detect and
1424
+ // acknowledge it for the activity to reach CANCELED status. The cancellation signal is
1425
+ // delivered via `cancel_requested` in the heartbeat response; SDKs surface this via
1426
+ // language-idiomatic mechanisms (context cancellation, exceptions, abort signals).
1427
+ rpc RequestCancelActivityExecution (RequestCancelActivityExecutionRequest) returns (RequestCancelActivityExecutionResponse) {
1428
+ option (google.api.http) = {
1429
+ post: "/namespaces/{namespace}/activities/{activity_id}/cancel"
1430
+ body: "*"
1431
+ additional_bindings {
1432
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/cancel"
1433
+ body: "*"
1434
+ }
1435
+ };
1436
+ }
1437
+
1438
+ // TerminateActivityExecution terminates an existing activity execution immediately.
1439
+ //
1440
+ // Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a
1441
+ // running attempt.
1442
+ rpc TerminateActivityExecution (TerminateActivityExecutionRequest) returns (TerminateActivityExecutionResponse) {
1443
+ option (google.api.http) = {
1444
+ post: "/namespaces/{namespace}/activities/{activity_id}/terminate"
1445
+ body: "*"
1446
+ additional_bindings {
1447
+ post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/terminate"
1448
+ body: "*"
1449
+ }
1450
+ };
1451
+ }
1452
+
1453
+ // DeleteActivityExecution asynchronously deletes a specific activity execution (when
1454
+ // ActivityExecution.run_id is provided) or the latest activity execution (when
1455
+ // ActivityExecution.run_id is not provided). If the activity Execution is running, it will be
1456
+ // terminated before deletion.
1457
+ //
1458
+ // (-- api-linter: core::0127::http-annotation=disabled
1459
+ // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --)
1460
+ rpc DeleteActivityExecution (DeleteActivityExecutionRequest) returns (DeleteActivityExecutionResponse) {}
1262
1461
  }
@@ -51,3 +51,18 @@ message NexusSlotInfo {
51
51
  string service = 1;
52
52
  string operation = 2;
53
53
  }
54
+
55
+ // Info about a namespace
56
+ message NamespaceInfo {
57
+ // Namespace configured limits
58
+ Limits limits = 1;
59
+
60
+ message Limits {
61
+ // Maximum size in bytes for payload fields in workflow history events
62
+ // (e.g., workflow/activity inputs and results, failure details, signal payloads).
63
+ // When exceeded, the server will reject the operation with an error.
64
+ int64 blob_size_limit_error = 1;
65
+ // Maximum total memo size in bytes per workflow execution.
66
+ int64 memo_size_limit_error = 2;
67
+ }
68
+ }
@@ -3,6 +3,7 @@ syntax = "proto3";
3
3
  package coresdk.nexus;
4
4
  option ruby_package = "Temporalio::Internal::Bridge::Api::Nexus";
5
5
 
6
+ import "google/protobuf/timestamp.proto";
6
7
  import "temporal/api/common/v1/message.proto";
7
8
  import "temporal/api/failure/v1/message.proto";
8
9
  import "temporal/api/nexus/v1/message.proto";
@@ -27,13 +28,15 @@ message NexusTaskCompletion {
27
28
  // The handler completed (successfully or not). Note that the response kind must match the
28
29
  // request kind (start or cancel).
29
30
  temporal.api.nexus.v1.Response completed = 2;
30
- // The handler could not complete the request for some reason.
31
- 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];
32
33
  // The lang SDK acknowledges that it is responding to a `CancelNexusTask` and thus the
33
34
  // response is irrelevant. This is not the only way to respond to a cancel, the other
34
35
  // variants can still be used, but this variant should be used when the handler was aborted
35
36
  // by cancellation.
36
37
  bool ack_cancel = 4;
38
+ // The handler could not complete the request for some reason.
39
+ temporal.api.failure.v1.Failure failure = 5;
37
40
  }
38
41
  }
39
42
 
@@ -54,6 +57,10 @@ message NexusTask {
54
57
  // user's operation handler to continue doing work.
55
58
  CancelNexusTask cancel_task = 2;
56
59
  }
60
+ // The deadline for this request, parsed from the "Request-Timeout" header.
61
+ // Only set when variant is `task` and the header was present with a valid value.
62
+ // Represented as an absolute timestamp.
63
+ google.protobuf.Timestamp request_deadline = 3;
57
64
  }
58
65
 
59
66
  message CancelNexusTask {
@@ -94,6 +94,14 @@ message WorkflowActivation {
94
94
  common.WorkerDeploymentVersion deployment_version_for_current_task = 9;
95
95
  // The last seen SDK version from the most recent WFT completed event
96
96
  string last_sdk_version = 10;
97
+ // Experimental. Optionally decide the versioning behavior that the first task of the new run should use.
98
+ // For example, choose to AutoUpgrade on continue-as-new instead of inheriting the pinned version
99
+ // of the previous run.
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;
97
105
  }
98
106
 
99
107
  message WorkflowActivationJob {
@@ -209,12 +209,16 @@ 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;
216
216
  // Whether the continued workflow should run on a worker with a compatible build id or not.
217
217
  coresdk.common.VersioningIntent versioning_intent = 10;
218
+ // Experimental. Optionally decide the versioning behavior that the first task of the new run should use.
219
+ // For example, choose to AutoUpgrade on continue-as-new instead of inheriting the pinned version
220
+ // of the previous run.
221
+ temporal.api.enums.v1.ContinueAsNewVersioningBehavior initial_versioning_behavior = 11;
218
222
  }
219
223
 
220
224
  // Indicate a workflow has completed as cancelled. Generally sent as a response to an activation
@@ -259,7 +263,7 @@ message StartChildWorkflowExecution {
259
263
  // Memo fields
260
264
  map<string, temporal.api.common.v1.Payload> memo = 16;
261
265
  // Search attributes
262
- map<string, temporal.api.common.v1.Payload> search_attributes = 17;
266
+ temporal.api.common.v1.SearchAttributes search_attributes = 17;
263
267
  // Defines behaviour of the underlying workflow when child workflow cancellation has been requested.
264
268
  child_workflow.ChildWorkflowCancellationType cancellation_type = 18;
265
269
  // Whether this child should run on a worker with a compatible build id or not.
@@ -313,9 +317,9 @@ message CancelSignalWorkflow {
313
317
  }
314
318
 
315
319
  message UpsertWorkflowSearchAttributes {
316
- // SearchAttributes fields - equivalent to indexed_fields on api. Key = search index, Value =
317
- // value?
318
- 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;
319
323
  }
320
324
 
321
325
  message ModifyWorkflowProperties {
@@ -378,6 +382,19 @@ message ScheduleNexusOperation {
378
382
  map<string, string> nexus_header = 7;
379
383
  // Defines behaviour of the underlying nexus operation when operation cancellation has been requested.
380
384
  nexus.NexusOperationCancellationType cancellation_type = 8;
385
+ // Schedule-to-start timeout for this operation.
386
+ // Indicates how long the caller is willing to wait for the operation to be started (or completed if synchronous)
387
+ // by the handler. If the operation is not started within this timeout, it will fail with
388
+ // TIMEOUT_TYPE_SCHEDULE_TO_START.
389
+ // If not set or zero, no schedule-to-start timeout is enforced.
390
+ google.protobuf.Duration schedule_to_start_timeout = 9;
391
+ // Start-to-close timeout for this operation.
392
+ // Indicates how long the caller is willing to wait for an asynchronous operation to complete after it has been
393
+ // started. If the operation does not complete within this timeout after starting, it will fail with
394
+ // TIMEOUT_TYPE_START_TO_CLOSE.
395
+ // Only applies to asynchronous operations. Synchronous operations ignore this timeout.
396
+ // If not set or zero, no start-to-close timeout is enforced.
397
+ google.protobuf.Duration start_to_close_timeout = 10;
381
398
  }
382
399
 
383
400
  // Request cancellation of a nexus operation started via `ScheduleNexusOperation`
@@ -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
+ }