@temporalio/core-bridge 1.8.5 → 1.9.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/Cargo.lock +189 -152
  2. package/Cargo.toml +1 -0
  3. package/lib/index.d.ts +17 -44
  4. package/lib/index.js.map +1 -1
  5. package/package.json +3 -4
  6. package/releases/aarch64-apple-darwin/index.node +0 -0
  7. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  8. package/releases/x86_64-apple-darwin/index.node +0 -0
  9. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  10. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  11. package/sdk-core/.github/workflows/heavy.yml +4 -0
  12. package/sdk-core/.github/workflows/per-pr.yml +96 -0
  13. package/sdk-core/ARCHITECTURE.md +1 -1
  14. package/sdk-core/Cargo.toml +6 -0
  15. package/sdk-core/README.md +37 -21
  16. package/sdk-core/client/Cargo.toml +6 -3
  17. package/sdk-core/client/src/lib.rs +272 -138
  18. package/sdk-core/client/src/metrics.rs +68 -57
  19. package/sdk-core/client/src/raw.rs +191 -45
  20. package/sdk-core/client/src/retry.rs +20 -0
  21. package/sdk-core/client/src/worker_registry/mod.rs +264 -0
  22. package/sdk-core/client/src/workflow_handle/mod.rs +2 -1
  23. package/sdk-core/core/Cargo.toml +16 -18
  24. package/sdk-core/core/src/core_tests/child_workflows.rs +7 -7
  25. package/sdk-core/core/src/core_tests/mod.rs +1 -0
  26. package/sdk-core/core/src/core_tests/replay_flag.rs +29 -39
  27. package/sdk-core/core/src/core_tests/updates.rs +73 -0
  28. package/sdk-core/core/src/core_tests/workflow_tasks.rs +52 -1
  29. package/sdk-core/core/src/ephemeral_server/mod.rs +34 -11
  30. package/sdk-core/core/src/internal_flags.rs +7 -1
  31. package/sdk-core/core/src/lib.rs +19 -36
  32. package/sdk-core/core/src/protosext/mod.rs +11 -3
  33. package/sdk-core/core/src/protosext/protocol_messages.rs +102 -0
  34. package/sdk-core/core/src/replay/mod.rs +100 -48
  35. package/sdk-core/core/src/telemetry/log_export.rs +161 -28
  36. package/sdk-core/core/src/telemetry/metrics.rs +869 -248
  37. package/sdk-core/core/src/telemetry/mod.rs +135 -239
  38. package/sdk-core/core/src/telemetry/prometheus_server.rs +36 -31
  39. package/sdk-core/core/src/test_help/mod.rs +63 -4
  40. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +12 -2
  41. package/sdk-core/core/src/worker/activities.rs +276 -10
  42. package/sdk-core/core/src/worker/client/mocks.rs +18 -0
  43. package/sdk-core/core/src/worker/client.rs +16 -3
  44. package/sdk-core/core/src/worker/mod.rs +50 -19
  45. package/sdk-core/core/src/worker/slot_provider.rs +175 -0
  46. package/sdk-core/core/src/worker/workflow/driven_workflow.rs +27 -34
  47. package/sdk-core/core/src/worker/workflow/history_update.rs +4 -1
  48. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +36 -94
  49. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +34 -22
  50. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +50 -34
  51. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +106 -92
  52. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +22 -21
  53. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +386 -499
  54. package/sdk-core/core/src/worker/workflow/machines/mod.rs +12 -2
  55. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +33 -26
  56. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +198 -215
  57. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +66 -62
  58. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +88 -119
  59. package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +3 -1
  60. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +411 -0
  61. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +26 -25
  62. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +302 -85
  63. package/sdk-core/core/src/worker/workflow/managed_run.rs +179 -132
  64. package/sdk-core/core/src/worker/workflow/mod.rs +121 -46
  65. package/sdk-core/core/src/worker/workflow/run_cache.rs +8 -12
  66. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +45 -38
  67. package/sdk-core/core-api/Cargo.toml +7 -6
  68. package/sdk-core/core-api/src/lib.rs +4 -12
  69. package/sdk-core/core-api/src/telemetry/metrics.rs +334 -0
  70. package/sdk-core/core-api/src/telemetry.rs +53 -42
  71. package/sdk-core/core-api/src/worker.rs +7 -0
  72. package/sdk-core/{.buildkite/docker → docker}/docker-compose.yaml +1 -1
  73. package/sdk-core/etc/dynamic-config.yaml +11 -1
  74. package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +1 -1
  75. package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +1 -3
  76. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +2 -2
  77. package/sdk-core/sdk/Cargo.toml +1 -1
  78. package/sdk-core/sdk/src/lib.rs +85 -7
  79. package/sdk-core/sdk/src/workflow_context/options.rs +4 -0
  80. package/sdk-core/sdk/src/workflow_context.rs +43 -15
  81. package/sdk-core/sdk/src/workflow_future.rs +334 -204
  82. package/sdk-core/sdk-core-protos/Cargo.toml +2 -2
  83. package/sdk-core/sdk-core-protos/build.rs +14 -14
  84. package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/Dockerfile +2 -0
  85. package/sdk-core/sdk-core-protos/protos/api_upstream/Makefile +99 -0
  86. package/sdk-core/sdk-core-protos/protos/api_upstream/api-linter.yaml +56 -0
  87. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.gen.yaml +20 -0
  88. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.lock +11 -0
  89. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +18 -0
  90. package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/annotations.proto +31 -0
  91. package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/http.proto +379 -0
  92. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/any.proto +162 -0
  93. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/descriptor.proto +1212 -0
  94. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/duration.proto +115 -0
  95. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/empty.proto +51 -0
  96. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/timestamp.proto +144 -0
  97. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/wrappers.proto +123 -0
  98. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/batch/v1/message.proto +3 -5
  99. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/command/v1/message.proto +11 -13
  100. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/common/v1/message.proto +2 -4
  101. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
  102. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/reset.proto +1 -1
  103. package/sdk-core/{protos/api_upstream/build/tools.go → sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto} +22 -6
  104. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/filter/v1/message.proto +2 -4
  105. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/history/v1/message.proto +21 -23
  106. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/namespace/v1/message.proto +2 -4
  107. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/request_response.proto +2 -0
  108. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/service.proto +4 -0
  109. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/replication/v1/message.proto +1 -3
  110. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/schedule/v1/message.proto +36 -20
  111. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +13 -0
  112. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -4
  113. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/update/v1/message.proto +1 -1
  114. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/version/v1/message.proto +2 -3
  115. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflow/v1/message.proto +18 -20
  116. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/request_response.proto +84 -32
  117. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/service.proto +205 -47
  118. package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +57 -0
  119. package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +27 -0
  120. package/sdk-core/sdk-core-protos/src/history_builder.rs +67 -2
  121. package/sdk-core/sdk-core-protos/src/lib.rs +75 -2
  122. package/sdk-core/sdk-core-protos/src/utilities.rs +14 -0
  123. package/sdk-core/test-utils/Cargo.toml +5 -1
  124. package/sdk-core/test-utils/src/canned_histories.rs +3 -57
  125. package/sdk-core/test-utils/src/interceptors.rs +46 -0
  126. package/sdk-core/test-utils/src/lib.rs +106 -38
  127. package/sdk-core/tests/integ_tests/metrics_tests.rs +110 -15
  128. package/sdk-core/tests/integ_tests/queries_tests.rs +174 -3
  129. package/sdk-core/tests/integ_tests/update_tests.rs +908 -0
  130. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +44 -1
  131. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +1 -1
  132. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
  133. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +4 -4
  134. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +61 -0
  135. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +27 -2
  136. package/sdk-core/tests/integ_tests/workflow_tests.rs +1 -0
  137. package/sdk-core/tests/main.rs +2 -1
  138. package/sdk-core/tests/runner.rs +15 -2
  139. package/src/conversions.rs +75 -89
  140. package/src/helpers.rs +74 -0
  141. package/src/runtime.rs +17 -6
  142. package/src/worker.rs +14 -61
  143. package/ts/index.ts +21 -52
  144. package/sdk-core/.buildkite/docker/Dockerfile +0 -9
  145. package/sdk-core/.buildkite/docker/build.sh +0 -5
  146. package/sdk-core/.buildkite/docker/docker-compose-ci.yaml +0 -27
  147. package/sdk-core/.buildkite/pipeline.yml +0 -57
  148. package/sdk-core/.github/workflows/semgrep.yml +0 -25
  149. package/sdk-core/core/src/worker/workflow/bridge.rs +0 -35
  150. package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +0 -215
  151. package/sdk-core/protos/api_upstream/.buildkite/Dockerfile +0 -2
  152. package/sdk-core/protos/api_upstream/Makefile +0 -80
  153. package/sdk-core/protos/api_upstream/api-linter.yaml +0 -40
  154. package/sdk-core/protos/api_upstream/buf.yaml +0 -9
  155. package/sdk-core/protos/api_upstream/build/go.mod +0 -7
  156. package/sdk-core/protos/api_upstream/build/go.sum +0 -5
  157. package/sdk-core/protos/api_upstream/go.mod +0 -6
  158. package/sdk-core/protos/testsrv_upstream/dependencies/gogoproto/gogo.proto +0 -141
  159. /package/sdk-core/{.buildkite/docker → docker}/docker-compose-telem.yaml +0 -0
  160. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/docker-compose.yml +0 -0
  161. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/pipeline.yml +0 -0
  162. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/CODEOWNERS +0 -0
  163. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  164. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/publish-docs.yml +0 -0
  165. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
  166. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/LICENSE +0 -0
  167. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/README.md +0 -0
  168. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
  169. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
  170. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/common.proto +0 -0
  171. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
  172. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
  173. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/query.proto +0 -0
  174. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
  175. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
  176. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/update.proto +0 -0
  177. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
  178. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
  179. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/failure/v1/message.proto +0 -0
  180. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
  181. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/query/v1/message.proto +0 -0
  182. /package/sdk-core/{protos → sdk-core-protos/protos}/google/rpc/status.proto +0 -0
  183. /package/sdk-core/{protos → sdk-core-protos/protos}/grpc/health/v1/health.proto +0 -0
  184. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
  185. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
  186. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
  187. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/common/common.proto +0 -0
  188. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/core_interface.proto +0 -0
  189. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/external_data/external_data.proto +0 -0
  190. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
  191. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/Makefile +0 -0
  192. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/api-linter.yaml +0 -0
  193. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/buf.yaml +0 -0
  194. /package/sdk-core/{protos/api_upstream → sdk-core-protos/protos/testsrv_upstream}/dependencies/gogoproto/gogo.proto +0 -0
  195. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
  196. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
@@ -33,6 +33,7 @@ option csharp_namespace = "Temporalio.Api.WorkflowService.V1";
33
33
 
34
34
 
35
35
  import "temporal/api/workflowservice/v1/request_response.proto";
36
+ import "google/api/annotations.proto";
36
37
 
37
38
  // WorkflowService API defines how Temporal SDKs and other clients interact with the Temporal server
38
39
  // to create and interact with workflows and activities.
@@ -54,24 +55,33 @@ service WorkflowService {
54
55
  // isolation for all resources within the namespace. All resources belongs to exactly one
55
56
  // namespace.
56
57
  rpc RegisterNamespace (RegisterNamespaceRequest) returns (RegisterNamespaceResponse) {
58
+ option (google.api.http) = {
59
+ post: "/api/v1/namespaces"
60
+ body: "*"
61
+ };
57
62
  }
58
63
 
59
64
  // DescribeNamespace returns the information and configuration for a registered namespace.
60
65
  rpc DescribeNamespace (DescribeNamespaceRequest) returns (DescribeNamespaceResponse) {
66
+ option (google.api.http) = {
67
+ get: "/api/v1/namespaces/{namespace}"
68
+ };
61
69
  }
62
70
 
63
71
  // ListNamespaces returns the information and configuration for all namespaces.
64
72
  rpc ListNamespaces (ListNamespacesRequest) returns (ListNamespacesResponse) {
73
+ option (google.api.http) = {
74
+ get: "/api/v1/namespaces"
75
+ };
65
76
  }
66
77
 
67
78
  // UpdateNamespace is used to update the information and configuration of a registered
68
79
  // namespace.
69
- //
70
- // (-- api-linter: core::0134::method-signature=disabled
71
- // aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --)
72
- // (-- api-linter: core::0134::response-message-name=disabled
73
- // aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --)
74
80
  rpc UpdateNamespace (UpdateNamespaceRequest) returns (UpdateNamespaceResponse) {
81
+ option (google.api.http) = {
82
+ post: "/api/v1/namespaces/{namespace}/update"
83
+ body: "*"
84
+ };
75
85
  }
76
86
 
77
87
  // DeprecateNamespace is used to update the state of a registered namespace to DEPRECATED.
@@ -79,6 +89,9 @@ service WorkflowService {
79
89
  // Once the namespace is deprecated it cannot be used to start new workflow executions. Existing
80
90
  // workflow executions will continue to run on deprecated namespaces.
81
91
  // Deprecated.
92
+ //
93
+ // (-- api-linter: core::0127::http-annotation=disabled
94
+ // aip.dev/not-precedent: Deprecated --)
82
95
  rpc DeprecateNamespace (DeprecateNamespaceRequest) returns (DeprecateNamespaceResponse) {
83
96
  }
84
97
 
@@ -88,17 +101,27 @@ service WorkflowService {
88
101
  // also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an
89
102
  // instance already exists with same workflow id.
90
103
  rpc StartWorkflowExecution (StartWorkflowExecutionRequest) returns (StartWorkflowExecutionResponse) {
104
+ option (google.api.http) = {
105
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}"
106
+ body: "*"
107
+ };
91
108
  }
92
109
 
93
110
  // GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with
94
111
  // `NotFound` if the specified workflow execution is unknown to the service.
95
112
  rpc GetWorkflowExecutionHistory (GetWorkflowExecutionHistoryRequest) returns (GetWorkflowExecutionHistoryResponse) {
113
+ option (google.api.http) = {
114
+ get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history"
115
+ };
96
116
  }
97
117
 
98
118
  // GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse
99
119
  // order (starting from last event). Fails with`NotFound` if the specified workflow execution is
100
120
  // unknown to the service.
101
121
  rpc GetWorkflowExecutionHistoryReverse (GetWorkflowExecutionHistoryReverseRequest) returns (GetWorkflowExecutionHistoryReverseResponse) {
122
+ option (google.api.http) = {
123
+ get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse"
124
+ };
102
125
  }
103
126
 
104
127
  // PollWorkflowTaskQueue is called by workers to make progress on workflows.
@@ -107,6 +130,9 @@ service WorkflowService {
107
130
  // tasks. The worker is expected to call `RespondWorkflowTaskCompleted` when it is done
108
131
  // processing the task. The service will create a `WorkflowTaskStarted` event in the history for
109
132
  // this task before handing it to the worker.
133
+ //
134
+ // (-- api-linter: core::0127::http-annotation=disabled
135
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
110
136
  rpc PollWorkflowTaskQueue (PollWorkflowTaskQueueRequest) returns (PollWorkflowTaskQueueResponse) {
111
137
  }
112
138
 
@@ -116,6 +142,9 @@ service WorkflowService {
116
142
  // Completing a WorkflowTask will write a `WORKFLOW_TASK_COMPLETED` event to the workflow's
117
143
  // history, along with events corresponding to whatever commands the SDK generated while
118
144
  // executing the task (ex timer started, activity task scheduled, etc).
145
+ //
146
+ // (-- api-linter: core::0127::http-annotation=disabled
147
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
119
148
  rpc RespondWorkflowTaskCompleted (RespondWorkflowTaskCompletedRequest) returns (RespondWorkflowTaskCompletedResponse) {
120
149
  }
121
150
 
@@ -128,6 +157,9 @@ service WorkflowService {
128
157
  //
129
158
  // Temporal will only append first WorkflowTaskFailed event to the history of workflow execution
130
159
  // for consecutive failures.
160
+ //
161
+ // (-- api-linter: core::0127::http-annotation=disabled
162
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
131
163
  rpc RespondWorkflowTaskFailed (RespondWorkflowTaskFailedRequest) returns (RespondWorkflowTaskFailedResponse) {
132
164
  }
133
165
 
@@ -143,6 +175,9 @@ service WorkflowService {
143
175
  // (`ACTIVITY_TASK_COMPLETED` / `ACTIVITY_TASK_FAILED` / `ACTIVITY_TASK_TIMED_OUT`) will both be
144
176
  // written permanently to Workflow execution history when Activity is finished. This is done to
145
177
  // avoid writing many events in the case of a failure/retry loop.
178
+ //
179
+ // (-- api-linter: core::0127::http-annotation=disabled
180
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
146
181
  rpc PollActivityTaskQueue (PollActivityTaskQueueRequest) returns (PollActivityTaskQueueResponse) {
147
182
  }
148
183
 
@@ -153,6 +188,10 @@ service WorkflowService {
153
188
  // the workflow history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in
154
189
  // such situations, in that event, the SDK should request cancellation of the activity.
155
190
  rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) {
191
+ option (google.api.http) = {
192
+ post: "/api/v1/namespaces/{namespace}/activities/heartbeat"
193
+ body: "*"
194
+ };
156
195
  }
157
196
 
158
197
  // See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by
@@ -161,6 +200,10 @@ service WorkflowService {
161
200
  // (-- api-linter: core::0136::prepositions=disabled
162
201
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
163
202
  rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) {
203
+ option (google.api.http) = {
204
+ post: "/api/v1/namespaces/{namespace}/activities/heartbeat-by-id"
205
+ body: "*"
206
+ };
164
207
  }
165
208
 
166
209
  // RespondActivityTaskCompleted is called by workers when they successfully complete an activity
@@ -170,6 +213,10 @@ service WorkflowService {
170
213
  // and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
171
214
  // no longer valid due to activity timeout, already being completed, or never having existed.
172
215
  rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) {
216
+ option (google.api.http) = {
217
+ post: "/api/v1/namespaces/{namespace}/activities/complete"
218
+ body: "*"
219
+ };
173
220
  }
174
221
 
175
222
  // See `RecordActivityTaskCompleted`. This version allows clients to record completions by
@@ -178,6 +225,10 @@ service WorkflowService {
178
225
  // (-- api-linter: core::0136::prepositions=disabled
179
226
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
180
227
  rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) {
228
+ option (google.api.http) = {
229
+ post: "/api/v1/namespaces/{namespace}/activities/complete-by-id"
230
+ body: "*"
231
+ };
181
232
  }
182
233
 
183
234
  // RespondActivityTaskFailed is called by workers when processing an activity task fails.
@@ -186,6 +237,10 @@ service WorkflowService {
186
237
  // a new workflow task created for the workflow. Fails with `NotFound` if the task token is no
187
238
  // longer valid due to activity timeout, already being completed, or never having existed.
188
239
  rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) {
240
+ option (google.api.http) = {
241
+ post: "/api/v1/namespaces/{namespace}/activities/fail"
242
+ body: "*"
243
+ };
189
244
  }
190
245
 
191
246
  // See `RecordActivityTaskFailed`. This version allows clients to record failures by
@@ -194,6 +249,10 @@ service WorkflowService {
194
249
  // (-- api-linter: core::0136::prepositions=disabled
195
250
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
196
251
  rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) {
252
+ option (google.api.http) = {
253
+ post: "/api/v1/namespaces/{namespace}/activities/fail-by-id"
254
+ body: "*"
255
+ };
197
256
  }
198
257
 
199
258
  // RespondActivityTaskFailed is called by workers when processing an activity task fails.
@@ -202,6 +261,10 @@ service WorkflowService {
202
261
  // and a new workflow task created for the workflow. Fails with `NotFound` if the task token is
203
262
  // no longer valid due to activity timeout, already being completed, or never having existed.
204
263
  rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) {
264
+ option (google.api.http) = {
265
+ post: "/api/v1/namespaces/{namespace}/activities/cancel"
266
+ body: "*"
267
+ };
205
268
  }
206
269
 
207
270
  // See `RecordActivityTaskCanceled`. This version allows clients to record failures by
@@ -210,6 +273,10 @@ service WorkflowService {
210
273
  // (-- api-linter: core::0136::prepositions=disabled
211
274
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
212
275
  rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) {
276
+ option (google.api.http) = {
277
+ post: "/api/v1/namespaces/{namespace}/activities/cancel-by-id"
278
+ body: "*"
279
+ };
213
280
  }
214
281
 
215
282
  // RequestCancelWorkflowExecution is called by workers when they want to request cancellation of
@@ -219,6 +286,10 @@ service WorkflowService {
219
286
  // workflow history and a new workflow task created for the workflow. It returns success if the requested
220
287
  // workflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.
221
288
  rpc RequestCancelWorkflowExecution (RequestCancelWorkflowExecutionRequest) returns (RequestCancelWorkflowExecutionResponse) {
289
+ option (google.api.http) = {
290
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/cancel"
291
+ body: "*"
292
+ };
222
293
  }
223
294
 
224
295
  // SignalWorkflowExecution is used to send a signal to a running workflow execution.
@@ -226,6 +297,10 @@ service WorkflowService {
226
297
  // This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow
227
298
  // task being created for the execution.
228
299
  rpc SignalWorkflowExecution (SignalWorkflowExecutionRequest) returns (SignalWorkflowExecutionResponse) {
300
+ option (google.api.http) = {
301
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/signal/{signal_name}"
302
+ body: "*"
303
+ };
229
304
  }
230
305
 
231
306
  // SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if
@@ -241,6 +316,10 @@ service WorkflowService {
241
316
  // (-- api-linter: core::0136::prepositions=disabled
242
317
  // aip.dev/not-precedent: "With" is used to indicate combined operation. --)
243
318
  rpc SignalWithStartWorkflowExecution (SignalWithStartWorkflowExecutionRequest) returns (SignalWithStartWorkflowExecutionResponse) {
319
+ option (google.api.http) = {
320
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/signal-with-start/{signal_name}"
321
+ body: "*"
322
+ };
244
323
  }
245
324
 
246
325
  // ResetWorkflowExecution will reset an existing workflow execution to a specified
@@ -248,60 +327,86 @@ service WorkflowService {
248
327
  // execution instance.
249
328
  // TODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?
250
329
  rpc ResetWorkflowExecution (ResetWorkflowExecutionRequest) returns (ResetWorkflowExecutionResponse) {
330
+ option (google.api.http) = {
331
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/reset"
332
+ body: "*"
333
+ };
251
334
  }
252
335
 
253
336
  // TerminateWorkflowExecution terminates an existing workflow execution by recording a
254
337
  // `WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the
255
338
  // execution instance.
256
339
  rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (TerminateWorkflowExecutionResponse) {
340
+ option (google.api.http) = {
341
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/terminate"
342
+ body: "*"
343
+ };
257
344
  }
258
345
 
259
346
  // DeleteWorkflowExecution asynchronously deletes a specific Workflow Execution (when
260
347
  // WorkflowExecution.run_id is provided) or the latest Workflow Execution (when
261
348
  // WorkflowExecution.run_id is not provided). If the Workflow Execution is Running, it will be
262
349
  // terminated before deletion.
263
- // (-- api-linter: core::0135::method-signature=disabled
264
- // aip.dev/not-precedent: DeleteNamespace RPC doesn't follow Google API format. --)
265
- // (-- api-linter: core::0135::response-message-name=disabled
266
- // aip.dev/not-precedent: DeleteNamespace RPC doesn't follow Google API format. --)
267
- rpc DeleteWorkflowExecution (DeleteWorkflowExecutionRequest) returns (DeleteWorkflowExecutionResponse) {
268
- }
350
+ //
351
+ // (-- api-linter: core::0127::http-annotation=disabled
352
+ // aip.dev/not-precedent: Workflow deletion not exposed to HTTP, users should use cancel or terminate. --)
353
+ rpc DeleteWorkflowExecution (DeleteWorkflowExecutionRequest) returns (DeleteWorkflowExecutionResponse) {}
269
354
 
270
355
  // ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace.
271
- rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) {
272
- }
356
+ //
357
+ // (-- api-linter: core::0127::http-annotation=disabled
358
+ // aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)
359
+ rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) {}
273
360
 
274
361
  // ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace.
275
- rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) {
276
- }
362
+ //
363
+ // (-- api-linter: core::0127::http-annotation=disabled
364
+ // aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)
365
+ rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) {}
277
366
 
278
367
  // ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.
279
368
  rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
369
+ option (google.api.http) = {
370
+ get: "/api/v1/namespaces/{namespace}/workflows"
371
+ };
280
372
  }
281
373
 
282
374
  // ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.
283
375
  rpc ListArchivedWorkflowExecutions (ListArchivedWorkflowExecutionsRequest) returns (ListArchivedWorkflowExecutionsResponse) {
376
+ option (google.api.http) = {
377
+ get: "/api/v1/namespaces/{namespace}/archived-workflows"
378
+ };
284
379
  }
285
380
 
286
381
  // ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order.
382
+ //
383
+ // (-- api-linter: core::0127::http-annotation=disabled
384
+ // aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)
287
385
  rpc ScanWorkflowExecutions (ScanWorkflowExecutionsRequest) returns (ScanWorkflowExecutionsResponse) {
288
386
  }
289
387
 
290
388
  // CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.
291
389
  rpc CountWorkflowExecutions (CountWorkflowExecutionsRequest) returns (CountWorkflowExecutionsResponse) {
390
+ option (google.api.http) = {
391
+ get: "/api/v1/namespaces/{namespace}/workflow-count"
392
+ };
292
393
  }
293
394
 
294
395
  // GetSearchAttributes is a visibility API to get all legal keys that could be used in list APIs
295
- rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) {
296
- }
396
+ //
397
+ // (-- api-linter: core::0127::http-annotation=disabled
398
+ // aip.dev/not-precedent: We do not expose this search attribute API to HTTP (but may expose on OperatorService). --)
399
+ rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) {}
297
400
 
298
401
  // RespondQueryTaskCompleted is called by workers to complete queries which were delivered on
299
402
  // the `query` (not `queries`) field of a `PollWorkflowTaskQueueResponse`.
300
403
  //
301
404
  // Completing the query will unblock the corresponding client call to `QueryWorkflow` and return
302
405
  // the query result a response.
303
- rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {
304
- }
406
+ //
407
+ // (-- api-linter: core::0127::http-annotation=disabled
408
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
409
+ rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {}
305
410
 
306
411
  // ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of
307
412
  // a given workflow. This is prudent for workers to perform if a workflow has been paged out of
@@ -310,74 +415,103 @@ service WorkflowService {
310
415
  // Things cleared are:
311
416
  // 1. StickyTaskQueue
312
417
  // 2. StickyScheduleToStartTimeout
418
+ //
419
+ // (-- api-linter: core::0127::http-annotation=disabled
420
+ // aip.dev/not-precedent: We do not expose worker API to HTTP. --)
313
421
  rpc ResetStickyTaskQueue (ResetStickyTaskQueueRequest) returns (ResetStickyTaskQueueResponse) {
314
422
  }
315
423
 
316
424
  // QueryWorkflow requests a query be executed for a specified workflow execution.
317
425
  rpc QueryWorkflow (QueryWorkflowRequest) returns (QueryWorkflowResponse) {
426
+ option (google.api.http) = {
427
+ post: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}"
428
+ body: "*"
429
+ };
318
430
  }
319
431
 
320
432
  // DescribeWorkflowExecution returns information about the specified workflow execution.
321
433
  rpc DescribeWorkflowExecution (DescribeWorkflowExecutionRequest) returns (DescribeWorkflowExecutionResponse) {
434
+ option (google.api.http) = {
435
+ get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}"
436
+ };
322
437
  }
323
438
 
324
439
  // DescribeTaskQueue returns information about the target task queue.
325
440
  rpc DescribeTaskQueue (DescribeTaskQueueRequest) returns (DescribeTaskQueueResponse) {
441
+ option (google.api.http) = {
442
+ get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue.name}"
443
+ };
326
444
  }
327
445
 
328
446
  // GetClusterInfo returns information about temporal cluster
329
- rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse){
447
+ rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse) {
448
+ option (google.api.http) = {
449
+ get: "/api/v1/cluster-info"
450
+ };
330
451
  }
331
452
 
332
453
  // GetSystemInfo returns information about the system.
333
454
  rpc GetSystemInfo(GetSystemInfoRequest) returns (GetSystemInfoResponse) {
455
+ option (google.api.http) = {
456
+ get: "/api/v1/system-info"
457
+ };
334
458
  }
335
459
 
460
+ // (-- api-linter: core::0127::http-annotation=disabled
461
+ // aip.dev/not-precedent: We do not expose this low-level API to HTTP. --)
336
462
  rpc ListTaskQueuePartitions(ListTaskQueuePartitionsRequest) returns (ListTaskQueuePartitionsResponse) {
337
463
  }
338
464
 
339
465
  // Creates a new schedule.
340
- // (-- api-linter: core::0133::method-signature=disabled
341
- // aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
342
- // (-- api-linter: core::0133::response-message-name=disabled
343
- // aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
344
- // (-- api-linter: core::0133::http-uri-parent=disabled
345
- // aip.dev/not-precedent: CreateSchedule doesn't follow Google API format --)
346
466
  rpc CreateSchedule (CreateScheduleRequest) returns (CreateScheduleResponse) {
467
+ option (google.api.http) = {
468
+ post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
469
+ body: "*"
470
+ };
347
471
  }
348
472
 
349
473
  // Returns the schedule description and current state of an existing schedule.
350
474
  rpc DescribeSchedule (DescribeScheduleRequest) returns (DescribeScheduleResponse) {
475
+ option (google.api.http) = {
476
+ get: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
477
+ };
351
478
  }
352
479
 
353
480
  // Changes the configuration or state of an existing schedule.
354
- // (-- api-linter: core::0134::response-message-name=disabled
355
- // aip.dev/not-precedent: UpdateSchedule RPC doesn't follow Google API format. --)
356
- // (-- api-linter: core::0134::method-signature=disabled
357
- // aip.dev/not-precedent: UpdateSchedule RPC doesn't follow Google API format. --)
358
481
  rpc UpdateSchedule (UpdateScheduleRequest) returns (UpdateScheduleResponse) {
482
+ option (google.api.http) = {
483
+ post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/update"
484
+ body: "*"
485
+ };
359
486
  }
360
487
 
361
488
  // Makes a specific change to a schedule or triggers an immediate action.
362
- // (-- api-linter: core::0134::synonyms=disabled
363
- // aip.dev/not-precedent: we have both patch and update. --)
364
489
  rpc PatchSchedule (PatchScheduleRequest) returns (PatchScheduleResponse) {
490
+ option (google.api.http) = {
491
+ post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/patch"
492
+ body: "*"
493
+ };
365
494
  }
366
495
 
367
496
  // Lists matching times within a range.
368
497
  rpc ListScheduleMatchingTimes (ListScheduleMatchingTimesRequest) returns (ListScheduleMatchingTimesResponse) {
498
+ option (google.api.http) = {
499
+ get: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/matching-times"
500
+ };
369
501
  }
370
502
 
371
503
  // Deletes a schedule, removing it from the system.
372
- // (-- api-linter: core::0135::method-signature=disabled
373
- // aip.dev/not-precedent: DeleteSchedule doesn't follow Google API format --)
374
- // (-- api-linter: core::0135::response-message-name=disabled
375
- // aip.dev/not-precedent: DeleteSchedule doesn't follow Google API format --)
376
504
  rpc DeleteSchedule (DeleteScheduleRequest) returns (DeleteScheduleResponse) {
505
+ option (google.api.http) = {
506
+ delete: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
507
+ };
377
508
  }
378
509
 
379
510
  // List all schedules in a namespace.
380
511
  rpc ListSchedules (ListSchedulesRequest) returns (ListSchedulesResponse) {
512
+ option (google.api.http) = {
513
+ get: "/api/v1/namespaces/{namespace}/schedules"
514
+ };
381
515
  }
382
516
 
383
517
  // Allows users to specify sets of worker build id versions on a per task queue basis. Versions
@@ -393,13 +527,16 @@ service WorkflowService {
393
527
  // NOTE: The number of task queues mapped to a single build id is limited by the `limit.taskQueuesPerBuildId`
394
528
  // (default is 20), if this limit is exceeded this API will error with a FailedPrecondition.
395
529
  //
396
- // (-- api-linter: core::0134::response-message-name=disabled
397
- // aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow Google API format. --)
398
- // (-- api-linter: core::0134::method-signature=disabled
399
- // aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow Google API format. --)
530
+ // (-- api-linter: core::0127::http-annotation=disabled
531
+ // aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)
400
532
  rpc UpdateWorkerBuildIdCompatibility (UpdateWorkerBuildIdCompatibilityRequest) returns (UpdateWorkerBuildIdCompatibilityResponse) {}
533
+
401
534
  // Fetches the worker build id versioning sets for a task queue.
402
- rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {}
535
+ rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {
536
+ option (google.api.http) = {
537
+ get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/worker-build-id-compatibility"
538
+ };
539
+ }
403
540
 
404
541
  // Fetches task reachability to determine whether a worker may be retired.
405
542
  // The request may specify task queues to query for or let the server fetch all task queues mapped to the given
@@ -413,36 +550,57 @@ service WorkflowService {
413
550
  //
414
551
  // Open source users can adjust this limit by setting the server's dynamic config value for
415
552
  // `limit.reachabilityTaskQueueScan` with the caveat that this call can strain the visibility store.
416
- rpc GetWorkerTaskReachability (GetWorkerTaskReachabilityRequest) returns (GetWorkerTaskReachabilityResponse) {}
553
+ rpc GetWorkerTaskReachability (GetWorkerTaskReachabilityRequest) returns (GetWorkerTaskReachabilityResponse) {
554
+ option (google.api.http) = {
555
+ get: "/api/v1/namespaces/{namespace}/worker-task-reachability"
556
+ };
557
+ }
417
558
 
418
559
  // Invokes the specified update function on user workflow code.
419
- // (-- api-linter: core::0134=disabled
420
- // aip.dev/not-precedent: UpdateWorkflowExecution doesn't follow Google API format --)
421
560
  rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) {
561
+ option (google.api.http) = {
562
+ post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/update/{request.input.name}"
563
+ body: "*"
564
+ };
422
565
  }
423
566
 
424
567
  // Polls a workflow execution for the outcome of a workflow execution update
425
568
  // previously issued through the UpdateWorkflowExecution RPC. The effective
426
569
  // timeout on this call will be shorter of the the caller-supplied gRPC
427
570
  // timeout and the server's configured long-poll timeout.
428
- // (-- api-linter: core::0134=disabled
429
- // aip.dev/not-precedent: UpdateWorkflowExecution doesn't follow Google API format --)
430
- rpc PollWorkflowExecutionUpdate(PollWorkflowExecutionUpdateRequest) returns (PollWorkflowExecutionUpdateResponse){
571
+ //
572
+ // (-- api-linter: core::0127::http-annotation=disabled
573
+ // aip.dev/not-precedent: We don't expose update polling API to HTTP in favor of a potential future non-blocking form. --)
574
+ rpc PollWorkflowExecutionUpdate(PollWorkflowExecutionUpdateRequest) returns (PollWorkflowExecutionUpdateResponse) {
431
575
  }
432
576
 
433
577
  // StartBatchOperation starts a new batch operation
434
578
  rpc StartBatchOperation(StartBatchOperationRequest) returns (StartBatchOperationResponse) {
579
+ option (google.api.http) = {
580
+ post: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}"
581
+ body: "*"
582
+ };
435
583
  }
436
584
 
437
585
  // StopBatchOperation stops a batch operation
438
586
  rpc StopBatchOperation(StopBatchOperationRequest) returns (StopBatchOperationResponse) {
587
+ option (google.api.http) = {
588
+ post: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}/stop"
589
+ body: "*"
590
+ };
439
591
  }
440
592
 
441
593
  // DescribeBatchOperation returns the information about a batch operation
442
594
  rpc DescribeBatchOperation(DescribeBatchOperationRequest) returns (DescribeBatchOperationResponse) {
595
+ option (google.api.http) = {
596
+ get: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}"
597
+ };
443
598
  }
444
599
 
445
600
  // ListBatchOperations returns a list of batch operations
446
601
  rpc ListBatchOperations(ListBatchOperationsRequest) returns (ListBatchOperationsResponse) {
602
+ option (google.api.http) = {
603
+ get: "/api/v1/namespaces/{namespace}/batch-operations"
604
+ };
447
605
  }
448
606
  }
@@ -10,6 +10,7 @@ option ruby_package = "Temporalio::Bridge::Api::WorkflowActivation";
10
10
  import "google/protobuf/timestamp.proto";
11
11
  import "google/protobuf/duration.proto";
12
12
  import "temporal/api/failure/v1/message.proto";
13
+ import "temporal/api/update/v1/message.proto";
13
14
  import "temporal/api/common/v1/message.proto";
14
15
  import "temporal/api/enums/v1/workflow.proto";
15
16
  import "temporal/sdk/core/activity_result/activity_result.proto";
@@ -18,6 +19,33 @@ import "temporal/sdk/core/common/common.proto";
18
19
 
19
20
  // An instruction to the lang sdk to run some workflow code, whether for the first time or from
20
21
  // a cached state.
22
+ //
23
+ // ## Job ordering guarantees and semantics
24
+ //
25
+ // Core will, by default, order jobs within the activation as follows:
26
+ // `patches -> signals/updates -> other -> queries -> evictions`
27
+ //
28
+ // This is because:
29
+ // * Patches are expected to apply to the entire activation
30
+ // * Signal and update handlers should be invoked before workflow routines are iterated. That is to
31
+ // say before the users' main workflow function and anything spawned by it is allowed to continue.
32
+ // * Queries always go last (and, in fact, always come in their own activation)
33
+ //
34
+ // The downside of this reordering is that a signal or update handler may not observe that some
35
+ // other event had already happened (ex: an activity completed) when it is first invoked, though it
36
+ // will subsequently when workflow routines are driven. Core only does this reordering to make life
37
+ // easier for languages that cannot explicitly control when workflow routines are iterated.
38
+ // Languages that can explicitly control such iteration should prefer to apply all the jobs to state
39
+ // (by resolving promises/futures, invoking handlers, etc as they iterate over the jobs) and then
40
+ // only *after* that is done, drive the workflow routines.
41
+ //
42
+ // ## Evictions
43
+ //
44
+ // Activations that contain only a `remove_from_cache` job should not cause the workflow code
45
+ // to be invoked and may be responded to with an empty command list. Eviction jobs may also
46
+ // appear with other jobs, but will always appear last in the job list. In this case it is
47
+ // expected that the workflow code will be invoked, and the response produced as normal, but
48
+ // the caller should evict the run after doing so.
21
49
  message WorkflowActivation {
22
50
  // The id of the currently active run of the workflow. Also used as a cache key. There may
23
51
  // only ever be one active workflow task (and hence activation) of a run at one time.
@@ -39,6 +67,10 @@ message WorkflowActivation {
39
67
  uint64 history_size_bytes = 7;
40
68
  // Set true if the most recent WFT started event had this suggestion
41
69
  bool continue_as_new_suggested = 8;
70
+ // Set to the Build ID of the worker that processed this task, which may be empty. During replay
71
+ // this id may not equal the id of the replaying worker. If not replaying and this worker has
72
+ // a defined Build ID, it will equal that ID. It will also be empty for evict-only activations.
73
+ string build_id_for_current_task = 9;
42
74
  }
43
75
 
44
76
  message WorkflowActivationJob {
@@ -69,6 +101,8 @@ message WorkflowActivationJob {
69
101
  ResolveSignalExternalWorkflow resolve_signal_external_workflow = 12;
70
102
  // An attempt to cancel an external workflow resolved
71
103
  ResolveRequestCancelExternalWorkflow resolve_request_cancel_external_workflow = 13;
104
+ // A request to handle a workflow update.
105
+ DoUpdate do_update = 14;
72
106
  // Remove the workflow identified by the [WorkflowActivation] containing this job from the cache
73
107
  // after performing the activation.
74
108
  //
@@ -242,6 +276,29 @@ message ResolveRequestCancelExternalWorkflow {
242
276
  temporal.api.failure.v1.Failure failure = 2;
243
277
  }
244
278
 
279
+ // Lang is requested to invoke an update handler on the workflow. Lang should invoke the update
280
+ // validator first (if requested). If it accepts the update, immediately invoke the update handler.
281
+ // Lang must reply to the activation containing this job with an `UpdateResponse`.
282
+ message DoUpdate {
283
+ // A workflow-unique identifier for this update
284
+ string id = 1;
285
+ // The protocol message instance ID - this is used to uniquely track the ID server side and
286
+ // internally.
287
+ string protocol_instance_id = 2;
288
+ // The name of the update handler
289
+ string name = 3;
290
+ // The input to the update
291
+ repeated temporal.api.common.v1.Payload input = 4;
292
+ // Headers attached to the update
293
+ map<string, temporal.api.common.v1.Payload> headers = 5;
294
+ // Remaining metadata associated with the update. The `update_id` field is stripped from here
295
+ // and moved to `id`, since it is guaranteed to be present.
296
+ temporal.api.update.v1.Meta meta = 6;
297
+ // If set true, lang must run the update's validator before running the handler. This will be
298
+ // set false during replay, since validation is not re-run during replay.
299
+ bool run_validator = 7;
300
+ }
301
+
245
302
  message RemoveFromCache {
246
303
  string message = 1;
247
304