@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
@@ -164,20 +164,34 @@ paths:
164
164
  application/json:
165
165
  schema:
166
166
  $ref: '#/components/schemas/Status'
167
- /api/v1/namespaces/{namespace}/activities/cancel:
167
+ /api/v1/namespaces/{namespace}/activities-deprecated/pause:
168
168
  post:
169
169
  tags:
170
170
  - WorkflowService
171
171
  description: |-
172
- RespondActivityTaskFailed is called by workers when processing an activity task fails.
172
+ PauseActivity pauses the execution of an activity specified by its ID or type.
173
+ If there are multiple pending activities of the provided type - all of them will be paused
173
174
 
174
- For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
175
- and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
176
- no longer valid due to activity timeout, already being completed, or never having existed.
177
- operationId: RespondActivityTaskCanceled
175
+ Pausing an activity means:
176
+ - If the activity is currently waiting for a retry or is running and subsequently fails,
177
+ it will not be rescheduled until it is unpaused.
178
+ - If the activity is already paused, calling this method will have no effect.
179
+ - If the activity is running and finishes successfully, the activity will be completed.
180
+ - If the activity is running and finishes with failure:
181
+ * if there is no retry left - the activity will be completed.
182
+ * if there are more retries left - the activity will be paused.
183
+ For long-running activities:
184
+ - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'.
185
+ - The activity should respond to the cancellation accordingly.
186
+
187
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type
188
+ This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and
189
+ structured to work well for standalone activities.
190
+ operationId: PauseActivity
178
191
  parameters:
179
192
  - name: namespace
180
193
  in: path
194
+ description: Namespace of the workflow which scheduled this activity.
181
195
  required: true
182
196
  schema:
183
197
  type: string
@@ -185,7 +199,7 @@ paths:
185
199
  content:
186
200
  application/json:
187
201
  schema:
188
- $ref: '#/components/schemas/RespondActivityTaskCanceledRequest'
202
+ $ref: '#/components/schemas/PauseActivityRequest'
189
203
  required: true
190
204
  responses:
191
205
  "200":
@@ -193,28 +207,42 @@ paths:
193
207
  content:
194
208
  application/json:
195
209
  schema:
196
- $ref: '#/components/schemas/RespondActivityTaskCanceledResponse'
210
+ $ref: '#/components/schemas/PauseActivityResponse'
197
211
  default:
198
212
  description: Default error response
199
213
  content:
200
214
  application/json:
201
215
  schema:
202
216
  $ref: '#/components/schemas/Status'
203
- /api/v1/namespaces/{namespace}/activities/cancel-by-id:
217
+ /api/v1/namespaces/{namespace}/activities-deprecated/reset:
204
218
  post:
205
219
  tags:
206
220
  - WorkflowService
207
221
  description: |-
208
- See `RespondActivityTaskCanceled`. This version allows clients to record failures by
209
- namespace/workflow id/activity id instead of task token.
222
+ ResetActivity resets the execution of an activity specified by its ID or type.
223
+ If there are multiple pending activities of the provided type - all of them will be reset.
210
224
 
211
- (-- api-linter: core::0136::prepositions=disabled
212
- aip.dev/not-precedent: "By" is used to indicate request type. --)
213
- operationId: RespondActivityTaskCanceledById
225
+ Resetting an activity means:
226
+ * number of attempts will be reset to 0.
227
+ * activity timeouts will be reset.
228
+ * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:
229
+ it will be scheduled immediately (* see 'jitter' flag),
230
+
231
+ Flags:
232
+
233
+ 'jitter': the activity will be scheduled at a random time within the jitter duration.
234
+ If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.
235
+ 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.
236
+ 'keep_paused': if the activity is paused, it will remain paused.
237
+
238
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type.
239
+ This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and
240
+ structured to work well for standalone activities.
241
+ operationId: ResetActivity
214
242
  parameters:
215
243
  - name: namespace
216
244
  in: path
217
- description: Namespace of the workflow which scheduled this activity
245
+ description: Namespace of the workflow which scheduled this activity.
218
246
  required: true
219
247
  schema:
220
248
  type: string
@@ -222,7 +250,7 @@ paths:
222
250
  content:
223
251
  application/json:
224
252
  schema:
225
- $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
253
+ $ref: '#/components/schemas/ResetActivityRequest'
226
254
  required: true
227
255
  responses:
228
256
  "200":
@@ -230,28 +258,38 @@ paths:
230
258
  content:
231
259
  application/json:
232
260
  schema:
233
- $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
261
+ $ref: '#/components/schemas/ResetActivityResponse'
234
262
  default:
235
263
  description: Default error response
236
264
  content:
237
265
  application/json:
238
266
  schema:
239
267
  $ref: '#/components/schemas/Status'
240
- /api/v1/namespaces/{namespace}/activities/complete:
268
+ /api/v1/namespaces/{namespace}/activities-deprecated/unpause:
241
269
  post:
242
270
  tags:
243
271
  - WorkflowService
244
272
  description: |-
245
- RespondActivityTaskCompleted is called by workers when they successfully complete an activity
246
- task.
273
+ UnpauseActivity unpauses the execution of an activity specified by its ID or type.
274
+ If there are multiple pending activities of the provided type - all of them will be unpaused.
247
275
 
248
- For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
249
- and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
250
- no longer valid due to activity timeout, already being completed, or never having existed.
251
- operationId: RespondActivityTaskCompleted
276
+ If activity is not paused, this call will have no effect.
277
+ If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).
278
+ Once the activity is unpaused, all timeout timers will be regenerated.
279
+
280
+ Flags:
281
+ 'jitter': the activity will be scheduled at a random time within the jitter duration.
282
+ 'reset_attempts': the number of attempts will be reset.
283
+ 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.
284
+
285
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type
286
+ This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and
287
+ structured to work well for standalone activities.
288
+ operationId: UnpauseActivity
252
289
  parameters:
253
290
  - name: namespace
254
291
  in: path
292
+ description: Namespace of the workflow which scheduled this activity.
255
293
  required: true
256
294
  schema:
257
295
  type: string
@@ -259,7 +297,7 @@ paths:
259
297
  content:
260
298
  application/json:
261
299
  schema:
262
- $ref: '#/components/schemas/RespondActivityTaskCompletedRequest'
300
+ $ref: '#/components/schemas/UnpauseActivityRequest'
263
301
  required: true
264
302
  responses:
265
303
  "200":
@@ -267,24 +305,23 @@ paths:
267
305
  content:
268
306
  application/json:
269
307
  schema:
270
- $ref: '#/components/schemas/RespondActivityTaskCompletedResponse'
308
+ $ref: '#/components/schemas/UnpauseActivityResponse'
271
309
  default:
272
310
  description: Default error response
273
311
  content:
274
312
  application/json:
275
313
  schema:
276
314
  $ref: '#/components/schemas/Status'
277
- /api/v1/namespaces/{namespace}/activities/complete-by-id:
315
+ /api/v1/namespaces/{namespace}/activities-deprecated/update-options:
278
316
  post:
279
317
  tags:
280
318
  - WorkflowService
281
319
  description: |-
282
- See `RespondActivityTaskCompleted`. This version allows clients to record completions by
283
- namespace/workflow id/activity id instead of task token.
284
-
285
- (-- api-linter: core::0136::prepositions=disabled
286
- aip.dev/not-precedent: "By" is used to indicate request type. --)
287
- operationId: RespondActivityTaskCompletedById
320
+ UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.
321
+ If there are multiple pending activities of the provided type - all of them will be updated.
322
+ This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and
323
+ structured to work well for standalone activities.
324
+ operationId: UpdateActivityOptions
288
325
  parameters:
289
326
  - name: namespace
290
327
  in: path
@@ -296,7 +333,7 @@ paths:
296
333
  content:
297
334
  application/json:
298
335
  schema:
299
- $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
336
+ $ref: '#/components/schemas/UpdateActivityOptionsRequest'
300
337
  required: true
301
338
  responses:
302
339
  "200":
@@ -304,64 +341,96 @@ paths:
304
341
  content:
305
342
  application/json:
306
343
  schema:
307
- $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
344
+ $ref: '#/components/schemas/UpdateActivityOptionsResponse'
308
345
  default:
309
346
  description: Default error response
310
347
  content:
311
348
  application/json:
312
349
  schema:
313
350
  $ref: '#/components/schemas/Status'
314
- /api/v1/namespaces/{namespace}/activities/fail:
315
- post:
351
+ /api/v1/namespaces/{namespace}/activities/{activityId}:
352
+ get:
316
353
  tags:
317
354
  - WorkflowService
318
355
  description: |-
319
- RespondActivityTaskFailed is called by workers when processing an activity task fails.
320
-
321
- This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and
322
- a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
323
- longer valid due to activity timeout, already being completed, or never having existed.
324
- operationId: RespondActivityTaskFailed
356
+ DescribeActivityExecution returns information about an activity execution.
357
+ It can be used to:
358
+ - Get current activity info without waiting
359
+ - Long-poll for next state change and return new activity info
360
+ Response can optionally include activity input or outcome (if the activity has completed).
361
+ operationId: DescribeActivityExecution
325
362
  parameters:
326
363
  - name: namespace
327
364
  in: path
328
365
  required: true
329
366
  schema:
330
367
  type: string
331
- requestBody:
332
- content:
333
- application/json:
334
- schema:
335
- $ref: '#/components/schemas/RespondActivityTaskFailedRequest'
336
- required: true
368
+ - name: activityId
369
+ in: path
370
+ required: true
371
+ schema:
372
+ type: string
373
+ - name: runId
374
+ in: query
375
+ description: Activity run ID. If empty the request targets the latest run.
376
+ schema:
377
+ type: string
378
+ - name: includeInput
379
+ in: query
380
+ description: Include the input field in the response.
381
+ schema:
382
+ type: boolean
383
+ - name: includeOutcome
384
+ in: query
385
+ description: Include the outcome (result/failure) in the response if the activity has completed.
386
+ schema:
387
+ type: boolean
388
+ - name: longPollToken
389
+ in: query
390
+ description: |-
391
+ Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity
392
+ state changes from the state encoded in this token. If absent, return current state immediately.
393
+ If present, run_id must also be present.
394
+ Note that activity state may change multiple times between requests, therefore it is not
395
+ guaranteed that a client making a sequence of long-poll requests will see a complete
396
+ sequence of state changes.
397
+ schema:
398
+ type: string
399
+ format: bytes
337
400
  responses:
338
401
  "200":
339
402
  description: OK
340
403
  content:
341
404
  application/json:
342
405
  schema:
343
- $ref: '#/components/schemas/RespondActivityTaskFailedResponse'
406
+ $ref: '#/components/schemas/DescribeActivityExecutionResponse'
344
407
  default:
345
408
  description: Default error response
346
409
  content:
347
410
  application/json:
348
411
  schema:
349
412
  $ref: '#/components/schemas/Status'
350
- /api/v1/namespaces/{namespace}/activities/fail-by-id:
351
413
  post:
352
414
  tags:
353
415
  - WorkflowService
354
416
  description: |-
355
- See `RecordActivityTaskFailed`. This version allows clients to record failures by
356
- namespace/workflow id/activity id instead of task token.
417
+ StartActivityExecution starts a new activity execution.
357
418
 
358
- (-- api-linter: core::0136::prepositions=disabled
359
- aip.dev/not-precedent: "By" is used to indicate request type. --)
360
- operationId: RespondActivityTaskFailedById
419
+ Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace
420
+ unless permitted by the specified ID conflict policy.
421
+ operationId: StartActivityExecution
361
422
  parameters:
362
423
  - name: namespace
363
424
  in: path
364
- description: Namespace of the workflow which scheduled this activity
425
+ required: true
426
+ schema:
427
+ type: string
428
+ - name: activityId
429
+ in: path
430
+ description: |-
431
+ Identifier for this activity. Required. This identifier should be meaningful in the user's
432
+ own system. It must be unique among activities in the same namespace, subject to the rules
433
+ imposed by id_reuse_policy and id_conflict_policy.
365
434
  required: true
366
435
  schema:
367
436
  type: string
@@ -369,7 +438,7 @@ paths:
369
438
  content:
370
439
  application/json:
371
440
  schema:
372
- $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
441
+ $ref: '#/components/schemas/StartActivityExecutionRequest'
373
442
  required: true
374
443
  responses:
375
444
  "200":
@@ -377,43 +446,41 @@ paths:
377
446
  content:
378
447
  application/json:
379
448
  schema:
380
- $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
449
+ $ref: '#/components/schemas/StartActivityExecutionResponse'
381
450
  default:
382
451
  description: Default error response
383
452
  content:
384
453
  application/json:
385
454
  schema:
386
455
  $ref: '#/components/schemas/Status'
387
- /api/v1/namespaces/{namespace}/activities/heartbeat:
456
+ /api/v1/namespaces/{namespace}/activities/{activityId}/cancel:
388
457
  post:
389
458
  tags:
390
459
  - WorkflowService
391
460
  description: |-
392
- RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
393
-
394
- If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
395
- then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or
396
- time out the activity.
397
-
398
- For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow
399
- history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,
400
- in that event, the SDK should request cancellation of the activity.
461
+ RequestCancelActivityExecution requests cancellation of an activity execution.
401
462
 
402
- The request may contain response `details` which will be persisted by the server and may be
403
- used by the activity to checkpoint progress. The `cancel_requested` field in the response
404
- indicates whether cancellation has been requested for the activity.
405
- operationId: RecordActivityTaskHeartbeat
463
+ Cancellation is cooperative: this call records the request, but the activity must detect and
464
+ acknowledge it for the activity to reach CANCELED status. The cancellation signal is
465
+ delivered via `cancel_requested` in the heartbeat response; SDKs surface this via
466
+ language-idiomatic mechanisms (context cancellation, exceptions, abort signals).
467
+ operationId: RequestCancelActivityExecution
406
468
  parameters:
407
469
  - name: namespace
408
470
  in: path
409
471
  required: true
410
472
  schema:
411
473
  type: string
474
+ - name: activityId
475
+ in: path
476
+ required: true
477
+ schema:
478
+ type: string
412
479
  requestBody:
413
480
  content:
414
481
  application/json:
415
482
  schema:
416
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest'
483
+ $ref: '#/components/schemas/RequestCancelActivityExecutionRequest'
417
484
  required: true
418
485
  responses:
419
486
  "200":
@@ -421,24 +488,24 @@ paths:
421
488
  content:
422
489
  application/json:
423
490
  schema:
424
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse'
491
+ $ref: '#/components/schemas/RequestCancelActivityExecutionResponse'
425
492
  default:
426
493
  description: Default error response
427
494
  content:
428
495
  application/json:
429
496
  schema:
430
497
  $ref: '#/components/schemas/Status'
431
- /api/v1/namespaces/{namespace}/activities/heartbeat-by-id:
498
+ /api/v1/namespaces/{namespace}/activities/{activityId}/complete:
432
499
  post:
433
500
  tags:
434
501
  - WorkflowService
435
502
  description: |-
436
- See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
503
+ See `RespondActivityTaskCompleted`. This version allows clients to record completions by
437
504
  namespace/workflow id/activity id instead of task token.
438
505
 
439
506
  (-- api-linter: core::0136::prepositions=disabled
440
507
  aip.dev/not-precedent: "By" is used to indicate request type. --)
441
- operationId: RecordActivityTaskHeartbeatById
508
+ operationId: RespondActivityTaskCompletedById
442
509
  parameters:
443
510
  - name: namespace
444
511
  in: path
@@ -446,11 +513,17 @@ paths:
446
513
  required: true
447
514
  schema:
448
515
  type: string
516
+ - name: activityId
517
+ in: path
518
+ description: Id of the activity to complete
519
+ required: true
520
+ schema:
521
+ type: string
449
522
  requestBody:
450
523
  content:
451
524
  application/json:
452
525
  schema:
453
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
526
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
454
527
  required: true
455
528
  responses:
456
529
  "200":
@@ -458,41 +531,34 @@ paths:
458
531
  content:
459
532
  application/json:
460
533
  schema:
461
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
534
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
462
535
  default:
463
536
  description: Default error response
464
537
  content:
465
538
  application/json:
466
539
  schema:
467
540
  $ref: '#/components/schemas/Status'
468
- /api/v1/namespaces/{namespace}/activities/pause:
541
+ /api/v1/namespaces/{namespace}/activities/{activityId}/fail:
469
542
  post:
470
543
  tags:
471
544
  - WorkflowService
472
545
  description: |-
473
- PauseActivity pauses the execution of an activity specified by its ID or type.
474
- If there are multiple pending activities of the provided type - all of them will be paused
475
-
476
- Pausing an activity means:
477
- - If the activity is currently waiting for a retry or is running and subsequently fails,
478
- it will not be rescheduled until it is unpaused.
479
- - If the activity is already paused, calling this method will have no effect.
480
- - If the activity is running and finishes successfully, the activity will be completed.
481
- - If the activity is running and finishes with failure:
482
- * if there is no retry left - the activity will be completed.
483
- * if there are more retries left - the activity will be paused.
484
- For long-running activities:
485
- - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'.
486
- - The activity should respond to the cancellation accordingly.
546
+ See `RecordActivityTaskFailed`. This version allows clients to record failures by
547
+ namespace/workflow id/activity id instead of task token.
487
548
 
488
- Returns a `NotFound` error if there is no pending activity with the provided ID or type
489
- This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and
490
- structured to work well for standalone activities.
491
- operationId: PauseActivity
549
+ (-- api-linter: core::0136::prepositions=disabled
550
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
551
+ operationId: RespondActivityTaskFailedById
492
552
  parameters:
493
553
  - name: namespace
494
554
  in: path
495
- description: Namespace of the workflow which scheduled this activity.
555
+ description: Namespace of the workflow which scheduled this activity
556
+ required: true
557
+ schema:
558
+ type: string
559
+ - name: activityId
560
+ in: path
561
+ description: Id of the activity to fail
496
562
  required: true
497
563
  schema:
498
564
  type: string
@@ -500,7 +566,7 @@ paths:
500
566
  content:
501
567
  application/json:
502
568
  schema:
503
- $ref: '#/components/schemas/PauseActivityRequest'
569
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
504
570
  required: true
505
571
  responses:
506
572
  "200":
@@ -508,42 +574,34 @@ paths:
508
574
  content:
509
575
  application/json:
510
576
  schema:
511
- $ref: '#/components/schemas/PauseActivityResponse'
577
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
512
578
  default:
513
579
  description: Default error response
514
580
  content:
515
581
  application/json:
516
582
  schema:
517
583
  $ref: '#/components/schemas/Status'
518
- /api/v1/namespaces/{namespace}/activities/reset:
584
+ /api/v1/namespaces/{namespace}/activities/{activityId}/heartbeat:
519
585
  post:
520
586
  tags:
521
587
  - WorkflowService
522
588
  description: |-
523
- ResetActivity resets the execution of an activity specified by its ID or type.
524
- If there are multiple pending activities of the provided type - all of them will be reset.
525
-
526
- Resetting an activity means:
527
- * number of attempts will be reset to 0.
528
- * activity timeouts will be reset.
529
- * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:
530
- it will be scheduled immediately (* see 'jitter' flag),
531
-
532
- Flags:
533
-
534
- 'jitter': the activity will be scheduled at a random time within the jitter duration.
535
- If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.
536
- 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.
537
- 'keep_paused': if the activity is paused, it will remain paused.
589
+ See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
590
+ namespace/workflow id/activity id instead of task token.
538
591
 
539
- Returns a `NotFound` error if there is no pending activity with the provided ID or type.
540
- This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and
541
- structured to work well for standalone activities.
542
- operationId: ResetActivity
592
+ (-- api-linter: core::0136::prepositions=disabled
593
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
594
+ operationId: RecordActivityTaskHeartbeatById
543
595
  parameters:
544
596
  - name: namespace
545
597
  in: path
546
- description: Namespace of the workflow which scheduled this activity.
598
+ description: Namespace of the workflow which scheduled this activity
599
+ required: true
600
+ schema:
601
+ type: string
602
+ - name: activityId
603
+ in: path
604
+ description: Id of the activity we're heartbeating
547
605
  required: true
548
606
  schema:
549
607
  type: string
@@ -551,7 +609,7 @@ paths:
551
609
  content:
552
610
  application/json:
553
611
  schema:
554
- $ref: '#/components/schemas/ResetActivityRequest'
612
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
555
613
  required: true
556
614
  responses:
557
615
  "200":
@@ -559,70 +617,61 @@ paths:
559
617
  content:
560
618
  application/json:
561
619
  schema:
562
- $ref: '#/components/schemas/ResetActivityResponse'
620
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
563
621
  default:
564
622
  description: Default error response
565
623
  content:
566
624
  application/json:
567
625
  schema:
568
626
  $ref: '#/components/schemas/Status'
569
- /api/v1/namespaces/{namespace}/activities/unpause:
570
- post:
627
+ /api/v1/namespaces/{namespace}/activities/{activityId}/outcome:
628
+ get:
571
629
  tags:
572
630
  - WorkflowService
573
631
  description: |-
574
- UnpauseActivity unpauses the execution of an activity specified by its ID or type.
575
- If there are multiple pending activities of the provided type - all of them will be unpaused.
576
-
577
- If activity is not paused, this call will have no effect.
578
- If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).
579
- Once the activity is unpaused, all timeout timers will be regenerated.
580
-
581
- Flags:
582
- 'jitter': the activity will be scheduled at a random time within the jitter duration.
583
- 'reset_attempts': the number of attempts will be reset.
584
- 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.
585
-
586
- Returns a `NotFound` error if there is no pending activity with the provided ID or type
587
- This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and
588
- structured to work well for standalone activities.
589
- operationId: UnpauseActivity
632
+ PollActivityExecution long-polls for an activity execution to complete and returns the
633
+ outcome (result or failure).
634
+ operationId: PollActivityExecution
590
635
  parameters:
591
636
  - name: namespace
592
637
  in: path
593
- description: Namespace of the workflow which scheduled this activity.
594
638
  required: true
595
639
  schema:
596
640
  type: string
597
- requestBody:
598
- content:
599
- application/json:
600
- schema:
601
- $ref: '#/components/schemas/UnpauseActivityRequest'
602
- required: true
641
+ - name: activityId
642
+ in: path
643
+ required: true
644
+ schema:
645
+ type: string
646
+ - name: runId
647
+ in: query
648
+ description: Activity run ID. If empty the request targets the latest run.
649
+ schema:
650
+ type: string
603
651
  responses:
604
652
  "200":
605
653
  description: OK
606
654
  content:
607
655
  application/json:
608
656
  schema:
609
- $ref: '#/components/schemas/UnpauseActivityResponse'
657
+ $ref: '#/components/schemas/PollActivityExecutionResponse'
610
658
  default:
611
659
  description: Default error response
612
660
  content:
613
661
  application/json:
614
662
  schema:
615
663
  $ref: '#/components/schemas/Status'
616
- /api/v1/namespaces/{namespace}/activities/update-options:
664
+ /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled:
617
665
  post:
618
666
  tags:
619
667
  - WorkflowService
620
668
  description: |-
621
- UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.
622
- If there are multiple pending activities of the provided type - all of them will be updated.
623
- This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and
624
- structured to work well for standalone activities.
625
- operationId: UpdateActivityOptions
669
+ See `RespondActivityTaskCanceled`. This version allows clients to record failures by
670
+ namespace/workflow id/activity id instead of task token.
671
+
672
+ (-- api-linter: core::0136::prepositions=disabled
673
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
674
+ operationId: RespondActivityTaskCanceledById
626
675
  parameters:
627
676
  - name: namespace
628
677
  in: path
@@ -630,11 +679,17 @@ paths:
630
679
  required: true
631
680
  schema:
632
681
  type: string
682
+ - name: activityId
683
+ in: path
684
+ description: Id of the activity to confirm is cancelled
685
+ required: true
686
+ schema:
687
+ type: string
633
688
  requestBody:
634
689
  content:
635
690
  application/json:
636
691
  schema:
637
- $ref: '#/components/schemas/UpdateActivityOptionsRequest'
692
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
638
693
  required: true
639
694
  responses:
640
695
  "200":
@@ -642,24 +697,23 @@ paths:
642
697
  content:
643
698
  application/json:
644
699
  schema:
645
- $ref: '#/components/schemas/UpdateActivityOptionsResponse'
700
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
646
701
  default:
647
702
  description: Default error response
648
703
  content:
649
704
  application/json:
650
705
  schema:
651
706
  $ref: '#/components/schemas/Status'
652
- /api/v1/namespaces/{namespace}/activities/{activityId}:
653
- get:
707
+ /api/v1/namespaces/{namespace}/activities/{activityId}/terminate:
708
+ post:
654
709
  tags:
655
710
  - WorkflowService
656
711
  description: |-
657
- DescribeActivityExecution returns information about an activity execution.
658
- It can be used to:
659
- - Get current activity info without waiting
660
- - Long-poll for next state change and return new activity info
661
- Response can optionally include activity input or outcome (if the activity has completed).
662
- operationId: DescribeActivityExecution
712
+ TerminateActivityExecution terminates an existing activity execution immediately.
713
+
714
+ Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a
715
+ running attempt.
716
+ operationId: TerminateActivityExecution
663
717
  parameters:
664
718
  - name: namespace
665
719
  in: path
@@ -671,75 +725,48 @@ paths:
671
725
  required: true
672
726
  schema:
673
727
  type: string
674
- - name: runId
675
- in: query
676
- description: Activity run ID. If empty the request targets the latest run.
677
- schema:
678
- type: string
679
- - name: includeInput
680
- in: query
681
- description: Include the input field in the response.
682
- schema:
683
- type: boolean
684
- - name: includeOutcome
685
- in: query
686
- description: Include the outcome (result/failure) in the response if the activity has completed.
687
- schema:
688
- type: boolean
689
- - name: longPollToken
690
- in: query
691
- description: |-
692
- Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity
693
- state changes from the state encoded in this token. If absent, return current state immediately.
694
- If present, run_id must also be present.
695
- Note that activity state may change multiple times between requests, therefore it is not
696
- guaranteed that a client making a sequence of long-poll requests will see a complete
697
- sequence of state changes.
698
- schema:
699
- type: string
700
- format: bytes
728
+ requestBody:
729
+ content:
730
+ application/json:
731
+ schema:
732
+ $ref: '#/components/schemas/TerminateActivityExecutionRequest'
733
+ required: true
701
734
  responses:
702
735
  "200":
703
736
  description: OK
704
737
  content:
705
738
  application/json:
706
739
  schema:
707
- $ref: '#/components/schemas/DescribeActivityExecutionResponse'
740
+ $ref: '#/components/schemas/TerminateActivityExecutionResponse'
708
741
  default:
709
742
  description: Default error response
710
743
  content:
711
744
  application/json:
712
745
  schema:
713
746
  $ref: '#/components/schemas/Status'
747
+ /api/v1/namespaces/{namespace}/activity-complete:
714
748
  post:
715
749
  tags:
716
750
  - WorkflowService
717
751
  description: |-
718
- StartActivityExecution starts a new activity execution.
752
+ RespondActivityTaskCompleted is called by workers when they successfully complete an activity
753
+ task.
719
754
 
720
- Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace
721
- unless permitted by the specified ID conflict policy.
722
- operationId: StartActivityExecution
755
+ For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
756
+ and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
757
+ no longer valid due to activity timeout, already being completed, or never having existed.
758
+ operationId: RespondActivityTaskCompleted
723
759
  parameters:
724
760
  - name: namespace
725
761
  in: path
726
762
  required: true
727
763
  schema:
728
764
  type: string
729
- - name: activityId
730
- in: path
731
- description: |-
732
- Identifier for this activity. Required. This identifier should be meaningful in the user's
733
- own system. It must be unique among activities in the same namespace, subject to the rules
734
- imposed by id_reuse_policy and id_conflict_policy.
735
- required: true
736
- schema:
737
- type: string
738
765
  requestBody:
739
766
  content:
740
767
  application/json:
741
768
  schema:
742
- $ref: '#/components/schemas/StartActivityExecutionRequest'
769
+ $ref: '#/components/schemas/RespondActivityTaskCompletedRequest'
743
770
  required: true
744
771
  responses:
745
772
  "200":
@@ -747,118 +774,109 @@ paths:
747
774
  content:
748
775
  application/json:
749
776
  schema:
750
- $ref: '#/components/schemas/StartActivityExecutionResponse'
777
+ $ref: '#/components/schemas/RespondActivityTaskCompletedResponse'
751
778
  default:
752
779
  description: Default error response
753
780
  content:
754
781
  application/json:
755
782
  schema:
756
783
  $ref: '#/components/schemas/Status'
757
- /api/v1/namespaces/{namespace}/activities/{activityId}/cancel:
758
- post:
784
+ /api/v1/namespaces/{namespace}/activity-count:
785
+ get:
759
786
  tags:
760
787
  - WorkflowService
761
- description: |-
762
- RequestCancelActivityExecution requests cancellation of an activity execution.
763
-
764
- Cancellation is cooperative: this call records the request, but the activity must detect and
765
- acknowledge it for the activity to reach CANCELED status. The cancellation signal is
766
- delivered via `cancel_requested` in the heartbeat response; SDKs surface this via
767
- language-idiomatic mechanisms (context cancellation, exceptions, abort signals).
768
- operationId: RequestCancelActivityExecution
788
+ description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace.
789
+ operationId: CountActivityExecutions
769
790
  parameters:
770
791
  - name: namespace
771
792
  in: path
772
793
  required: true
773
794
  schema:
774
795
  type: string
775
- - name: activityId
776
- in: path
777
- required: true
796
+ - name: query
797
+ in: query
798
+ description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
778
799
  schema:
779
800
  type: string
780
- requestBody:
781
- content:
782
- application/json:
783
- schema:
784
- $ref: '#/components/schemas/RequestCancelActivityExecutionRequest'
785
- required: true
786
801
  responses:
787
802
  "200":
788
803
  description: OK
789
804
  content:
790
805
  application/json:
791
806
  schema:
792
- $ref: '#/components/schemas/RequestCancelActivityExecutionResponse'
807
+ $ref: '#/components/schemas/CountActivityExecutionsResponse'
793
808
  default:
794
809
  description: Default error response
795
810
  content:
796
811
  application/json:
797
812
  schema:
798
813
  $ref: '#/components/schemas/Status'
799
- /api/v1/namespaces/{namespace}/activities/{activityId}/outcome:
800
- get:
814
+ /api/v1/namespaces/{namespace}/activity-fail:
815
+ post:
801
816
  tags:
802
817
  - WorkflowService
803
818
  description: |-
804
- PollActivityExecution long-polls for an activity execution to complete and returns the
805
- outcome (result or failure).
806
- operationId: PollActivityExecution
819
+ RespondActivityTaskFailed is called by workers when processing an activity task fails.
820
+
821
+ This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and
822
+ a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
823
+ longer valid due to activity timeout, already being completed, or never having existed.
824
+ operationId: RespondActivityTaskFailed
807
825
  parameters:
808
826
  - name: namespace
809
827
  in: path
810
828
  required: true
811
829
  schema:
812
830
  type: string
813
- - name: activityId
814
- in: path
815
- required: true
816
- schema:
817
- type: string
818
- - name: runId
819
- in: query
820
- description: Activity run ID. If empty the request targets the latest run.
821
- schema:
822
- type: string
831
+ requestBody:
832
+ content:
833
+ application/json:
834
+ schema:
835
+ $ref: '#/components/schemas/RespondActivityTaskFailedRequest'
836
+ required: true
823
837
  responses:
824
838
  "200":
825
839
  description: OK
826
840
  content:
827
841
  application/json:
828
842
  schema:
829
- $ref: '#/components/schemas/PollActivityExecutionResponse'
843
+ $ref: '#/components/schemas/RespondActivityTaskFailedResponse'
830
844
  default:
831
845
  description: Default error response
832
846
  content:
833
847
  application/json:
834
848
  schema:
835
849
  $ref: '#/components/schemas/Status'
836
- /api/v1/namespaces/{namespace}/activities/{activityId}/terminate:
850
+ /api/v1/namespaces/{namespace}/activity-heartbeat:
837
851
  post:
838
852
  tags:
839
853
  - WorkflowService
840
854
  description: |-
841
- TerminateActivityExecution terminates an existing activity execution immediately.
855
+ RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
842
856
 
843
- Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a
844
- running attempt.
845
- operationId: TerminateActivityExecution
857
+ If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
858
+ then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or
859
+ time out the activity.
860
+
861
+ For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow
862
+ history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,
863
+ in that event, the SDK should request cancellation of the activity.
864
+
865
+ The request may contain response `details` which will be persisted by the server and may be
866
+ used by the activity to checkpoint progress. The `cancel_requested` field in the response
867
+ indicates whether cancellation has been requested for the activity.
868
+ operationId: RecordActivityTaskHeartbeat
846
869
  parameters:
847
870
  - name: namespace
848
871
  in: path
849
872
  required: true
850
873
  schema:
851
874
  type: string
852
- - name: activityId
853
- in: path
854
- required: true
855
- schema:
856
- type: string
857
875
  requestBody:
858
876
  content:
859
877
  application/json:
860
878
  schema:
861
- $ref: '#/components/schemas/TerminateActivityExecutionRequest'
879
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest'
862
880
  required: true
863
881
  responses:
864
882
  "200":
@@ -866,37 +884,43 @@ paths:
866
884
  content:
867
885
  application/json:
868
886
  schema:
869
- $ref: '#/components/schemas/TerminateActivityExecutionResponse'
887
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse'
870
888
  default:
871
889
  description: Default error response
872
890
  content:
873
891
  application/json:
874
892
  schema:
875
893
  $ref: '#/components/schemas/Status'
876
- /api/v1/namespaces/{namespace}/activity-count:
877
- get:
894
+ /api/v1/namespaces/{namespace}/activity-resolve-as-canceled:
895
+ post:
878
896
  tags:
879
897
  - WorkflowService
880
- description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace.
881
- operationId: CountActivityExecutions
898
+ description: |-
899
+ RespondActivityTaskFailed is called by workers when processing an activity task fails.
900
+
901
+ For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
902
+ and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
903
+ no longer valid due to activity timeout, already being completed, or never having existed.
904
+ operationId: RespondActivityTaskCanceled
882
905
  parameters:
883
906
  - name: namespace
884
907
  in: path
885
908
  required: true
886
909
  schema:
887
910
  type: string
888
- - name: query
889
- in: query
890
- description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
891
- schema:
892
- type: string
911
+ requestBody:
912
+ content:
913
+ application/json:
914
+ schema:
915
+ $ref: '#/components/schemas/RespondActivityTaskCanceledRequest'
916
+ required: true
893
917
  responses:
894
918
  "200":
895
919
  description: OK
896
920
  content:
897
921
  application/json:
898
922
  schema:
899
- $ref: '#/components/schemas/CountActivityExecutionsResponse'
923
+ $ref: '#/components/schemas/RespondActivityTaskCanceledResponse'
900
924
  default:
901
925
  description: Default error response
902
926
  content:
@@ -1289,21 +1313,51 @@ paths:
1289
1313
  required: true
1290
1314
  schema:
1291
1315
  type: string
1292
- - name: deployment.seriesName
1293
- in: query
1294
- description: |-
1295
- Different versions of the same worker service/application are related together by having a
1296
- shared series name.
1297
- Out of all deployments of a series, one can be designated as the current deployment, which
1298
- receives new workflow executions and new tasks of workflows with
1299
- `VERSIONING_BEHAVIOR_AUTO_UPGRADE` versioning behavior.
1300
- schema:
1301
- type: string
1302
- - name: deployment.buildId
1316
+ - name: deployment.seriesName
1317
+ in: query
1318
+ description: |-
1319
+ Different versions of the same worker service/application are related together by having a
1320
+ shared series name.
1321
+ Out of all deployments of a series, one can be designated as the current deployment, which
1322
+ receives new workflow executions and new tasks of workflows with
1323
+ `VERSIONING_BEHAVIOR_AUTO_UPGRADE` versioning behavior.
1324
+ schema:
1325
+ type: string
1326
+ - name: deployment.buildId
1327
+ in: query
1328
+ description: |-
1329
+ Build ID changes with each version of the worker when the worker program code and/or config
1330
+ changes.
1331
+ schema:
1332
+ type: string
1333
+ responses:
1334
+ "200":
1335
+ description: OK
1336
+ content:
1337
+ application/json:
1338
+ schema:
1339
+ $ref: '#/components/schemas/GetDeploymentReachabilityResponse'
1340
+ default:
1341
+ description: Default error response
1342
+ content:
1343
+ application/json:
1344
+ schema:
1345
+ $ref: '#/components/schemas/Status'
1346
+ /api/v1/namespaces/{namespace}/schedule-count:
1347
+ get:
1348
+ tags:
1349
+ - WorkflowService
1350
+ description: CountSchedules is a visibility API to count schedules in a specific namespace.
1351
+ operationId: CountSchedules
1352
+ parameters:
1353
+ - name: namespace
1354
+ in: path
1355
+ required: true
1356
+ schema:
1357
+ type: string
1358
+ - name: query
1303
1359
  in: query
1304
- description: |-
1305
- Build ID changes with each version of the worker when the worker program code and/or config
1306
- changes.
1360
+ description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
1307
1361
  schema:
1308
1362
  type: string
1309
1363
  responses:
@@ -1312,7 +1366,7 @@ paths:
1312
1366
  content:
1313
1367
  application/json:
1314
1368
  schema:
1315
- $ref: '#/components/schemas/GetDeploymentReachabilityResponse'
1369
+ $ref: '#/components/schemas/CountSchedulesResponse'
1316
1370
  default:
1317
1371
  description: Default error response
1318
1372
  content:
@@ -2763,46 +2817,6 @@ paths:
2763
2817
  application/json:
2764
2818
  schema:
2765
2819
  $ref: '#/components/schemas/Status'
2766
- /api/v1/namespaces/{namespace}/workflows/execute-multi-operation:
2767
- post:
2768
- tags:
2769
- - WorkflowService
2770
- description: |-
2771
- ExecuteMultiOperation executes multiple operations within a single workflow.
2772
-
2773
- Operations are started atomically, meaning if *any* operation fails to be started, none are,
2774
- and the request fails. Upon start, the API returns only when *all* operations have a response.
2775
-
2776
- Upon failure, it returns `MultiOperationExecutionFailure` where the status code
2777
- equals the status code of the *first* operation that failed to be started.
2778
-
2779
- NOTE: Experimental API.
2780
- operationId: ExecuteMultiOperation
2781
- parameters:
2782
- - name: namespace
2783
- in: path
2784
- required: true
2785
- schema:
2786
- type: string
2787
- requestBody:
2788
- content:
2789
- application/json:
2790
- schema:
2791
- $ref: '#/components/schemas/ExecuteMultiOperationRequest'
2792
- required: true
2793
- responses:
2794
- "200":
2795
- description: OK
2796
- content:
2797
- application/json:
2798
- schema:
2799
- $ref: '#/components/schemas/ExecuteMultiOperationResponse'
2800
- default:
2801
- description: Default error response
2802
- content:
2803
- application/json:
2804
- schema:
2805
- $ref: '#/components/schemas/Status'
2806
2820
  /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}:
2807
2821
  get:
2808
2822
  tags:
@@ -2945,48 +2959,276 @@ paths:
2945
2959
  in: query
2946
2960
  schema:
2947
2961
  type: string
2948
- - name: maximumPageSize
2949
- in: query
2962
+ - name: maximumPageSize
2963
+ in: query
2964
+ schema:
2965
+ type: integer
2966
+ format: int32
2967
+ - name: nextPageToken
2968
+ in: query
2969
+ schema:
2970
+ type: string
2971
+ format: bytes
2972
+ responses:
2973
+ "200":
2974
+ description: OK
2975
+ content:
2976
+ application/json:
2977
+ schema:
2978
+ $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse'
2979
+ default:
2980
+ description: Default error response
2981
+ content:
2982
+ application/json:
2983
+ schema:
2984
+ $ref: '#/components/schemas/Status'
2985
+ /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}:
2986
+ post:
2987
+ tags:
2988
+ - WorkflowService
2989
+ description: QueryWorkflow requests a query be executed for a specified workflow execution.
2990
+ operationId: QueryWorkflow
2991
+ parameters:
2992
+ - name: namespace
2993
+ in: path
2994
+ required: true
2995
+ schema:
2996
+ type: string
2997
+ - name: execution.workflow_id
2998
+ in: path
2999
+ required: true
3000
+ schema:
3001
+ type: string
3002
+ - name: query.query_type
3003
+ in: path
3004
+ required: true
3005
+ schema:
3006
+ type: string
3007
+ requestBody:
3008
+ content:
3009
+ application/json:
3010
+ schema:
3011
+ $ref: '#/components/schemas/QueryWorkflowRequest'
3012
+ required: true
3013
+ responses:
3014
+ "200":
3015
+ description: OK
3016
+ content:
3017
+ application/json:
3018
+ schema:
3019
+ $ref: '#/components/schemas/QueryWorkflowResponse'
3020
+ default:
3021
+ description: Default error response
3022
+ content:
3023
+ application/json:
3024
+ schema:
3025
+ $ref: '#/components/schemas/Status'
3026
+ /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule:
3027
+ post:
3028
+ tags:
3029
+ - WorkflowService
3030
+ description: |-
3031
+ TriggerWorkflowRule allows to:
3032
+ * trigger existing rule for a specific workflow execution;
3033
+ * trigger rule for a specific workflow execution without creating a rule;
3034
+ This is useful for one-off operations.
3035
+ operationId: TriggerWorkflowRule
3036
+ parameters:
3037
+ - name: namespace
3038
+ in: path
3039
+ required: true
3040
+ schema:
3041
+ type: string
3042
+ - name: execution.workflow_id
3043
+ in: path
3044
+ required: true
3045
+ schema:
3046
+ type: string
3047
+ requestBody:
3048
+ content:
3049
+ application/json:
3050
+ schema:
3051
+ $ref: '#/components/schemas/TriggerWorkflowRuleRequest'
3052
+ required: true
3053
+ responses:
3054
+ "200":
3055
+ description: OK
3056
+ content:
3057
+ application/json:
3058
+ schema:
3059
+ $ref: '#/components/schemas/TriggerWorkflowRuleResponse'
3060
+ default:
3061
+ description: Default error response
3062
+ content:
3063
+ application/json:
3064
+ schema:
3065
+ $ref: '#/components/schemas/Status'
3066
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}:
3067
+ post:
3068
+ tags:
3069
+ - WorkflowService
3070
+ description: |-
3071
+ StartWorkflowExecution starts a new workflow execution.
3072
+
3073
+ It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and
3074
+ also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an
3075
+ instance already exists with same workflow id.
3076
+ operationId: StartWorkflowExecution
3077
+ parameters:
3078
+ - name: namespace
3079
+ in: path
3080
+ required: true
3081
+ schema:
3082
+ type: string
3083
+ - name: workflowId
3084
+ in: path
3085
+ required: true
3086
+ schema:
3087
+ type: string
3088
+ requestBody:
3089
+ content:
3090
+ application/json:
3091
+ schema:
3092
+ $ref: '#/components/schemas/StartWorkflowExecutionRequest'
3093
+ required: true
3094
+ responses:
3095
+ "200":
3096
+ description: OK
3097
+ content:
3098
+ application/json:
3099
+ schema:
3100
+ $ref: '#/components/schemas/StartWorkflowExecutionResponse'
3101
+ default:
3102
+ description: Default error response
3103
+ content:
3104
+ application/json:
3105
+ schema:
3106
+ $ref: '#/components/schemas/Status'
3107
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete:
3108
+ post:
3109
+ tags:
3110
+ - WorkflowService
3111
+ description: |-
3112
+ See `RespondActivityTaskCompleted`. This version allows clients to record completions by
3113
+ namespace/workflow id/activity id instead of task token.
3114
+
3115
+ (-- api-linter: core::0136::prepositions=disabled
3116
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
3117
+ operationId: RespondActivityTaskCompletedById
3118
+ parameters:
3119
+ - name: namespace
3120
+ in: path
3121
+ description: Namespace of the workflow which scheduled this activity
3122
+ required: true
3123
+ schema:
3124
+ type: string
3125
+ - name: workflowId
3126
+ in: path
3127
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
3128
+ required: true
3129
+ schema:
3130
+ type: string
3131
+ - name: activityId
3132
+ in: path
3133
+ description: Id of the activity to complete
3134
+ required: true
3135
+ schema:
3136
+ type: string
3137
+ requestBody:
3138
+ content:
3139
+ application/json:
3140
+ schema:
3141
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
3142
+ required: true
3143
+ responses:
3144
+ "200":
3145
+ description: OK
3146
+ content:
3147
+ application/json:
3148
+ schema:
3149
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
3150
+ default:
3151
+ description: Default error response
3152
+ content:
3153
+ application/json:
3154
+ schema:
3155
+ $ref: '#/components/schemas/Status'
3156
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail:
3157
+ post:
3158
+ tags:
3159
+ - WorkflowService
3160
+ description: |-
3161
+ See `RecordActivityTaskFailed`. This version allows clients to record failures by
3162
+ namespace/workflow id/activity id instead of task token.
3163
+
3164
+ (-- api-linter: core::0136::prepositions=disabled
3165
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
3166
+ operationId: RespondActivityTaskFailedById
3167
+ parameters:
3168
+ - name: namespace
3169
+ in: path
3170
+ description: Namespace of the workflow which scheduled this activity
3171
+ required: true
3172
+ schema:
3173
+ type: string
3174
+ - name: workflowId
3175
+ in: path
3176
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
3177
+ required: true
2950
3178
  schema:
2951
- type: integer
2952
- format: int32
2953
- - name: nextPageToken
2954
- in: query
3179
+ type: string
3180
+ - name: activityId
3181
+ in: path
3182
+ description: Id of the activity to fail
3183
+ required: true
2955
3184
  schema:
2956
3185
  type: string
2957
- format: bytes
3186
+ requestBody:
3187
+ content:
3188
+ application/json:
3189
+ schema:
3190
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
3191
+ required: true
2958
3192
  responses:
2959
3193
  "200":
2960
3194
  description: OK
2961
3195
  content:
2962
3196
  application/json:
2963
3197
  schema:
2964
- $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse'
3198
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
2965
3199
  default:
2966
3200
  description: Default error response
2967
3201
  content:
2968
3202
  application/json:
2969
3203
  schema:
2970
3204
  $ref: '#/components/schemas/Status'
2971
- /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}:
3205
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat:
2972
3206
  post:
2973
3207
  tags:
2974
3208
  - WorkflowService
2975
- description: QueryWorkflow requests a query be executed for a specified workflow execution.
2976
- operationId: QueryWorkflow
3209
+ description: |-
3210
+ See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
3211
+ namespace/workflow id/activity id instead of task token.
3212
+
3213
+ (-- api-linter: core::0136::prepositions=disabled
3214
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
3215
+ operationId: RecordActivityTaskHeartbeatById
2977
3216
  parameters:
2978
3217
  - name: namespace
2979
3218
  in: path
3219
+ description: Namespace of the workflow which scheduled this activity
2980
3220
  required: true
2981
3221
  schema:
2982
3222
  type: string
2983
- - name: execution.workflow_id
3223
+ - name: workflowId
2984
3224
  in: path
3225
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
2985
3226
  required: true
2986
3227
  schema:
2987
3228
  type: string
2988
- - name: query.query_type
3229
+ - name: activityId
2989
3230
  in: path
3231
+ description: Id of the activity we're heartbeating
2990
3232
  required: true
2991
3233
  schema:
2992
3234
  type: string
@@ -2994,7 +3236,7 @@ paths:
2994
3236
  content:
2995
3237
  application/json:
2996
3238
  schema:
2997
- $ref: '#/components/schemas/QueryWorkflowRequest'
3239
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
2998
3240
  required: true
2999
3241
  responses:
3000
3242
  "200":
@@ -3002,31 +3244,40 @@ paths:
3002
3244
  content:
3003
3245
  application/json:
3004
3246
  schema:
3005
- $ref: '#/components/schemas/QueryWorkflowResponse'
3247
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
3006
3248
  default:
3007
3249
  description: Default error response
3008
3250
  content:
3009
3251
  application/json:
3010
3252
  schema:
3011
3253
  $ref: '#/components/schemas/Status'
3012
- /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule:
3254
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled:
3013
3255
  post:
3014
3256
  tags:
3015
3257
  - WorkflowService
3016
3258
  description: |-
3017
- TriggerWorkflowRule allows to:
3018
- * trigger existing rule for a specific workflow execution;
3019
- * trigger rule for a specific workflow execution without creating a rule;
3020
- This is useful for one-off operations.
3021
- operationId: TriggerWorkflowRule
3259
+ See `RespondActivityTaskCanceled`. This version allows clients to record failures by
3260
+ namespace/workflow id/activity id instead of task token.
3261
+
3262
+ (-- api-linter: core::0136::prepositions=disabled
3263
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
3264
+ operationId: RespondActivityTaskCanceledById
3022
3265
  parameters:
3023
3266
  - name: namespace
3024
3267
  in: path
3268
+ description: Namespace of the workflow which scheduled this activity
3025
3269
  required: true
3026
3270
  schema:
3027
3271
  type: string
3028
- - name: execution.workflow_id
3272
+ - name: workflowId
3273
+ in: path
3274
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
3275
+ required: true
3276
+ schema:
3277
+ type: string
3278
+ - name: activityId
3029
3279
  in: path
3280
+ description: Id of the activity to confirm is cancelled
3030
3281
  required: true
3031
3282
  schema:
3032
3283
  type: string
@@ -3034,7 +3285,7 @@ paths:
3034
3285
  content:
3035
3286
  application/json:
3036
3287
  schema:
3037
- $ref: '#/components/schemas/TriggerWorkflowRuleRequest'
3288
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
3038
3289
  required: true
3039
3290
  responses:
3040
3291
  "200":
@@ -3042,32 +3293,37 @@ paths:
3042
3293
  content:
3043
3294
  application/json:
3044
3295
  schema:
3045
- $ref: '#/components/schemas/TriggerWorkflowRuleResponse'
3296
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
3046
3297
  default:
3047
3298
  description: Default error response
3048
3299
  content:
3049
3300
  application/json:
3050
3301
  schema:
3051
3302
  $ref: '#/components/schemas/Status'
3052
- /api/v1/namespaces/{namespace}/workflows/{workflowId}:
3303
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause:
3053
3304
  post:
3054
3305
  tags:
3055
3306
  - WorkflowService
3056
3307
  description: |-
3057
- StartWorkflowExecution starts a new workflow execution.
3058
-
3059
- It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and
3060
- also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an
3061
- instance already exists with same workflow id.
3062
- operationId: StartWorkflowExecution
3308
+ Note: This is an experimental API and the behavior may change in a future release.
3309
+ PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in
3310
+ - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history
3311
+ - No new workflow tasks or activity tasks are dispatched.
3312
+ - Any workflow task currently executing on the worker will be allowed to complete.
3313
+ - Any activity task currently executing will be paused.
3314
+ - All server-side events will continue to be processed by the server.
3315
+ - Queries & Updates on a paused workflow will be rejected.
3316
+ operationId: PauseWorkflowExecution
3063
3317
  parameters:
3064
3318
  - name: namespace
3065
3319
  in: path
3320
+ description: Namespace of the workflow to pause.
3066
3321
  required: true
3067
3322
  schema:
3068
3323
  type: string
3069
3324
  - name: workflowId
3070
3325
  in: path
3326
+ description: ID of the workflow execution to be paused. Required.
3071
3327
  required: true
3072
3328
  schema:
3073
3329
  type: string
@@ -3075,7 +3331,7 @@ paths:
3075
3331
  content:
3076
3332
  application/json:
3077
3333
  schema:
3078
- $ref: '#/components/schemas/StartWorkflowExecutionRequest'
3334
+ $ref: '#/components/schemas/PauseWorkflowExecutionRequest'
3079
3335
  required: true
3080
3336
  responses:
3081
3337
  "200":
@@ -3083,7 +3339,7 @@ paths:
3083
3339
  content:
3084
3340
  application/json:
3085
3341
  schema:
3086
- $ref: '#/components/schemas/StartWorkflowExecutionResponse'
3342
+ $ref: '#/components/schemas/PauseWorkflowExecutionResponse'
3087
3343
  default:
3088
3344
  description: Default error response
3089
3345
  content:
@@ -3144,6 +3400,49 @@ paths:
3144
3400
  application/json:
3145
3401
  schema:
3146
3402
  $ref: '#/components/schemas/Status'
3403
+ /api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause:
3404
+ post:
3405
+ tags:
3406
+ - WorkflowService
3407
+ description: |-
3408
+ Note: This is an experimental API and the behavior may change in a future release.
3409
+ UnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.
3410
+ Unpausing a workflow execution results in
3411
+ - The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history
3412
+ - Workflow tasks and activity tasks are resumed.
3413
+ operationId: UnpauseWorkflowExecution
3414
+ parameters:
3415
+ - name: namespace
3416
+ in: path
3417
+ description: Namespace of the workflow to unpause.
3418
+ required: true
3419
+ schema:
3420
+ type: string
3421
+ - name: workflowId
3422
+ in: path
3423
+ description: ID of the workflow execution to be paused. Required.
3424
+ required: true
3425
+ schema:
3426
+ type: string
3427
+ requestBody:
3428
+ content:
3429
+ application/json:
3430
+ schema:
3431
+ $ref: '#/components/schemas/UnpauseWorkflowExecutionRequest'
3432
+ required: true
3433
+ responses:
3434
+ "200":
3435
+ description: OK
3436
+ content:
3437
+ application/json:
3438
+ schema:
3439
+ $ref: '#/components/schemas/UnpauseWorkflowExecutionResponse'
3440
+ default:
3441
+ description: Default error response
3442
+ content:
3443
+ application/json:
3444
+ schema:
3445
+ $ref: '#/components/schemas/Status'
3147
3446
  /api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/cancel:
3148
3447
  post:
3149
3448
  tags:
@@ -3958,57 +4257,34 @@ paths:
3958
4257
  application/json:
3959
4258
  schema:
3960
4259
  $ref: '#/components/schemas/Status'
3961
- /namespaces/{namespace}/activities/cancel:
4260
+ /namespaces/{namespace}/activities-deprecated/pause:
3962
4261
  post:
3963
4262
  tags:
3964
4263
  - WorkflowService
3965
4264
  description: |-
3966
- RespondActivityTaskFailed is called by workers when processing an activity task fails.
4265
+ PauseActivity pauses the execution of an activity specified by its ID or type.
4266
+ If there are multiple pending activities of the provided type - all of them will be paused
3967
4267
 
3968
- For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
3969
- and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
3970
- no longer valid due to activity timeout, already being completed, or never having existed.
3971
- operationId: RespondActivityTaskCanceled
3972
- parameters:
3973
- - name: namespace
3974
- in: path
3975
- required: true
3976
- schema:
3977
- type: string
3978
- requestBody:
3979
- content:
3980
- application/json:
3981
- schema:
3982
- $ref: '#/components/schemas/RespondActivityTaskCanceledRequest'
3983
- required: true
3984
- responses:
3985
- "200":
3986
- description: OK
3987
- content:
3988
- application/json:
3989
- schema:
3990
- $ref: '#/components/schemas/RespondActivityTaskCanceledResponse'
3991
- default:
3992
- description: Default error response
3993
- content:
3994
- application/json:
3995
- schema:
3996
- $ref: '#/components/schemas/Status'
3997
- /namespaces/{namespace}/activities/cancel-by-id:
3998
- post:
3999
- tags:
4000
- - WorkflowService
4001
- description: |-
4002
- See `RespondActivityTaskCanceled`. This version allows clients to record failures by
4003
- namespace/workflow id/activity id instead of task token.
4268
+ Pausing an activity means:
4269
+ - If the activity is currently waiting for a retry or is running and subsequently fails,
4270
+ it will not be rescheduled until it is unpaused.
4271
+ - If the activity is already paused, calling this method will have no effect.
4272
+ - If the activity is running and finishes successfully, the activity will be completed.
4273
+ - If the activity is running and finishes with failure:
4274
+ * if there is no retry left - the activity will be completed.
4275
+ * if there are more retries left - the activity will be paused.
4276
+ For long-running activities:
4277
+ - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'.
4278
+ - The activity should respond to the cancellation accordingly.
4004
4279
 
4005
- (-- api-linter: core::0136::prepositions=disabled
4006
- aip.dev/not-precedent: "By" is used to indicate request type. --)
4007
- operationId: RespondActivityTaskCanceledById
4280
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type
4281
+ This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and
4282
+ structured to work well for standalone activities.
4283
+ operationId: PauseActivity
4008
4284
  parameters:
4009
4285
  - name: namespace
4010
4286
  in: path
4011
- description: Namespace of the workflow which scheduled this activity
4287
+ description: Namespace of the workflow which scheduled this activity.
4012
4288
  required: true
4013
4289
  schema:
4014
4290
  type: string
@@ -4016,7 +4292,7 @@ paths:
4016
4292
  content:
4017
4293
  application/json:
4018
4294
  schema:
4019
- $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
4295
+ $ref: '#/components/schemas/PauseActivityRequest'
4020
4296
  required: true
4021
4297
  responses:
4022
4298
  "200":
@@ -4024,65 +4300,42 @@ paths:
4024
4300
  content:
4025
4301
  application/json:
4026
4302
  schema:
4027
- $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
4303
+ $ref: '#/components/schemas/PauseActivityResponse'
4028
4304
  default:
4029
4305
  description: Default error response
4030
4306
  content:
4031
4307
  application/json:
4032
4308
  schema:
4033
4309
  $ref: '#/components/schemas/Status'
4034
- /namespaces/{namespace}/activities/complete:
4310
+ /namespaces/{namespace}/activities-deprecated/reset:
4035
4311
  post:
4036
4312
  tags:
4037
4313
  - WorkflowService
4038
4314
  description: |-
4039
- RespondActivityTaskCompleted is called by workers when they successfully complete an activity
4040
- task.
4315
+ ResetActivity resets the execution of an activity specified by its ID or type.
4316
+ If there are multiple pending activities of the provided type - all of them will be reset.
4041
4317
 
4042
- For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
4043
- and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
4044
- no longer valid due to activity timeout, already being completed, or never having existed.
4045
- operationId: RespondActivityTaskCompleted
4046
- parameters:
4047
- - name: namespace
4048
- in: path
4049
- required: true
4050
- schema:
4051
- type: string
4052
- requestBody:
4053
- content:
4054
- application/json:
4055
- schema:
4056
- $ref: '#/components/schemas/RespondActivityTaskCompletedRequest'
4057
- required: true
4058
- responses:
4059
- "200":
4060
- description: OK
4061
- content:
4062
- application/json:
4063
- schema:
4064
- $ref: '#/components/schemas/RespondActivityTaskCompletedResponse'
4065
- default:
4066
- description: Default error response
4067
- content:
4068
- application/json:
4069
- schema:
4070
- $ref: '#/components/schemas/Status'
4071
- /namespaces/{namespace}/activities/complete-by-id:
4072
- post:
4073
- tags:
4074
- - WorkflowService
4075
- description: |-
4076
- See `RespondActivityTaskCompleted`. This version allows clients to record completions by
4077
- namespace/workflow id/activity id instead of task token.
4318
+ Resetting an activity means:
4319
+ * number of attempts will be reset to 0.
4320
+ * activity timeouts will be reset.
4321
+ * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:
4322
+ it will be scheduled immediately (* see 'jitter' flag),
4078
4323
 
4079
- (-- api-linter: core::0136::prepositions=disabled
4080
- aip.dev/not-precedent: "By" is used to indicate request type. --)
4081
- operationId: RespondActivityTaskCompletedById
4324
+ Flags:
4325
+
4326
+ 'jitter': the activity will be scheduled at a random time within the jitter duration.
4327
+ If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.
4328
+ 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.
4329
+ 'keep_paused': if the activity is paused, it will remain paused.
4330
+
4331
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type.
4332
+ This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and
4333
+ structured to work well for standalone activities.
4334
+ operationId: ResetActivity
4082
4335
  parameters:
4083
4336
  - name: namespace
4084
4337
  in: path
4085
- description: Namespace of the workflow which scheduled this activity
4338
+ description: Namespace of the workflow which scheduled this activity.
4086
4339
  required: true
4087
4340
  schema:
4088
4341
  type: string
@@ -4090,7 +4343,7 @@ paths:
4090
4343
  content:
4091
4344
  application/json:
4092
4345
  schema:
4093
- $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
4346
+ $ref: '#/components/schemas/ResetActivityRequest'
4094
4347
  required: true
4095
4348
  responses:
4096
4349
  "200":
@@ -4098,27 +4351,38 @@ paths:
4098
4351
  content:
4099
4352
  application/json:
4100
4353
  schema:
4101
- $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
4354
+ $ref: '#/components/schemas/ResetActivityResponse'
4102
4355
  default:
4103
4356
  description: Default error response
4104
4357
  content:
4105
4358
  application/json:
4106
4359
  schema:
4107
4360
  $ref: '#/components/schemas/Status'
4108
- /namespaces/{namespace}/activities/fail:
4361
+ /namespaces/{namespace}/activities-deprecated/unpause:
4109
4362
  post:
4110
4363
  tags:
4111
4364
  - WorkflowService
4112
4365
  description: |-
4113
- RespondActivityTaskFailed is called by workers when processing an activity task fails.
4366
+ UnpauseActivity unpauses the execution of an activity specified by its ID or type.
4367
+ If there are multiple pending activities of the provided type - all of them will be unpaused.
4114
4368
 
4115
- This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and
4116
- a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
4117
- longer valid due to activity timeout, already being completed, or never having existed.
4118
- operationId: RespondActivityTaskFailed
4369
+ If activity is not paused, this call will have no effect.
4370
+ If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).
4371
+ Once the activity is unpaused, all timeout timers will be regenerated.
4372
+
4373
+ Flags:
4374
+ 'jitter': the activity will be scheduled at a random time within the jitter duration.
4375
+ 'reset_attempts': the number of attempts will be reset.
4376
+ 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.
4377
+
4378
+ Returns a `NotFound` error if there is no pending activity with the provided ID or type
4379
+ This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and
4380
+ structured to work well for standalone activities.
4381
+ operationId: UnpauseActivity
4119
4382
  parameters:
4120
4383
  - name: namespace
4121
4384
  in: path
4385
+ description: Namespace of the workflow which scheduled this activity.
4122
4386
  required: true
4123
4387
  schema:
4124
4388
  type: string
@@ -4126,7 +4390,7 @@ paths:
4126
4390
  content:
4127
4391
  application/json:
4128
4392
  schema:
4129
- $ref: '#/components/schemas/RespondActivityTaskFailedRequest'
4393
+ $ref: '#/components/schemas/UnpauseActivityRequest'
4130
4394
  required: true
4131
4395
  responses:
4132
4396
  "200":
@@ -4134,24 +4398,23 @@ paths:
4134
4398
  content:
4135
4399
  application/json:
4136
4400
  schema:
4137
- $ref: '#/components/schemas/RespondActivityTaskFailedResponse'
4401
+ $ref: '#/components/schemas/UnpauseActivityResponse'
4138
4402
  default:
4139
4403
  description: Default error response
4140
4404
  content:
4141
4405
  application/json:
4142
4406
  schema:
4143
4407
  $ref: '#/components/schemas/Status'
4144
- /namespaces/{namespace}/activities/fail-by-id:
4408
+ /namespaces/{namespace}/activities-deprecated/update-options:
4145
4409
  post:
4146
4410
  tags:
4147
4411
  - WorkflowService
4148
4412
  description: |-
4149
- See `RecordActivityTaskFailed`. This version allows clients to record failures by
4150
- namespace/workflow id/activity id instead of task token.
4151
-
4152
- (-- api-linter: core::0136::prepositions=disabled
4153
- aip.dev/not-precedent: "By" is used to indicate request type. --)
4154
- operationId: RespondActivityTaskFailedById
4413
+ UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.
4414
+ If there are multiple pending activities of the provided type - all of them will be updated.
4415
+ This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and
4416
+ structured to work well for standalone activities.
4417
+ operationId: UpdateActivityOptions
4155
4418
  parameters:
4156
4419
  - name: namespace
4157
4420
  in: path
@@ -4163,7 +4426,7 @@ paths:
4163
4426
  content:
4164
4427
  application/json:
4165
4428
  schema:
4166
- $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
4429
+ $ref: '#/components/schemas/UpdateActivityOptionsRequest'
4167
4430
  required: true
4168
4431
  responses:
4169
4432
  "200":
@@ -4171,72 +4434,96 @@ paths:
4171
4434
  content:
4172
4435
  application/json:
4173
4436
  schema:
4174
- $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
4437
+ $ref: '#/components/schemas/UpdateActivityOptionsResponse'
4175
4438
  default:
4176
4439
  description: Default error response
4177
4440
  content:
4178
4441
  application/json:
4179
4442
  schema:
4180
4443
  $ref: '#/components/schemas/Status'
4181
- /namespaces/{namespace}/activities/heartbeat:
4182
- post:
4444
+ /namespaces/{namespace}/activities/{activityId}:
4445
+ get:
4183
4446
  tags:
4184
4447
  - WorkflowService
4185
4448
  description: |-
4186
- RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
4187
-
4188
- If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
4189
- then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or
4190
- time out the activity.
4191
-
4192
- For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow
4193
- history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,
4194
- in that event, the SDK should request cancellation of the activity.
4195
-
4196
- The request may contain response `details` which will be persisted by the server and may be
4197
- used by the activity to checkpoint progress. The `cancel_requested` field in the response
4198
- indicates whether cancellation has been requested for the activity.
4199
- operationId: RecordActivityTaskHeartbeat
4449
+ DescribeActivityExecution returns information about an activity execution.
4450
+ It can be used to:
4451
+ - Get current activity info without waiting
4452
+ - Long-poll for next state change and return new activity info
4453
+ Response can optionally include activity input or outcome (if the activity has completed).
4454
+ operationId: DescribeActivityExecution
4200
4455
  parameters:
4201
4456
  - name: namespace
4202
4457
  in: path
4203
4458
  required: true
4204
4459
  schema:
4205
4460
  type: string
4206
- requestBody:
4207
- content:
4208
- application/json:
4209
- schema:
4210
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest'
4211
- required: true
4461
+ - name: activityId
4462
+ in: path
4463
+ required: true
4464
+ schema:
4465
+ type: string
4466
+ - name: runId
4467
+ in: query
4468
+ description: Activity run ID. If empty the request targets the latest run.
4469
+ schema:
4470
+ type: string
4471
+ - name: includeInput
4472
+ in: query
4473
+ description: Include the input field in the response.
4474
+ schema:
4475
+ type: boolean
4476
+ - name: includeOutcome
4477
+ in: query
4478
+ description: Include the outcome (result/failure) in the response if the activity has completed.
4479
+ schema:
4480
+ type: boolean
4481
+ - name: longPollToken
4482
+ in: query
4483
+ description: |-
4484
+ Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity
4485
+ state changes from the state encoded in this token. If absent, return current state immediately.
4486
+ If present, run_id must also be present.
4487
+ Note that activity state may change multiple times between requests, therefore it is not
4488
+ guaranteed that a client making a sequence of long-poll requests will see a complete
4489
+ sequence of state changes.
4490
+ schema:
4491
+ type: string
4492
+ format: bytes
4212
4493
  responses:
4213
4494
  "200":
4214
4495
  description: OK
4215
4496
  content:
4216
4497
  application/json:
4217
4498
  schema:
4218
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse'
4499
+ $ref: '#/components/schemas/DescribeActivityExecutionResponse'
4219
4500
  default:
4220
4501
  description: Default error response
4221
4502
  content:
4222
4503
  application/json:
4223
4504
  schema:
4224
4505
  $ref: '#/components/schemas/Status'
4225
- /namespaces/{namespace}/activities/heartbeat-by-id:
4226
4506
  post:
4227
4507
  tags:
4228
4508
  - WorkflowService
4229
4509
  description: |-
4230
- See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
4231
- namespace/workflow id/activity id instead of task token.
4510
+ StartActivityExecution starts a new activity execution.
4232
4511
 
4233
- (-- api-linter: core::0136::prepositions=disabled
4234
- aip.dev/not-precedent: "By" is used to indicate request type. --)
4235
- operationId: RecordActivityTaskHeartbeatById
4512
+ Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace
4513
+ unless permitted by the specified ID conflict policy.
4514
+ operationId: StartActivityExecution
4236
4515
  parameters:
4237
4516
  - name: namespace
4238
4517
  in: path
4239
- description: Namespace of the workflow which scheduled this activity
4518
+ required: true
4519
+ schema:
4520
+ type: string
4521
+ - name: activityId
4522
+ in: path
4523
+ description: |-
4524
+ Identifier for this activity. Required. This identifier should be meaningful in the user's
4525
+ own system. It must be unique among activities in the same namespace, subject to the rules
4526
+ imposed by id_reuse_policy and id_conflict_policy.
4240
4527
  required: true
4241
4528
  schema:
4242
4529
  type: string
@@ -4244,7 +4531,7 @@ paths:
4244
4531
  content:
4245
4532
  application/json:
4246
4533
  schema:
4247
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
4534
+ $ref: '#/components/schemas/StartActivityExecutionRequest'
4248
4535
  required: true
4249
4536
  responses:
4250
4537
  "200":
@@ -4252,41 +4539,33 @@ paths:
4252
4539
  content:
4253
4540
  application/json:
4254
4541
  schema:
4255
- $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
4542
+ $ref: '#/components/schemas/StartActivityExecutionResponse'
4256
4543
  default:
4257
4544
  description: Default error response
4258
4545
  content:
4259
4546
  application/json:
4260
4547
  schema:
4261
4548
  $ref: '#/components/schemas/Status'
4262
- /namespaces/{namespace}/activities/pause:
4549
+ /namespaces/{namespace}/activities/{activityId}/cancel:
4263
4550
  post:
4264
4551
  tags:
4265
4552
  - WorkflowService
4266
4553
  description: |-
4267
- PauseActivity pauses the execution of an activity specified by its ID or type.
4268
- If there are multiple pending activities of the provided type - all of them will be paused
4269
-
4270
- Pausing an activity means:
4271
- - If the activity is currently waiting for a retry or is running and subsequently fails,
4272
- it will not be rescheduled until it is unpaused.
4273
- - If the activity is already paused, calling this method will have no effect.
4274
- - If the activity is running and finishes successfully, the activity will be completed.
4275
- - If the activity is running and finishes with failure:
4276
- * if there is no retry left - the activity will be completed.
4277
- * if there are more retries left - the activity will be paused.
4278
- For long-running activities:
4279
- - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'.
4280
- - The activity should respond to the cancellation accordingly.
4554
+ RequestCancelActivityExecution requests cancellation of an activity execution.
4281
4555
 
4282
- Returns a `NotFound` error if there is no pending activity with the provided ID or type
4283
- This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and
4284
- structured to work well for standalone activities.
4285
- operationId: PauseActivity
4556
+ Cancellation is cooperative: this call records the request, but the activity must detect and
4557
+ acknowledge it for the activity to reach CANCELED status. The cancellation signal is
4558
+ delivered via `cancel_requested` in the heartbeat response; SDKs surface this via
4559
+ language-idiomatic mechanisms (context cancellation, exceptions, abort signals).
4560
+ operationId: RequestCancelActivityExecution
4286
4561
  parameters:
4287
4562
  - name: namespace
4288
4563
  in: path
4289
- description: Namespace of the workflow which scheduled this activity.
4564
+ required: true
4565
+ schema:
4566
+ type: string
4567
+ - name: activityId
4568
+ in: path
4290
4569
  required: true
4291
4570
  schema:
4292
4571
  type: string
@@ -4294,7 +4573,7 @@ paths:
4294
4573
  content:
4295
4574
  application/json:
4296
4575
  schema:
4297
- $ref: '#/components/schemas/PauseActivityRequest'
4576
+ $ref: '#/components/schemas/RequestCancelActivityExecutionRequest'
4298
4577
  required: true
4299
4578
  responses:
4300
4579
  "200":
@@ -4302,42 +4581,34 @@ paths:
4302
4581
  content:
4303
4582
  application/json:
4304
4583
  schema:
4305
- $ref: '#/components/schemas/PauseActivityResponse'
4584
+ $ref: '#/components/schemas/RequestCancelActivityExecutionResponse'
4306
4585
  default:
4307
4586
  description: Default error response
4308
4587
  content:
4309
4588
  application/json:
4310
4589
  schema:
4311
4590
  $ref: '#/components/schemas/Status'
4312
- /namespaces/{namespace}/activities/reset:
4591
+ /namespaces/{namespace}/activities/{activityId}/complete:
4313
4592
  post:
4314
4593
  tags:
4315
4594
  - WorkflowService
4316
4595
  description: |-
4317
- ResetActivity resets the execution of an activity specified by its ID or type.
4318
- If there are multiple pending activities of the provided type - all of them will be reset.
4319
-
4320
- Resetting an activity means:
4321
- * number of attempts will be reset to 0.
4322
- * activity timeouts will be reset.
4323
- * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:
4324
- it will be scheduled immediately (* see 'jitter' flag),
4325
-
4326
- Flags:
4327
-
4328
- 'jitter': the activity will be scheduled at a random time within the jitter duration.
4329
- If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.
4330
- 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.
4331
- 'keep_paused': if the activity is paused, it will remain paused.
4596
+ See `RespondActivityTaskCompleted`. This version allows clients to record completions by
4597
+ namespace/workflow id/activity id instead of task token.
4332
4598
 
4333
- Returns a `NotFound` error if there is no pending activity with the provided ID or type.
4334
- This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and
4335
- structured to work well for standalone activities.
4336
- operationId: ResetActivity
4599
+ (-- api-linter: core::0136::prepositions=disabled
4600
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
4601
+ operationId: RespondActivityTaskCompletedById
4337
4602
  parameters:
4338
4603
  - name: namespace
4339
4604
  in: path
4340
- description: Namespace of the workflow which scheduled this activity.
4605
+ description: Namespace of the workflow which scheduled this activity
4606
+ required: true
4607
+ schema:
4608
+ type: string
4609
+ - name: activityId
4610
+ in: path
4611
+ description: Id of the activity to complete
4341
4612
  required: true
4342
4613
  schema:
4343
4614
  type: string
@@ -4345,7 +4616,7 @@ paths:
4345
4616
  content:
4346
4617
  application/json:
4347
4618
  schema:
4348
- $ref: '#/components/schemas/ResetActivityRequest'
4619
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
4349
4620
  required: true
4350
4621
  responses:
4351
4622
  "200":
@@ -4353,38 +4624,34 @@ paths:
4353
4624
  content:
4354
4625
  application/json:
4355
4626
  schema:
4356
- $ref: '#/components/schemas/ResetActivityResponse'
4627
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
4357
4628
  default:
4358
4629
  description: Default error response
4359
4630
  content:
4360
4631
  application/json:
4361
4632
  schema:
4362
4633
  $ref: '#/components/schemas/Status'
4363
- /namespaces/{namespace}/activities/unpause:
4634
+ /namespaces/{namespace}/activities/{activityId}/fail:
4364
4635
  post:
4365
4636
  tags:
4366
4637
  - WorkflowService
4367
4638
  description: |-
4368
- UnpauseActivity unpauses the execution of an activity specified by its ID or type.
4369
- If there are multiple pending activities of the provided type - all of them will be unpaused.
4370
-
4371
- If activity is not paused, this call will have no effect.
4372
- If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).
4373
- Once the activity is unpaused, all timeout timers will be regenerated.
4374
-
4375
- Flags:
4376
- 'jitter': the activity will be scheduled at a random time within the jitter duration.
4377
- 'reset_attempts': the number of attempts will be reset.
4378
- 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.
4639
+ See `RecordActivityTaskFailed`. This version allows clients to record failures by
4640
+ namespace/workflow id/activity id instead of task token.
4379
4641
 
4380
- Returns a `NotFound` error if there is no pending activity with the provided ID or type
4381
- This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and
4382
- structured to work well for standalone activities.
4383
- operationId: UnpauseActivity
4642
+ (-- api-linter: core::0136::prepositions=disabled
4643
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
4644
+ operationId: RespondActivityTaskFailedById
4384
4645
  parameters:
4385
4646
  - name: namespace
4386
4647
  in: path
4387
- description: Namespace of the workflow which scheduled this activity.
4648
+ description: Namespace of the workflow which scheduled this activity
4649
+ required: true
4650
+ schema:
4651
+ type: string
4652
+ - name: activityId
4653
+ in: path
4654
+ description: Id of the activity to fail
4388
4655
  required: true
4389
4656
  schema:
4390
4657
  type: string
@@ -4392,7 +4659,7 @@ paths:
4392
4659
  content:
4393
4660
  application/json:
4394
4661
  schema:
4395
- $ref: '#/components/schemas/UnpauseActivityRequest'
4662
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
4396
4663
  required: true
4397
4664
  responses:
4398
4665
  "200":
@@ -4400,23 +4667,24 @@ paths:
4400
4667
  content:
4401
4668
  application/json:
4402
4669
  schema:
4403
- $ref: '#/components/schemas/UnpauseActivityResponse'
4670
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
4404
4671
  default:
4405
4672
  description: Default error response
4406
4673
  content:
4407
4674
  application/json:
4408
4675
  schema:
4409
4676
  $ref: '#/components/schemas/Status'
4410
- /namespaces/{namespace}/activities/update-options:
4677
+ /namespaces/{namespace}/activities/{activityId}/heartbeat:
4411
4678
  post:
4412
4679
  tags:
4413
4680
  - WorkflowService
4414
4681
  description: |-
4415
- UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.
4416
- If there are multiple pending activities of the provided type - all of them will be updated.
4417
- This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and
4418
- structured to work well for standalone activities.
4419
- operationId: UpdateActivityOptions
4682
+ See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
4683
+ namespace/workflow id/activity id instead of task token.
4684
+
4685
+ (-- api-linter: core::0136::prepositions=disabled
4686
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
4687
+ operationId: RecordActivityTaskHeartbeatById
4420
4688
  parameters:
4421
4689
  - name: namespace
4422
4690
  in: path
@@ -4424,11 +4692,17 @@ paths:
4424
4692
  required: true
4425
4693
  schema:
4426
4694
  type: string
4695
+ - name: activityId
4696
+ in: path
4697
+ description: Id of the activity we're heartbeating
4698
+ required: true
4699
+ schema:
4700
+ type: string
4427
4701
  requestBody:
4428
4702
  content:
4429
4703
  application/json:
4430
4704
  schema:
4431
- $ref: '#/components/schemas/UpdateActivityOptionsRequest'
4705
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
4432
4706
  required: true
4433
4707
  responses:
4434
4708
  "200":
@@ -4436,24 +4710,21 @@ paths:
4436
4710
  content:
4437
4711
  application/json:
4438
4712
  schema:
4439
- $ref: '#/components/schemas/UpdateActivityOptionsResponse'
4713
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
4440
4714
  default:
4441
4715
  description: Default error response
4442
4716
  content:
4443
4717
  application/json:
4444
4718
  schema:
4445
4719
  $ref: '#/components/schemas/Status'
4446
- /namespaces/{namespace}/activities/{activityId}:
4720
+ /namespaces/{namespace}/activities/{activityId}/outcome:
4447
4721
  get:
4448
4722
  tags:
4449
4723
  - WorkflowService
4450
4724
  description: |-
4451
- DescribeActivityExecution returns information about an activity execution.
4452
- It can be used to:
4453
- - Get current activity info without waiting
4454
- - Long-poll for next state change and return new activity info
4455
- Response can optionally include activity input or outcome (if the activity has completed).
4456
- operationId: DescribeActivityExecution
4725
+ PollActivityExecution long-polls for an activity execution to complete and returns the
4726
+ outcome (result or failure).
4727
+ operationId: PollActivityExecution
4457
4728
  parameters:
4458
4729
  - name: namespace
4459
4730
  in: path
@@ -4470,62 +4741,40 @@ paths:
4470
4741
  description: Activity run ID. If empty the request targets the latest run.
4471
4742
  schema:
4472
4743
  type: string
4473
- - name: includeInput
4474
- in: query
4475
- description: Include the input field in the response.
4476
- schema:
4477
- type: boolean
4478
- - name: includeOutcome
4479
- in: query
4480
- description: Include the outcome (result/failure) in the response if the activity has completed.
4481
- schema:
4482
- type: boolean
4483
- - name: longPollToken
4484
- in: query
4485
- description: |-
4486
- Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity
4487
- state changes from the state encoded in this token. If absent, return current state immediately.
4488
- If present, run_id must also be present.
4489
- Note that activity state may change multiple times between requests, therefore it is not
4490
- guaranteed that a client making a sequence of long-poll requests will see a complete
4491
- sequence of state changes.
4492
- schema:
4493
- type: string
4494
- format: bytes
4495
4744
  responses:
4496
4745
  "200":
4497
4746
  description: OK
4498
4747
  content:
4499
4748
  application/json:
4500
4749
  schema:
4501
- $ref: '#/components/schemas/DescribeActivityExecutionResponse'
4750
+ $ref: '#/components/schemas/PollActivityExecutionResponse'
4502
4751
  default:
4503
4752
  description: Default error response
4504
4753
  content:
4505
4754
  application/json:
4506
4755
  schema:
4507
4756
  $ref: '#/components/schemas/Status'
4757
+ /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled:
4508
4758
  post:
4509
4759
  tags:
4510
4760
  - WorkflowService
4511
4761
  description: |-
4512
- StartActivityExecution starts a new activity execution.
4762
+ See `RespondActivityTaskCanceled`. This version allows clients to record failures by
4763
+ namespace/workflow id/activity id instead of task token.
4513
4764
 
4514
- Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace
4515
- unless permitted by the specified ID conflict policy.
4516
- operationId: StartActivityExecution
4765
+ (-- api-linter: core::0136::prepositions=disabled
4766
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
4767
+ operationId: RespondActivityTaskCanceledById
4517
4768
  parameters:
4518
4769
  - name: namespace
4519
4770
  in: path
4771
+ description: Namespace of the workflow which scheduled this activity
4520
4772
  required: true
4521
4773
  schema:
4522
4774
  type: string
4523
4775
  - name: activityId
4524
4776
  in: path
4525
- description: |-
4526
- Identifier for this activity. Required. This identifier should be meaningful in the user's
4527
- own system. It must be unique among activities in the same namespace, subject to the rules
4528
- imposed by id_reuse_policy and id_conflict_policy.
4777
+ description: Id of the activity to confirm is cancelled
4529
4778
  required: true
4530
4779
  schema:
4531
4780
  type: string
@@ -4533,7 +4782,7 @@ paths:
4533
4782
  content:
4534
4783
  application/json:
4535
4784
  schema:
4536
- $ref: '#/components/schemas/StartActivityExecutionRequest'
4785
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
4537
4786
  required: true
4538
4787
  responses:
4539
4788
  "200":
@@ -4541,25 +4790,23 @@ paths:
4541
4790
  content:
4542
4791
  application/json:
4543
4792
  schema:
4544
- $ref: '#/components/schemas/StartActivityExecutionResponse'
4793
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
4545
4794
  default:
4546
4795
  description: Default error response
4547
4796
  content:
4548
4797
  application/json:
4549
4798
  schema:
4550
4799
  $ref: '#/components/schemas/Status'
4551
- /namespaces/{namespace}/activities/{activityId}/cancel:
4800
+ /namespaces/{namespace}/activities/{activityId}/terminate:
4552
4801
  post:
4553
4802
  tags:
4554
4803
  - WorkflowService
4555
4804
  description: |-
4556
- RequestCancelActivityExecution requests cancellation of an activity execution.
4805
+ TerminateActivityExecution terminates an existing activity execution immediately.
4557
4806
 
4558
- Cancellation is cooperative: this call records the request, but the activity must detect and
4559
- acknowledge it for the activity to reach CANCELED status. The cancellation signal is
4560
- delivered via `cancel_requested` in the heartbeat response; SDKs surface this via
4561
- language-idiomatic mechanisms (context cancellation, exceptions, abort signals).
4562
- operationId: RequestCancelActivityExecution
4807
+ Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a
4808
+ running attempt.
4809
+ operationId: TerminateActivityExecution
4563
4810
  parameters:
4564
4811
  - name: namespace
4565
4812
  in: path
@@ -4575,7 +4822,7 @@ paths:
4575
4822
  content:
4576
4823
  application/json:
4577
4824
  schema:
4578
- $ref: '#/components/schemas/RequestCancelActivityExecutionRequest'
4825
+ $ref: '#/components/schemas/TerminateActivityExecutionRequest'
4579
4826
  required: true
4580
4827
  responses:
4581
4828
  "200":
@@ -4583,35 +4830,65 @@ paths:
4583
4830
  content:
4584
4831
  application/json:
4585
4832
  schema:
4586
- $ref: '#/components/schemas/RequestCancelActivityExecutionResponse'
4833
+ $ref: '#/components/schemas/TerminateActivityExecutionResponse'
4587
4834
  default:
4588
4835
  description: Default error response
4589
4836
  content:
4590
4837
  application/json:
4591
4838
  schema:
4592
4839
  $ref: '#/components/schemas/Status'
4593
- /namespaces/{namespace}/activities/{activityId}/outcome:
4594
- get:
4840
+ /namespaces/{namespace}/activity-complete:
4841
+ post:
4595
4842
  tags:
4596
4843
  - WorkflowService
4597
4844
  description: |-
4598
- PollActivityExecution long-polls for an activity execution to complete and returns the
4599
- outcome (result or failure).
4600
- operationId: PollActivityExecution
4845
+ RespondActivityTaskCompleted is called by workers when they successfully complete an activity
4846
+ task.
4847
+
4848
+ For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history
4849
+ and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
4850
+ no longer valid due to activity timeout, already being completed, or never having existed.
4851
+ operationId: RespondActivityTaskCompleted
4601
4852
  parameters:
4602
4853
  - name: namespace
4603
4854
  in: path
4604
4855
  required: true
4605
4856
  schema:
4606
4857
  type: string
4607
- - name: activityId
4858
+ requestBody:
4859
+ content:
4860
+ application/json:
4861
+ schema:
4862
+ $ref: '#/components/schemas/RespondActivityTaskCompletedRequest'
4863
+ required: true
4864
+ responses:
4865
+ "200":
4866
+ description: OK
4867
+ content:
4868
+ application/json:
4869
+ schema:
4870
+ $ref: '#/components/schemas/RespondActivityTaskCompletedResponse'
4871
+ default:
4872
+ description: Default error response
4873
+ content:
4874
+ application/json:
4875
+ schema:
4876
+ $ref: '#/components/schemas/Status'
4877
+ /namespaces/{namespace}/activity-count:
4878
+ get:
4879
+ tags:
4880
+ - WorkflowService
4881
+ description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace.
4882
+ operationId: CountActivityExecutions
4883
+ parameters:
4884
+ - name: namespace
4608
4885
  in: path
4609
4886
  required: true
4610
4887
  schema:
4611
4888
  type: string
4612
- - name: runId
4889
+ - name: query
4613
4890
  in: query
4614
- description: Activity run ID. If empty the request targets the latest run.
4891
+ description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
4615
4892
  schema:
4616
4893
  type: string
4617
4894
  responses:
@@ -4620,30 +4897,70 @@ paths:
4620
4897
  content:
4621
4898
  application/json:
4622
4899
  schema:
4623
- $ref: '#/components/schemas/PollActivityExecutionResponse'
4900
+ $ref: '#/components/schemas/CountActivityExecutionsResponse'
4624
4901
  default:
4625
4902
  description: Default error response
4626
4903
  content:
4627
4904
  application/json:
4628
4905
  schema:
4629
4906
  $ref: '#/components/schemas/Status'
4630
- /namespaces/{namespace}/activities/{activityId}/terminate:
4907
+ /namespaces/{namespace}/activity-fail:
4631
4908
  post:
4632
4909
  tags:
4633
4910
  - WorkflowService
4634
4911
  description: |-
4635
- TerminateActivityExecution terminates an existing activity execution immediately.
4912
+ RespondActivityTaskFailed is called by workers when processing an activity task fails.
4636
4913
 
4637
- Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a
4638
- running attempt.
4639
- operationId: TerminateActivityExecution
4914
+ This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and
4915
+ a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
4916
+ longer valid due to activity timeout, already being completed, or never having existed.
4917
+ operationId: RespondActivityTaskFailed
4640
4918
  parameters:
4641
4919
  - name: namespace
4642
4920
  in: path
4643
4921
  required: true
4644
4922
  schema:
4645
4923
  type: string
4646
- - name: activityId
4924
+ requestBody:
4925
+ content:
4926
+ application/json:
4927
+ schema:
4928
+ $ref: '#/components/schemas/RespondActivityTaskFailedRequest'
4929
+ required: true
4930
+ responses:
4931
+ "200":
4932
+ description: OK
4933
+ content:
4934
+ application/json:
4935
+ schema:
4936
+ $ref: '#/components/schemas/RespondActivityTaskFailedResponse'
4937
+ default:
4938
+ description: Default error response
4939
+ content:
4940
+ application/json:
4941
+ schema:
4942
+ $ref: '#/components/schemas/Status'
4943
+ /namespaces/{namespace}/activity-heartbeat:
4944
+ post:
4945
+ tags:
4946
+ - WorkflowService
4947
+ description: |-
4948
+ RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.
4949
+
4950
+ If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,
4951
+ then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or
4952
+ time out the activity.
4953
+
4954
+ For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow
4955
+ history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,
4956
+ in that event, the SDK should request cancellation of the activity.
4957
+
4958
+ The request may contain response `details` which will be persisted by the server and may be
4959
+ used by the activity to checkpoint progress. The `cancel_requested` field in the response
4960
+ indicates whether cancellation has been requested for the activity.
4961
+ operationId: RecordActivityTaskHeartbeat
4962
+ parameters:
4963
+ - name: namespace
4647
4964
  in: path
4648
4965
  required: true
4649
4966
  schema:
@@ -4652,7 +4969,7 @@ paths:
4652
4969
  content:
4653
4970
  application/json:
4654
4971
  schema:
4655
- $ref: '#/components/schemas/TerminateActivityExecutionRequest'
4972
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest'
4656
4973
  required: true
4657
4974
  responses:
4658
4975
  "200":
@@ -4660,37 +4977,43 @@ paths:
4660
4977
  content:
4661
4978
  application/json:
4662
4979
  schema:
4663
- $ref: '#/components/schemas/TerminateActivityExecutionResponse'
4980
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse'
4664
4981
  default:
4665
4982
  description: Default error response
4666
4983
  content:
4667
4984
  application/json:
4668
4985
  schema:
4669
4986
  $ref: '#/components/schemas/Status'
4670
- /namespaces/{namespace}/activity-count:
4671
- get:
4987
+ /namespaces/{namespace}/activity-resolve-as-canceled:
4988
+ post:
4672
4989
  tags:
4673
4990
  - WorkflowService
4674
- description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace.
4675
- operationId: CountActivityExecutions
4991
+ description: |-
4992
+ RespondActivityTaskFailed is called by workers when processing an activity task fails.
4993
+
4994
+ For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history
4995
+ and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
4996
+ no longer valid due to activity timeout, already being completed, or never having existed.
4997
+ operationId: RespondActivityTaskCanceled
4676
4998
  parameters:
4677
4999
  - name: namespace
4678
5000
  in: path
4679
5001
  required: true
4680
5002
  schema:
4681
5003
  type: string
4682
- - name: query
4683
- in: query
4684
- description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
4685
- schema:
4686
- type: string
5004
+ requestBody:
5005
+ content:
5006
+ application/json:
5007
+ schema:
5008
+ $ref: '#/components/schemas/RespondActivityTaskCanceledRequest'
5009
+ required: true
4687
5010
  responses:
4688
5011
  "200":
4689
5012
  description: OK
4690
5013
  content:
4691
5014
  application/json:
4692
5015
  schema:
4693
- $ref: '#/components/schemas/CountActivityExecutionsResponse'
5016
+ $ref: '#/components/schemas/RespondActivityTaskCanceledResponse'
4694
5017
  default:
4695
5018
  description: Default error response
4696
5019
  content:
@@ -5113,6 +5436,36 @@ paths:
5113
5436
  application/json:
5114
5437
  schema:
5115
5438
  $ref: '#/components/schemas/Status'
5439
+ /namespaces/{namespace}/schedule-count:
5440
+ get:
5441
+ tags:
5442
+ - WorkflowService
5443
+ description: CountSchedules is a visibility API to count schedules in a specific namespace.
5444
+ operationId: CountSchedules
5445
+ parameters:
5446
+ - name: namespace
5447
+ in: path
5448
+ required: true
5449
+ schema:
5450
+ type: string
5451
+ - name: query
5452
+ in: query
5453
+ description: Visibility query, see https://docs.temporal.io/list-filter for the syntax.
5454
+ schema:
5455
+ type: string
5456
+ responses:
5457
+ "200":
5458
+ description: OK
5459
+ content:
5460
+ application/json:
5461
+ schema:
5462
+ $ref: '#/components/schemas/CountSchedulesResponse'
5463
+ default:
5464
+ description: Default error response
5465
+ content:
5466
+ application/json:
5467
+ schema:
5468
+ $ref: '#/components/schemas/Status'
5116
5469
  /namespaces/{namespace}/schedules:
5117
5470
  get:
5118
5471
  tags:
@@ -6476,63 +6829,23 @@ paths:
6476
6829
  in: query
6477
6830
  schema:
6478
6831
  type: integer
6479
- format: int32
6480
- - name: nextPageToken
6481
- in: query
6482
- schema:
6483
- type: string
6484
- format: bytes
6485
- - name: query
6486
- in: query
6487
- schema:
6488
- type: string
6489
- responses:
6490
- "200":
6491
- description: OK
6492
- content:
6493
- application/json:
6494
- schema:
6495
- $ref: '#/components/schemas/ListWorkflowExecutionsResponse'
6496
- default:
6497
- description: Default error response
6498
- content:
6499
- application/json:
6500
- schema:
6501
- $ref: '#/components/schemas/Status'
6502
- /namespaces/{namespace}/workflows/execute-multi-operation:
6503
- post:
6504
- tags:
6505
- - WorkflowService
6506
- description: |-
6507
- ExecuteMultiOperation executes multiple operations within a single workflow.
6508
-
6509
- Operations are started atomically, meaning if *any* operation fails to be started, none are,
6510
- and the request fails. Upon start, the API returns only when *all* operations have a response.
6511
-
6512
- Upon failure, it returns `MultiOperationExecutionFailure` where the status code
6513
- equals the status code of the *first* operation that failed to be started.
6514
-
6515
- NOTE: Experimental API.
6516
- operationId: ExecuteMultiOperation
6517
- parameters:
6518
- - name: namespace
6519
- in: path
6520
- required: true
6832
+ format: int32
6833
+ - name: nextPageToken
6834
+ in: query
6835
+ schema:
6836
+ type: string
6837
+ format: bytes
6838
+ - name: query
6839
+ in: query
6521
6840
  schema:
6522
6841
  type: string
6523
- requestBody:
6524
- content:
6525
- application/json:
6526
- schema:
6527
- $ref: '#/components/schemas/ExecuteMultiOperationRequest'
6528
- required: true
6529
6842
  responses:
6530
6843
  "200":
6531
6844
  description: OK
6532
6845
  content:
6533
6846
  application/json:
6534
6847
  schema:
6535
- $ref: '#/components/schemas/ExecuteMultiOperationResponse'
6848
+ $ref: '#/components/schemas/ListWorkflowExecutionsResponse'
6536
6849
  default:
6537
6850
  description: Default error response
6538
6851
  content:
@@ -6826,6 +7139,202 @@ paths:
6826
7139
  application/json:
6827
7140
  schema:
6828
7141
  $ref: '#/components/schemas/Status'
7142
+ /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete:
7143
+ post:
7144
+ tags:
7145
+ - WorkflowService
7146
+ description: |-
7147
+ See `RespondActivityTaskCompleted`. This version allows clients to record completions by
7148
+ namespace/workflow id/activity id instead of task token.
7149
+
7150
+ (-- api-linter: core::0136::prepositions=disabled
7151
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
7152
+ operationId: RespondActivityTaskCompletedById
7153
+ parameters:
7154
+ - name: namespace
7155
+ in: path
7156
+ description: Namespace of the workflow which scheduled this activity
7157
+ required: true
7158
+ schema:
7159
+ type: string
7160
+ - name: workflowId
7161
+ in: path
7162
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
7163
+ required: true
7164
+ schema:
7165
+ type: string
7166
+ - name: activityId
7167
+ in: path
7168
+ description: Id of the activity to complete
7169
+ required: true
7170
+ schema:
7171
+ type: string
7172
+ requestBody:
7173
+ content:
7174
+ application/json:
7175
+ schema:
7176
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest'
7177
+ required: true
7178
+ responses:
7179
+ "200":
7180
+ description: OK
7181
+ content:
7182
+ application/json:
7183
+ schema:
7184
+ $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse'
7185
+ default:
7186
+ description: Default error response
7187
+ content:
7188
+ application/json:
7189
+ schema:
7190
+ $ref: '#/components/schemas/Status'
7191
+ /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail:
7192
+ post:
7193
+ tags:
7194
+ - WorkflowService
7195
+ description: |-
7196
+ See `RecordActivityTaskFailed`. This version allows clients to record failures by
7197
+ namespace/workflow id/activity id instead of task token.
7198
+
7199
+ (-- api-linter: core::0136::prepositions=disabled
7200
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
7201
+ operationId: RespondActivityTaskFailedById
7202
+ parameters:
7203
+ - name: namespace
7204
+ in: path
7205
+ description: Namespace of the workflow which scheduled this activity
7206
+ required: true
7207
+ schema:
7208
+ type: string
7209
+ - name: workflowId
7210
+ in: path
7211
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
7212
+ required: true
7213
+ schema:
7214
+ type: string
7215
+ - name: activityId
7216
+ in: path
7217
+ description: Id of the activity to fail
7218
+ required: true
7219
+ schema:
7220
+ type: string
7221
+ requestBody:
7222
+ content:
7223
+ application/json:
7224
+ schema:
7225
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest'
7226
+ required: true
7227
+ responses:
7228
+ "200":
7229
+ description: OK
7230
+ content:
7231
+ application/json:
7232
+ schema:
7233
+ $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse'
7234
+ default:
7235
+ description: Default error response
7236
+ content:
7237
+ application/json:
7238
+ schema:
7239
+ $ref: '#/components/schemas/Status'
7240
+ /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat:
7241
+ post:
7242
+ tags:
7243
+ - WorkflowService
7244
+ description: |-
7245
+ See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
7246
+ namespace/workflow id/activity id instead of task token.
7247
+
7248
+ (-- api-linter: core::0136::prepositions=disabled
7249
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
7250
+ operationId: RecordActivityTaskHeartbeatById
7251
+ parameters:
7252
+ - name: namespace
7253
+ in: path
7254
+ description: Namespace of the workflow which scheduled this activity
7255
+ required: true
7256
+ schema:
7257
+ type: string
7258
+ - name: workflowId
7259
+ in: path
7260
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
7261
+ required: true
7262
+ schema:
7263
+ type: string
7264
+ - name: activityId
7265
+ in: path
7266
+ description: Id of the activity we're heartbeating
7267
+ required: true
7268
+ schema:
7269
+ type: string
7270
+ requestBody:
7271
+ content:
7272
+ application/json:
7273
+ schema:
7274
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest'
7275
+ required: true
7276
+ responses:
7277
+ "200":
7278
+ description: OK
7279
+ content:
7280
+ application/json:
7281
+ schema:
7282
+ $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse'
7283
+ default:
7284
+ description: Default error response
7285
+ content:
7286
+ application/json:
7287
+ schema:
7288
+ $ref: '#/components/schemas/Status'
7289
+ /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled:
7290
+ post:
7291
+ tags:
7292
+ - WorkflowService
7293
+ description: |-
7294
+ See `RespondActivityTaskCanceled`. This version allows clients to record failures by
7295
+ namespace/workflow id/activity id instead of task token.
7296
+
7297
+ (-- api-linter: core::0136::prepositions=disabled
7298
+ aip.dev/not-precedent: "By" is used to indicate request type. --)
7299
+ operationId: RespondActivityTaskCanceledById
7300
+ parameters:
7301
+ - name: namespace
7302
+ in: path
7303
+ description: Namespace of the workflow which scheduled this activity
7304
+ required: true
7305
+ schema:
7306
+ type: string
7307
+ - name: workflowId
7308
+ in: path
7309
+ description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity
7310
+ required: true
7311
+ schema:
7312
+ type: string
7313
+ - name: activityId
7314
+ in: path
7315
+ description: Id of the activity to confirm is cancelled
7316
+ required: true
7317
+ schema:
7318
+ type: string
7319
+ requestBody:
7320
+ content:
7321
+ application/json:
7322
+ schema:
7323
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest'
7324
+ required: true
7325
+ responses:
7326
+ "200":
7327
+ description: OK
7328
+ content:
7329
+ application/json:
7330
+ schema:
7331
+ $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse'
7332
+ default:
7333
+ description: Default error response
7334
+ content:
7335
+ application/json:
7336
+ schema:
7337
+ $ref: '#/components/schemas/Status'
6829
7338
  /namespaces/{namespace}/workflows/{workflowId}/pause:
6830
7339
  post:
6831
7340
  tags:
@@ -8568,6 +9077,33 @@ components:
8568
9077
  $ref: '#/components/schemas/Payload'
8569
9078
  count:
8570
9079
  type: string
9080
+ CountSchedulesResponse:
9081
+ type: object
9082
+ properties:
9083
+ count:
9084
+ type: string
9085
+ description: |-
9086
+ If `query` is not grouping by any field, the count is an approximate number
9087
+ of schedules that match the query.
9088
+ If `query` is grouping by a field, the count is simply the sum of the counts
9089
+ of the groups returned in the response. This number can be smaller than the
9090
+ total number of schedules matching the query.
9091
+ groups:
9092
+ type: array
9093
+ items:
9094
+ $ref: '#/components/schemas/CountSchedulesResponse_AggregationGroup'
9095
+ description: |-
9096
+ Contains the groups if the request is grouping by a field.
9097
+ The list might not be complete, and the counts of each group is approximate.
9098
+ CountSchedulesResponse_AggregationGroup:
9099
+ type: object
9100
+ properties:
9101
+ groupValues:
9102
+ type: array
9103
+ items:
9104
+ $ref: '#/components/schemas/Payload'
9105
+ count:
9106
+ type: string
8571
9107
  CountWorkflowExecutionsResponse:
8572
9108
  type: object
8573
9109
  properties:
@@ -9196,63 +9732,6 @@ components:
9196
9732
  type: string
9197
9733
  description: Nexus task queue to route requests to.
9198
9734
  description: Target a worker polling on a Nexus task queue in a specific namespace.
9199
- ExecuteMultiOperationRequest:
9200
- type: object
9201
- properties:
9202
- namespace:
9203
- type: string
9204
- operations:
9205
- type: array
9206
- items:
9207
- $ref: '#/components/schemas/ExecuteMultiOperationRequest_Operation'
9208
- description: |-
9209
- List of operations to execute within a single workflow.
9210
-
9211
- Preconditions:
9212
- - The list of operations must not be empty.
9213
- - The workflow ids must match across operations.
9214
- - The only valid list of operations at this time is [StartWorkflow, UpdateWorkflow], in this order.
9215
-
9216
- Note that additional operation-specific restrictions have to be considered.
9217
- ExecuteMultiOperationRequest_Operation:
9218
- type: object
9219
- properties:
9220
- startWorkflow:
9221
- allOf:
9222
- - $ref: '#/components/schemas/StartWorkflowExecutionRequest'
9223
- description: |-
9224
- Additional restrictions:
9225
- - setting `cron_schedule` is invalid
9226
- - setting `request_eager_execution` is invalid
9227
- - setting `workflow_start_delay` is invalid
9228
- updateWorkflow:
9229
- allOf:
9230
- - $ref: '#/components/schemas/UpdateWorkflowExecutionRequest'
9231
- description: |-
9232
- Additional restrictions:
9233
- - setting `first_execution_run_id` is invalid
9234
- - setting `workflow_execution.run_id` is invalid
9235
- ExecuteMultiOperationResponse:
9236
- type: object
9237
- properties:
9238
- responses:
9239
- type: array
9240
- items:
9241
- $ref: '#/components/schemas/ExecuteMultiOperationResponse_Response'
9242
- description: |-
9243
- IMPORTANT: For [StartWorkflow, UpdateWorkflow] combination ("Update-with-Start") when both
9244
- 1. the workflow update for the requested update ID has already completed, and
9245
- 2. the workflow for the requested workflow ID has already been closed,
9246
- then you'll receive
9247
- - an update response containing the update's outcome, and
9248
- - a start response with a `status` field that reflects the workflow's current state.
9249
- ExecuteMultiOperationResponse_Response:
9250
- type: object
9251
- properties:
9252
- startWorkflow:
9253
- $ref: '#/components/schemas/StartWorkflowExecutionResponse'
9254
- updateWorkflow:
9255
- $ref: '#/components/schemas/UpdateWorkflowExecutionResponse'
9256
9735
  ExternalWorkflowExecutionCancelRequestedEventAttributes:
9257
9736
  type: object
9258
9737
  properties:
@@ -10265,6 +10744,14 @@ components:
10265
10744
  standaloneActivities:
10266
10745
  type: boolean
10267
10746
  description: True if the namespace supports standalone activities
10747
+ workerPollCompleteOnShutdown:
10748
+ type: boolean
10749
+ description: |-
10750
+ True if the namespace supports server-side completion of outstanding worker polls on shutdown.
10751
+ When enabled, the server will complete polls for workers that send WorkerInstanceKey in their
10752
+ poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return
10753
+ an empty response. When this flag is true, workers should allow polls to return gracefully
10754
+ rather than terminating any open polls on shutdown.
10268
10755
  description: Namespace capability details. Should contain what features are enabled in a namespace.
10269
10756
  NamespaceInfo_Limits:
10270
10757
  type: object
@@ -10529,6 +11016,7 @@ components:
10529
11016
  operationToken:
10530
11017
  type: string
10531
11018
  description: Operation token - may be empty if the operation completed synchronously.
11019
+ description: Representation of the Temporal SDK NexusOperationError object that is returned to workflow callers.
10532
11020
  NexusOperationScheduledEventAttributes:
10533
11021
  type: object
10534
11022
  properties:
@@ -14796,7 +15284,7 @@ components:
14796
15284
  properties:
14797
15285
  deploymentName:
14798
15286
  type: string
14799
- description: Required. Worker Deployment name.
15287
+ description: Required when `worker_versioning_mode==VERSIONED`.
14800
15288
  buildId:
14801
15289
  type: string
14802
15290
  description: |-
@@ -16571,12 +17059,17 @@ components:
16571
17059
  - SUGGEST_CONTINUE_AS_NEW_REASON_HISTORY_SIZE_TOO_LARGE
16572
17060
  - SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_HISTORY_EVENTS
16573
17061
  - SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_UPDATES
16574
- - SUGGEST_CONTINUE_AS_NEW_REASON_TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED
16575
17062
  type: string
16576
17063
  format: enum
16577
17064
  description: |-
16578
17065
  The reason(s) that suggest_continue_as_new is true, if it is.
16579
17066
  Unset if suggest_continue_as_new is false.
17067
+ targetWorkerDeploymentVersionChanged:
17068
+ type: boolean
17069
+ description: |-
17070
+ True if Workflow's Target Worker Deployment Version is different from its Pinned Version and
17071
+ the workflow is Pinned.
17072
+ Experimental.
16580
17073
  historySizeBytes:
16581
17074
  type: string
16582
17075
  description: |-