@temporalio/core-bridge 1.10.2 → 1.11.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 (126) hide show
  1. package/Cargo.lock +563 -676
  2. package/Cargo.toml +3 -3
  3. package/lib/index.d.ts +16 -5
  4. package/lib/index.js.map +1 -1
  5. package/lib/worker-tuner.d.ts +57 -0
  6. package/lib/worker-tuner.js +3 -0
  7. package/lib/worker-tuner.js.map +1 -0
  8. package/package.json +3 -3
  9. package/releases/aarch64-apple-darwin/index.node +0 -0
  10. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  11. package/releases/x86_64-apple-darwin/index.node +0 -0
  12. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  13. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  14. package/sdk-core/.github/workflows/heavy.yml +6 -11
  15. package/sdk-core/.github/workflows/per-pr.yml +23 -41
  16. package/sdk-core/Cargo.toml +5 -5
  17. package/sdk-core/README.md +2 -0
  18. package/sdk-core/client/Cargo.toml +4 -2
  19. package/sdk-core/client/src/lib.rs +60 -17
  20. package/sdk-core/client/src/metrics.rs +1 -1
  21. package/sdk-core/client/src/proxy.rs +17 -12
  22. package/sdk-core/client/src/raw.rs +218 -69
  23. package/sdk-core/client/src/retry.rs +19 -9
  24. package/sdk-core/core/Cargo.toml +12 -12
  25. package/sdk-core/core/src/abstractions.rs +3 -3
  26. package/sdk-core/core/src/core_tests/activity_tasks.rs +2 -1
  27. package/sdk-core/core/src/core_tests/determinism.rs +1 -1
  28. package/sdk-core/core/src/core_tests/local_activities.rs +73 -10
  29. package/sdk-core/core/src/core_tests/queries.rs +2 -1
  30. package/sdk-core/core/src/core_tests/updates.rs +162 -4
  31. package/sdk-core/core/src/core_tests/workers.rs +38 -2
  32. package/sdk-core/core/src/core_tests/workflow_tasks.rs +158 -27
  33. package/sdk-core/core/src/internal_flags.rs +17 -7
  34. package/sdk-core/core/src/lib.rs +9 -3
  35. package/sdk-core/core/src/pollers/poll_buffer.rs +1 -10
  36. package/sdk-core/core/src/protosext/mod.rs +0 -1
  37. package/sdk-core/core/src/protosext/protocol_messages.rs +105 -16
  38. package/sdk-core/core/src/retry_logic.rs +22 -2
  39. package/sdk-core/core/src/telemetry/otel.rs +44 -12
  40. package/sdk-core/core/src/test_help/mod.rs +65 -12
  41. package/sdk-core/core/src/worker/activities/local_activities.rs +1 -4
  42. package/sdk-core/core/src/worker/activities.rs +3 -4
  43. package/sdk-core/core/src/worker/client/mocks.rs +7 -6
  44. package/sdk-core/core/src/worker/client.rs +11 -2
  45. package/sdk-core/core/src/worker/mod.rs +49 -24
  46. package/sdk-core/core/src/worker/tuner/resource_based.rs +48 -48
  47. package/sdk-core/core/src/worker/tuner.rs +124 -4
  48. package/sdk-core/core/src/worker/workflow/driven_workflow.rs +1 -1
  49. package/sdk-core/core/src/worker/workflow/history_update.rs +11 -2
  50. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +18 -3
  51. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +1 -0
  52. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +1 -0
  53. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -0
  54. package/sdk-core/core/src/worker/workflow/machines/complete_workflow_state_machine.rs +1 -0
  55. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +1 -0
  56. package/sdk-core/core/src/worker/workflow/machines/fail_workflow_state_machine.rs +1 -0
  57. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +4 -4
  58. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +1 -0
  59. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +1 -0
  60. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +1 -0
  61. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +3 -1
  62. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +38 -28
  63. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +4 -2
  64. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +95 -71
  65. package/sdk-core/core/src/worker/workflow/machines/workflow_task_state_machine.rs +1 -1
  66. package/sdk-core/core/src/worker/workflow/managed_run.rs +214 -14
  67. package/sdk-core/core/src/worker/workflow/mod.rs +49 -36
  68. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +1 -2
  69. package/sdk-core/core-api/src/errors.rs +13 -7
  70. package/sdk-core/core-api/src/lib.rs +9 -1
  71. package/sdk-core/sdk/Cargo.toml +1 -1
  72. package/sdk-core/sdk/src/activity_context.rs +3 -4
  73. package/sdk-core/sdk/src/lib.rs +96 -49
  74. package/sdk-core/sdk/src/workflow_context/options.rs +8 -4
  75. package/sdk-core/sdk/src/workflow_context.rs +53 -49
  76. package/sdk-core/sdk/src/workflow_future.rs +10 -4
  77. package/sdk-core/sdk-core-protos/Cargo.toml +4 -3
  78. package/sdk-core/sdk-core-protos/build.rs +2 -0
  79. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/.github/workflows/build.yaml +18 -0
  80. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/LICENSE +21 -0
  81. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/Makefile +59 -0
  82. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/README.md +25 -0
  83. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -0
  84. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.gen.yaml +14 -0
  85. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.lock +8 -0
  86. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.yaml +9 -0
  87. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +520 -0
  88. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +263 -0
  89. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +173 -0
  90. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +164 -0
  91. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +36 -0
  92. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +22 -0
  93. package/sdk-core/sdk-core-protos/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +50 -8
  94. package/sdk-core/sdk-core-protos/protos/api_upstream/.gitmodules +3 -0
  95. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +132 -54
  96. package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +177 -81
  97. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +13 -0
  98. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
  99. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +8 -3
  100. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +10 -0
  101. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +3 -3
  102. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +6 -6
  103. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +96 -0
  104. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +49 -0
  105. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +6 -7
  106. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +55 -24
  107. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +7 -0
  108. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +21 -4
  109. package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +64 -45
  110. package/sdk-core/sdk-core-protos/src/history_builder.rs +8 -1
  111. package/sdk-core/sdk-core-protos/src/lib.rs +40 -10
  112. package/sdk-core/test-utils/src/canned_histories.rs +1 -1
  113. package/sdk-core/tests/fuzzy_workflow.rs +4 -2
  114. package/sdk-core/tests/heavy_tests.rs +3 -3
  115. package/sdk-core/tests/integ_tests/activity_functions.rs +2 -2
  116. package/sdk-core/tests/integ_tests/client_tests.rs +234 -6
  117. package/sdk-core/tests/integ_tests/update_tests.rs +180 -47
  118. package/sdk-core/tests/integ_tests/worker_tests.rs +32 -0
  119. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +47 -3
  120. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +10 -10
  121. package/sdk-core/tests/main.rs +1 -0
  122. package/src/conversions.rs +84 -11
  123. package/src/runtime.rs +5 -17
  124. package/src/worker.rs +27 -6
  125. package/ts/index.ts +24 -5
  126. package/ts/worker-tuner.ts +71 -0
@@ -56,7 +56,7 @@ service WorkflowService {
56
56
  // namespace.
57
57
  rpc RegisterNamespace (RegisterNamespaceRequest) returns (RegisterNamespaceResponse) {
58
58
  option (google.api.http) = {
59
- post: "/api/v1/namespaces"
59
+ post: "/namespaces"
60
60
  body: "*"
61
61
  };
62
62
  }
@@ -64,14 +64,14 @@ service WorkflowService {
64
64
  // DescribeNamespace returns the information and configuration for a registered namespace.
65
65
  rpc DescribeNamespace (DescribeNamespaceRequest) returns (DescribeNamespaceResponse) {
66
66
  option (google.api.http) = {
67
- get: "/api/v1/namespaces/{namespace}"
67
+ get: "/namespaces/{namespace}"
68
68
  };
69
69
  }
70
70
 
71
71
  // ListNamespaces returns the information and configuration for all namespaces.
72
72
  rpc ListNamespaces (ListNamespacesRequest) returns (ListNamespacesResponse) {
73
73
  option (google.api.http) = {
74
- get: "/api/v1/namespaces"
74
+ get: "/namespaces"
75
75
  };
76
76
  }
77
77
 
@@ -79,7 +79,7 @@ service WorkflowService {
79
79
  // namespace.
80
80
  rpc UpdateNamespace (UpdateNamespaceRequest) returns (UpdateNamespaceResponse) {
81
81
  option (google.api.http) = {
82
- post: "/api/v1/namespaces/{namespace}/update"
82
+ post: "/namespaces/{namespace}/update"
83
83
  body: "*"
84
84
  };
85
85
  }
@@ -102,7 +102,7 @@ service WorkflowService {
102
102
  // instance already exists with same workflow id.
103
103
  rpc StartWorkflowExecution (StartWorkflowExecutionRequest) returns (StartWorkflowExecutionResponse) {
104
104
  option (google.api.http) = {
105
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}"
105
+ post: "/namespaces/{namespace}/workflows/{workflow_id}"
106
106
  body: "*"
107
107
  };
108
108
  }
@@ -118,7 +118,7 @@ service WorkflowService {
118
118
  // NOTE: Experimental API.
119
119
  rpc ExecuteMultiOperation (ExecuteMultiOperationRequest) returns (ExecuteMultiOperationResponse) {
120
120
  option (google.api.http) = {
121
- post: "/api/v1/namespaces/{namespace}/workflows/execute-multi-operation"
121
+ post: "/namespaces/{namespace}/workflows/execute-multi-operation"
122
122
  body: "*"
123
123
  };
124
124
  }
@@ -127,7 +127,7 @@ service WorkflowService {
127
127
  // `NotFound` if the specified workflow execution is unknown to the service.
128
128
  rpc GetWorkflowExecutionHistory (GetWorkflowExecutionHistoryRequest) returns (GetWorkflowExecutionHistoryResponse) {
129
129
  option (google.api.http) = {
130
- get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history"
130
+ get: "/namespaces/{namespace}/workflows/{execution.workflow_id}/history"
131
131
  };
132
132
  }
133
133
 
@@ -136,7 +136,7 @@ service WorkflowService {
136
136
  // unknown to the service.
137
137
  rpc GetWorkflowExecutionHistoryReverse (GetWorkflowExecutionHistoryReverseRequest) returns (GetWorkflowExecutionHistoryReverseResponse) {
138
138
  option (google.api.http) = {
139
- get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse"
139
+ get: "/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse"
140
140
  };
141
141
  }
142
142
 
@@ -205,7 +205,7 @@ service WorkflowService {
205
205
  // such situations, in that event, the SDK should request cancellation of the activity.
206
206
  rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) {
207
207
  option (google.api.http) = {
208
- post: "/api/v1/namespaces/{namespace}/activities/heartbeat"
208
+ post: "/namespaces/{namespace}/activities/heartbeat"
209
209
  body: "*"
210
210
  };
211
211
  }
@@ -217,7 +217,7 @@ service WorkflowService {
217
217
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
218
218
  rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) {
219
219
  option (google.api.http) = {
220
- post: "/api/v1/namespaces/{namespace}/activities/heartbeat-by-id"
220
+ post: "/namespaces/{namespace}/activities/heartbeat-by-id"
221
221
  body: "*"
222
222
  };
223
223
  }
@@ -230,7 +230,7 @@ service WorkflowService {
230
230
  // no longer valid due to activity timeout, already being completed, or never having existed.
231
231
  rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) {
232
232
  option (google.api.http) = {
233
- post: "/api/v1/namespaces/{namespace}/activities/complete"
233
+ post: "/namespaces/{namespace}/activities/complete"
234
234
  body: "*"
235
235
  };
236
236
  }
@@ -242,7 +242,7 @@ service WorkflowService {
242
242
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
243
243
  rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) {
244
244
  option (google.api.http) = {
245
- post: "/api/v1/namespaces/{namespace}/activities/complete-by-id"
245
+ post: "/namespaces/{namespace}/activities/complete-by-id"
246
246
  body: "*"
247
247
  };
248
248
  }
@@ -254,7 +254,7 @@ service WorkflowService {
254
254
  // longer valid due to activity timeout, already being completed, or never having existed.
255
255
  rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) {
256
256
  option (google.api.http) = {
257
- post: "/api/v1/namespaces/{namespace}/activities/fail"
257
+ post: "/namespaces/{namespace}/activities/fail"
258
258
  body: "*"
259
259
  };
260
260
  }
@@ -266,7 +266,7 @@ service WorkflowService {
266
266
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
267
267
  rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) {
268
268
  option (google.api.http) = {
269
- post: "/api/v1/namespaces/{namespace}/activities/fail-by-id"
269
+ post: "/namespaces/{namespace}/activities/fail-by-id"
270
270
  body: "*"
271
271
  };
272
272
  }
@@ -278,7 +278,7 @@ service WorkflowService {
278
278
  // no longer valid due to activity timeout, already being completed, or never having existed.
279
279
  rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) {
280
280
  option (google.api.http) = {
281
- post: "/api/v1/namespaces/{namespace}/activities/cancel"
281
+ post: "/namespaces/{namespace}/activities/cancel"
282
282
  body: "*"
283
283
  };
284
284
  }
@@ -290,7 +290,7 @@ service WorkflowService {
290
290
  // aip.dev/not-precedent: "By" is used to indicate request type. --)
291
291
  rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) {
292
292
  option (google.api.http) = {
293
- post: "/api/v1/namespaces/{namespace}/activities/cancel-by-id"
293
+ post: "/namespaces/{namespace}/activities/cancel-by-id"
294
294
  body: "*"
295
295
  };
296
296
  }
@@ -303,7 +303,7 @@ service WorkflowService {
303
303
  // workflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.
304
304
  rpc RequestCancelWorkflowExecution (RequestCancelWorkflowExecutionRequest) returns (RequestCancelWorkflowExecutionResponse) {
305
305
  option (google.api.http) = {
306
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/cancel"
306
+ post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/cancel"
307
307
  body: "*"
308
308
  };
309
309
  }
@@ -314,7 +314,7 @@ service WorkflowService {
314
314
  // task being created for the execution.
315
315
  rpc SignalWorkflowExecution (SignalWorkflowExecutionRequest) returns (SignalWorkflowExecutionResponse) {
316
316
  option (google.api.http) = {
317
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/signal/{signal_name}"
317
+ post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/signal/{signal_name}"
318
318
  body: "*"
319
319
  };
320
320
  }
@@ -333,7 +333,7 @@ service WorkflowService {
333
333
  // aip.dev/not-precedent: "With" is used to indicate combined operation. --)
334
334
  rpc SignalWithStartWorkflowExecution (SignalWithStartWorkflowExecutionRequest) returns (SignalWithStartWorkflowExecutionResponse) {
335
335
  option (google.api.http) = {
336
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/signal-with-start/{signal_name}"
336
+ post: "/namespaces/{namespace}/workflows/{workflow_id}/signal-with-start/{signal_name}"
337
337
  body: "*"
338
338
  };
339
339
  }
@@ -344,7 +344,7 @@ service WorkflowService {
344
344
  // TODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?
345
345
  rpc ResetWorkflowExecution (ResetWorkflowExecutionRequest) returns (ResetWorkflowExecutionResponse) {
346
346
  option (google.api.http) = {
347
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/reset"
347
+ post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/reset"
348
348
  body: "*"
349
349
  };
350
350
  }
@@ -354,7 +354,7 @@ service WorkflowService {
354
354
  // execution instance.
355
355
  rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (TerminateWorkflowExecutionResponse) {
356
356
  option (google.api.http) = {
357
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/terminate"
357
+ post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/terminate"
358
358
  body: "*"
359
359
  };
360
360
  }
@@ -383,14 +383,14 @@ service WorkflowService {
383
383
  // ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.
384
384
  rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
385
385
  option (google.api.http) = {
386
- get: "/api/v1/namespaces/{namespace}/workflows"
386
+ get: "/namespaces/{namespace}/workflows"
387
387
  };
388
388
  }
389
389
 
390
390
  // ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.
391
391
  rpc ListArchivedWorkflowExecutions (ListArchivedWorkflowExecutionsRequest) returns (ListArchivedWorkflowExecutionsResponse) {
392
392
  option (google.api.http) = {
393
- get: "/api/v1/namespaces/{namespace}/archived-workflows"
393
+ get: "/namespaces/{namespace}/archived-workflows"
394
394
  };
395
395
  }
396
396
 
@@ -404,7 +404,7 @@ service WorkflowService {
404
404
  // CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.
405
405
  rpc CountWorkflowExecutions (CountWorkflowExecutionsRequest) returns (CountWorkflowExecutionsResponse) {
406
406
  option (google.api.http) = {
407
- get: "/api/v1/namespaces/{namespace}/workflow-count"
407
+ get: "/namespaces/{namespace}/workflow-count"
408
408
  };
409
409
  }
410
410
 
@@ -440,7 +440,7 @@ service WorkflowService {
440
440
  // QueryWorkflow requests a query be executed for a specified workflow execution.
441
441
  rpc QueryWorkflow (QueryWorkflowRequest) returns (QueryWorkflowResponse) {
442
442
  option (google.api.http) = {
443
- post: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}"
443
+ post: "/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}"
444
444
  body: "*"
445
445
  };
446
446
  }
@@ -448,7 +448,7 @@ service WorkflowService {
448
448
  // DescribeWorkflowExecution returns information about the specified workflow execution.
449
449
  rpc DescribeWorkflowExecution (DescribeWorkflowExecutionRequest) returns (DescribeWorkflowExecutionResponse) {
450
450
  option (google.api.http) = {
451
- get: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}"
451
+ get: "/namespaces/{namespace}/workflows/{execution.workflow_id}"
452
452
  };
453
453
  }
454
454
 
@@ -458,21 +458,21 @@ service WorkflowService {
458
458
  // - Backlog info for Workflow and/or Activity tasks
459
459
  rpc DescribeTaskQueue (DescribeTaskQueueRequest) returns (DescribeTaskQueueResponse) {
460
460
  option (google.api.http) = {
461
- get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue.name}"
461
+ get: "/namespaces/{namespace}/task-queues/{task_queue.name}"
462
462
  };
463
463
  }
464
464
 
465
465
  // GetClusterInfo returns information about temporal cluster
466
466
  rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse) {
467
467
  option (google.api.http) = {
468
- get: "/api/v1/cluster-info"
468
+ get: "/cluster-info"
469
469
  };
470
470
  }
471
471
 
472
472
  // GetSystemInfo returns information about the system.
473
473
  rpc GetSystemInfo(GetSystemInfoRequest) returns (GetSystemInfoResponse) {
474
474
  option (google.api.http) = {
475
- get: "/api/v1/system-info"
475
+ get: "/system-info"
476
476
  };
477
477
  }
478
478
 
@@ -484,7 +484,7 @@ service WorkflowService {
484
484
  // Creates a new schedule.
485
485
  rpc CreateSchedule (CreateScheduleRequest) returns (CreateScheduleResponse) {
486
486
  option (google.api.http) = {
487
- post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
487
+ post: "/namespaces/{namespace}/schedules/{schedule_id}"
488
488
  body: "*"
489
489
  };
490
490
  }
@@ -492,14 +492,14 @@ service WorkflowService {
492
492
  // Returns the schedule description and current state of an existing schedule.
493
493
  rpc DescribeSchedule (DescribeScheduleRequest) returns (DescribeScheduleResponse) {
494
494
  option (google.api.http) = {
495
- get: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
495
+ get: "/namespaces/{namespace}/schedules/{schedule_id}"
496
496
  };
497
497
  }
498
498
 
499
499
  // Changes the configuration or state of an existing schedule.
500
500
  rpc UpdateSchedule (UpdateScheduleRequest) returns (UpdateScheduleResponse) {
501
501
  option (google.api.http) = {
502
- post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/update"
502
+ post: "/namespaces/{namespace}/schedules/{schedule_id}/update"
503
503
  body: "*"
504
504
  };
505
505
  }
@@ -507,7 +507,7 @@ service WorkflowService {
507
507
  // Makes a specific change to a schedule or triggers an immediate action.
508
508
  rpc PatchSchedule (PatchScheduleRequest) returns (PatchScheduleResponse) {
509
509
  option (google.api.http) = {
510
- post: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/patch"
510
+ post: "/namespaces/{namespace}/schedules/{schedule_id}/patch"
511
511
  body: "*"
512
512
  };
513
513
  }
@@ -515,21 +515,21 @@ service WorkflowService {
515
515
  // Lists matching times within a range.
516
516
  rpc ListScheduleMatchingTimes (ListScheduleMatchingTimesRequest) returns (ListScheduleMatchingTimesResponse) {
517
517
  option (google.api.http) = {
518
- get: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}/matching-times"
518
+ get: "/namespaces/{namespace}/schedules/{schedule_id}/matching-times"
519
519
  };
520
520
  }
521
521
 
522
522
  // Deletes a schedule, removing it from the system.
523
523
  rpc DeleteSchedule (DeleteScheduleRequest) returns (DeleteScheduleResponse) {
524
524
  option (google.api.http) = {
525
- delete: "/api/v1/namespaces/{namespace}/schedules/{schedule_id}"
525
+ delete: "/namespaces/{namespace}/schedules/{schedule_id}"
526
526
  };
527
527
  }
528
528
 
529
529
  // List all schedules in a namespace.
530
530
  rpc ListSchedules (ListSchedulesRequest) returns (ListSchedulesResponse) {
531
531
  option (google.api.http) = {
532
- get: "/api/v1/namespaces/{namespace}/schedules"
532
+ get: "/namespaces/{namespace}/schedules"
533
533
  };
534
534
  }
535
535
 
@@ -556,11 +556,30 @@ service WorkflowService {
556
556
  // Fetches the worker build id versioning sets for a task queue.
557
557
  rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {
558
558
  option (google.api.http) = {
559
- get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/worker-build-id-compatibility"
559
+ get: "/namespaces/{namespace}/task-queues/{task_queue}/worker-build-id-compatibility"
560
560
  };
561
561
  }
562
562
 
563
- // Allows updating the Build ID assignment and redirect rules for a given Task Queue.
563
+ // Use this API to manage Worker Versioning Rules for a given Task Queue. There are two types of
564
+ // rules: Build ID Assignment rules and Compatible Build ID Redirect rules.
565
+ //
566
+ // Assignment rules are used to assign a Build ID for a new execution when it starts. Its primary
567
+ // use case is to specify the latest Build ID but it has powerful features for gradual rollout
568
+ // of a new Build ID.
569
+ //
570
+ // Once a Build ID is assigned to a workflow execution and it completes its first Workflow Task,
571
+ // the workflow stays on the assigned Build ID regardless of changes in assignment rules. This
572
+ // eliminates the need for compatibility between versions when you only care about using the new
573
+ // version for new workflows and let existing workflows finish in their own version.
574
+ //
575
+ // Activities, Child Workflows and Continue-as-New executions have the option to inherit their
576
+ // parent/previous workflow or use the latest assigment rules to independently select a Build ID.
577
+ //
578
+ // Redirect rules should only be used when you want to move workflows and activities assigned to
579
+ // one Build ID (source) to another compatible Build ID (target). You are responsible to make sure
580
+ // the target Build ID of a redirect rule is able to process event histories made by the source
581
+ // Build ID by using [Patching](https://docs.temporal.io/workflows#patching) or other means.
582
+ //
564
583
  // WARNING: Worker Versioning is not yet stable and the API and behavior may change incompatibly.
565
584
  // (-- api-linter: core::0127::http-annotation=disabled
566
585
  // aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)
@@ -570,7 +589,7 @@ service WorkflowService {
570
589
  // WARNING: Worker Versioning is not yet stable and the API and behavior may change incompatibly.
571
590
  rpc GetWorkerVersioningRules (GetWorkerVersioningRulesRequest) returns (GetWorkerVersioningRulesResponse) {
572
591
  option (google.api.http) = {
573
- get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/worker-versioning-rules"
592
+ get: "/namespaces/{namespace}/task-queues/{task_queue}/worker-versioning-rules"
574
593
  };
575
594
  }
576
595
 
@@ -590,14 +609,14 @@ service WorkflowService {
590
609
  // `limit.reachabilityTaskQueueScan` with the caveat that this call can strain the visibility store.
591
610
  rpc GetWorkerTaskReachability (GetWorkerTaskReachabilityRequest) returns (GetWorkerTaskReachabilityResponse) {
592
611
  option (google.api.http) = {
593
- get: "/api/v1/namespaces/{namespace}/worker-task-reachability"
612
+ get: "/namespaces/{namespace}/worker-task-reachability"
594
613
  };
595
614
  }
596
615
 
597
616
  // Invokes the specified update function on user workflow code.
598
617
  rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) {
599
618
  option (google.api.http) = {
600
- post: "/api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/update/{request.input.name}"
619
+ post: "/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/update/{request.input.name}"
601
620
  body: "*"
602
621
  };
603
622
  }
@@ -615,7 +634,7 @@ service WorkflowService {
615
634
  // StartBatchOperation starts a new batch operation
616
635
  rpc StartBatchOperation(StartBatchOperationRequest) returns (StartBatchOperationResponse) {
617
636
  option (google.api.http) = {
618
- post: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}"
637
+ post: "/namespaces/{namespace}/batch-operations/{job_id}"
619
638
  body: "*"
620
639
  };
621
640
  }
@@ -623,7 +642,7 @@ service WorkflowService {
623
642
  // StopBatchOperation stops a batch operation
624
643
  rpc StopBatchOperation(StopBatchOperationRequest) returns (StopBatchOperationResponse) {
625
644
  option (google.api.http) = {
626
- post: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}/stop"
645
+ post: "/namespaces/{namespace}/batch-operations/{job_id}/stop"
627
646
  body: "*"
628
647
  };
629
648
  }
@@ -631,14 +650,14 @@ service WorkflowService {
631
650
  // DescribeBatchOperation returns the information about a batch operation
632
651
  rpc DescribeBatchOperation(DescribeBatchOperationRequest) returns (DescribeBatchOperationResponse) {
633
652
  option (google.api.http) = {
634
- get: "/api/v1/namespaces/{namespace}/batch-operations/{job_id}"
653
+ get: "/namespaces/{namespace}/batch-operations/{job_id}"
635
654
  };
636
655
  }
637
656
 
638
657
  // ListBatchOperations returns a list of batch operations
639
658
  rpc ListBatchOperations(ListBatchOperationsRequest) returns (ListBatchOperationsResponse) {
640
659
  option (google.api.http) = {
641
- get: "/api/v1/namespaces/{namespace}/batch-operations"
660
+ get: "/namespaces/{namespace}/batch-operations"
642
661
  };
643
662
  }
644
663
 
@@ -243,6 +243,14 @@ impl TestHistoryBuilder {
243
243
  self.build_and_push_event(EventType::WorkflowTaskFailed, attrs.into());
244
244
  }
245
245
 
246
+ pub fn add_timer_started(&mut self, timer_id: String) {
247
+ self.add(TimerStartedEventAttributes {
248
+ timer_id,
249
+ workflow_task_completed_event_id: self.previous_task_completed_id,
250
+ ..Default::default()
251
+ });
252
+ }
253
+
246
254
  pub fn add_timer_fired(&mut self, timer_started_evt_id: i64, timer_id: String) {
247
255
  self.add(TimerFiredEventAttributes {
248
256
  started_event_id: timer_started_evt_id,
@@ -513,7 +521,6 @@ impl TestHistoryBuilder {
513
521
  pub fn wft_start_time(&self) -> Timestamp {
514
522
  self.events[(self.workflow_task_scheduled_event_id + 1) as usize]
515
523
  .event_time
516
- .clone()
517
524
  .unwrap()
518
525
  }
519
526
 
@@ -440,7 +440,6 @@ pub mod coresdk {
440
440
  workflow_activation::remove_from_cache::EvictionReason, FromPayloadsExt,
441
441
  },
442
442
  temporal::api::{
443
- common::v1::Header,
444
443
  enums::v1::WorkflowTaskFailedCause,
445
444
  history::v1::{
446
445
  WorkflowExecutionCancelRequestedEventAttributes,
@@ -451,10 +450,7 @@ pub mod coresdk {
451
450
  },
452
451
  };
453
452
  use prost_wkt_types::Timestamp;
454
- use std::{
455
- collections::HashMap,
456
- fmt::{Display, Formatter},
457
- };
453
+ use std::fmt::{Display, Formatter};
458
454
 
459
455
  tonic::include_proto!("coresdk.workflow_activation");
460
456
 
@@ -647,10 +643,7 @@ pub mod coresdk {
647
643
  workflow_id,
648
644
  arguments: Vec::from_payloads(attrs.input),
649
645
  randomness_seed,
650
- headers: match attrs.header {
651
- None => HashMap::new(),
652
- Some(Header { fields }) => fields,
653
- },
646
+ headers: attrs.header.unwrap_or_default().fields,
654
647
  identity: attrs.identity,
655
648
  parent_workflow_info: attrs.parent_workflow_execution.map(|pe| {
656
649
  NamespacedWorkflowExecution {
@@ -1438,45 +1431,55 @@ pub mod temporal {
1438
1431
  a @ Attributes::StartTimerCommandAttributes(_) => Self {
1439
1432
  command_type: CommandType::StartTimer as i32,
1440
1433
  attributes: Some(a),
1434
+ user_metadata: Default::default(),
1441
1435
  },
1442
1436
  a @ Attributes::CancelTimerCommandAttributes(_) => Self {
1443
1437
  command_type: CommandType::CancelTimer as i32,
1444
1438
  attributes: Some(a),
1439
+ user_metadata: Default::default(),
1445
1440
  },
1446
1441
  a @ Attributes::CompleteWorkflowExecutionCommandAttributes(_) => Self {
1447
1442
  command_type: CommandType::CompleteWorkflowExecution as i32,
1448
1443
  attributes: Some(a),
1444
+ user_metadata: Default::default(),
1449
1445
  },
1450
1446
  a @ Attributes::FailWorkflowExecutionCommandAttributes(_) => Self {
1451
1447
  command_type: CommandType::FailWorkflowExecution as i32,
1452
1448
  attributes: Some(a),
1449
+ user_metadata: Default::default(),
1453
1450
  },
1454
1451
  a @ Attributes::ScheduleActivityTaskCommandAttributes(_) => Self {
1455
1452
  command_type: CommandType::ScheduleActivityTask as i32,
1456
1453
  attributes: Some(a),
1454
+ user_metadata: Default::default(),
1457
1455
  },
1458
1456
  a @ Attributes::RequestCancelActivityTaskCommandAttributes(_) => Self {
1459
1457
  command_type: CommandType::RequestCancelActivityTask as i32,
1460
1458
  attributes: Some(a),
1459
+ user_metadata: Default::default(),
1461
1460
  },
1462
1461
  a @ Attributes::ContinueAsNewWorkflowExecutionCommandAttributes(_) => {
1463
1462
  Self {
1464
1463
  command_type: CommandType::ContinueAsNewWorkflowExecution
1465
1464
  as i32,
1466
1465
  attributes: Some(a),
1466
+ user_metadata: Default::default(),
1467
1467
  }
1468
1468
  }
1469
1469
  a @ Attributes::CancelWorkflowExecutionCommandAttributes(_) => Self {
1470
1470
  command_type: CommandType::CancelWorkflowExecution as i32,
1471
1471
  attributes: Some(a),
1472
+ user_metadata: Default::default(),
1472
1473
  },
1473
1474
  a @ Attributes::RecordMarkerCommandAttributes(_) => Self {
1474
1475
  command_type: CommandType::RecordMarker as i32,
1475
1476
  attributes: Some(a),
1477
+ user_metadata: Default::default(),
1476
1478
  },
1477
1479
  a @ Attributes::ProtocolMessageCommandAttributes(_) => Self {
1478
1480
  command_type: CommandType::ProtocolMessage as i32,
1479
1481
  attributes: Some(a),
1482
+ user_metadata: Default::default(),
1480
1483
  },
1481
1484
  _ => unimplemented!(),
1482
1485
  }
@@ -1643,6 +1646,33 @@ pub mod temporal {
1643
1646
  }
1644
1647
  }
1645
1648
  }
1649
+ pub mod cloud {
1650
+ pub mod cloudservice {
1651
+ pub mod v1 {
1652
+ tonic::include_proto!("temporal.api.cloud.cloudservice.v1");
1653
+ }
1654
+ }
1655
+ pub mod identity {
1656
+ pub mod v1 {
1657
+ tonic::include_proto!("temporal.api.cloud.identity.v1");
1658
+ }
1659
+ }
1660
+ pub mod namespace {
1661
+ pub mod v1 {
1662
+ tonic::include_proto!("temporal.api.cloud.namespace.v1");
1663
+ }
1664
+ }
1665
+ pub mod operation {
1666
+ pub mod v1 {
1667
+ tonic::include_proto!("temporal.api.cloud.operation.v1");
1668
+ }
1669
+ }
1670
+ pub mod region {
1671
+ pub mod v1 {
1672
+ tonic::include_proto!("temporal.api.cloud.region.v1");
1673
+ }
1674
+ }
1675
+ }
1646
1676
  pub mod common {
1647
1677
  pub mod v1 {
1648
1678
  use crate::{ENCODING_PAYLOAD_KEY, JSON_ENCODING_VAL};
@@ -1920,7 +1950,7 @@ pub mod temporal {
1920
1950
  f,
1921
1951
  "HistoryEvent(id: {}, {:?})",
1922
1952
  self.event_id,
1923
- EventType::try_from(self.event_type)
1953
+ EventType::try_from(self.event_type).unwrap_or_default()
1924
1954
  )
1925
1955
  }
1926
1956
  }
@@ -1312,7 +1312,7 @@ pub fn two_local_activities_one_wft(parallel: bool) -> TestHistoryBuilder {
1312
1312
  t.add_full_wf_task();
1313
1313
  let mut start_time = t.wft_start_time();
1314
1314
  start_time.seconds += 1;
1315
- t.add_local_activity_result_marker_with_time(1, "1", b"hi".into(), start_time.clone());
1315
+ t.add_local_activity_result_marker_with_time(1, "1", b"hi".into(), start_time);
1316
1316
  if !parallel {
1317
1317
  start_time.seconds += 1;
1318
1318
  }
@@ -2,7 +2,9 @@ use futures_util::{sink, stream::FuturesUnordered, FutureExt, StreamExt};
2
2
  use rand::{prelude::Distribution, rngs::SmallRng, Rng, SeedableRng};
3
3
  use std::{future, time::Duration};
4
4
  use temporal_client::{WfClientExt, WorkflowClientTrait, WorkflowOptions};
5
- use temporal_sdk::{ActContext, ActivityOptions, LocalActivityOptions, WfContext, WorkflowResult};
5
+ use temporal_sdk::{
6
+ ActContext, ActivityError, ActivityOptions, LocalActivityOptions, WfContext, WorkflowResult,
7
+ };
6
8
  use temporal_sdk_core_protos::coresdk::{AsJsonPayloadExt, FromJsonPayloadExt, IntoPayloadsExt};
7
9
  use temporal_sdk_core_test_utils::CoreWfStarter;
8
10
  use tokio_util::sync::CancellationToken;
@@ -28,7 +30,7 @@ impl Distribution<FuzzyWfAction> for FuzzyWfActionSampler {
28
30
  }
29
31
  }
30
32
 
31
- async fn echo(_ctx: ActContext, echo_me: String) -> Result<String, anyhow::Error> {
33
+ async fn echo(_ctx: ActContext, echo_me: String) -> Result<String, ActivityError> {
32
34
  Ok(echo_me)
33
35
  }
34
36
 
@@ -5,7 +5,7 @@ use std::{
5
5
  };
6
6
  use temporal_client::{WfClientExt, WorkflowClientTrait, WorkflowOptions};
7
7
  use temporal_sdk::{ActContext, ActivityOptions, WfContext, WorkflowResult};
8
- use temporal_sdk_core::{ResourceBasedSlots, ResourceBasedTuner, ResourceSlotOptions};
8
+ use temporal_sdk_core::{ResourceBasedTuner, ResourceSlotOptions};
9
9
  use temporal_sdk_core_protos::{
10
10
  coresdk::{workflow_commands::ActivityCancellationType, AsJsonPayloadExt},
11
11
  temporal::api::enums::v1::WorkflowIdReusePolicy,
@@ -29,7 +29,7 @@ async fn activity_load() {
29
29
 
30
30
  let activity_id = "act-1";
31
31
  let activity_timeout = Duration::from_secs(8);
32
- let task_queue = starter.get_task_queue().to_owned();
32
+ let task_queue = Some(starter.get_task_queue().to_owned());
33
33
 
34
34
  let wf_fn = move |ctx: WfContext| {
35
35
  let task_queue = task_queue.clone();
@@ -94,7 +94,7 @@ async fn chunky_activities_resource_based() {
94
94
  .clear_max_outstanding_opts()
95
95
  .max_concurrent_wft_polls(10_usize)
96
96
  .max_concurrent_at_polls(10_usize);
97
- let mut tuner = ResourceBasedTuner::new(ResourceBasedSlots::new(0.7, 0.7));
97
+ let mut tuner = ResourceBasedTuner::new(0.7, 0.7);
98
98
  tuner
99
99
  .with_workflow_slots_options(ResourceSlotOptions::new(
100
100
  25,
@@ -1,5 +1,5 @@
1
- use temporal_sdk::ActContext;
1
+ use temporal_sdk::{ActContext, ActivityError};
2
2
 
3
- pub(crate) async fn echo(_ctx: ActContext, e: String) -> anyhow::Result<String> {
3
+ pub(crate) async fn echo(_ctx: ActContext, e: String) -> Result<String, ActivityError> {
4
4
  Ok(e)
5
5
  }