@temporalio/core-bridge 0.19.2 → 0.20.2

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 (125) hide show
  1. package/Cargo.lock +90 -157
  2. package/Cargo.toml +1 -0
  3. package/index.d.ts +11 -27
  4. package/package.json +3 -3
  5. package/releases/aarch64-apple-darwin/index.node +0 -0
  6. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  7. package/releases/x86_64-apple-darwin/index.node +0 -0
  8. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  9. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  10. package/sdk-core/.buildkite/docker/Dockerfile +1 -1
  11. package/sdk-core/.buildkite/docker/docker-compose.yaml +1 -1
  12. package/sdk-core/.cargo/config.toml +1 -0
  13. package/sdk-core/CODEOWNERS +1 -1
  14. package/sdk-core/bridge-ffi/include/sdk-core-bridge.h +119 -86
  15. package/sdk-core/bridge-ffi/src/lib.rs +311 -315
  16. package/sdk-core/bridge-ffi/src/wrappers.rs +108 -113
  17. package/sdk-core/client/Cargo.toml +13 -9
  18. package/sdk-core/client/LICENSE.txt +23 -0
  19. package/sdk-core/client/src/lib.rs +286 -174
  20. package/sdk-core/client/src/metrics.rs +86 -12
  21. package/sdk-core/client/src/raw.rs +566 -0
  22. package/sdk-core/client/src/retry.rs +137 -99
  23. package/sdk-core/core/Cargo.toml +15 -10
  24. package/sdk-core/core/LICENSE.txt +23 -0
  25. package/sdk-core/core/benches/workflow_replay.rs +79 -0
  26. package/sdk-core/core/src/abstractions.rs +38 -0
  27. package/sdk-core/core/src/core_tests/activity_tasks.rs +108 -182
  28. package/sdk-core/core/src/core_tests/child_workflows.rs +16 -11
  29. package/sdk-core/core/src/core_tests/determinism.rs +24 -12
  30. package/sdk-core/core/src/core_tests/local_activities.rs +53 -27
  31. package/sdk-core/core/src/core_tests/mod.rs +30 -43
  32. package/sdk-core/core/src/core_tests/queries.rs +82 -81
  33. package/sdk-core/core/src/core_tests/workers.rs +111 -296
  34. package/sdk-core/core/src/core_tests/workflow_cancels.rs +4 -4
  35. package/sdk-core/core/src/core_tests/workflow_tasks.rs +257 -242
  36. package/sdk-core/core/src/lib.rs +73 -318
  37. package/sdk-core/core/src/pollers/mod.rs +4 -6
  38. package/sdk-core/core/src/pollers/poll_buffer.rs +20 -14
  39. package/sdk-core/core/src/protosext/mod.rs +7 -10
  40. package/sdk-core/core/src/replay/mod.rs +11 -150
  41. package/sdk-core/core/src/telemetry/metrics.rs +35 -2
  42. package/sdk-core/core/src/telemetry/mod.rs +49 -16
  43. package/sdk-core/core/src/telemetry/prometheus_server.rs +14 -35
  44. package/sdk-core/core/src/test_help/mod.rs +104 -170
  45. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +57 -34
  46. package/sdk-core/core/src/worker/activities/local_activities.rs +95 -23
  47. package/sdk-core/core/src/worker/activities.rs +23 -16
  48. package/sdk-core/core/src/worker/client/mocks.rs +86 -0
  49. package/sdk-core/core/src/worker/client.rs +209 -0
  50. package/sdk-core/core/src/worker/mod.rs +207 -108
  51. package/sdk-core/core/src/workflow/driven_workflow.rs +21 -6
  52. package/sdk-core/core/src/workflow/history_update.rs +107 -24
  53. package/sdk-core/core/src/workflow/machines/activity_state_machine.rs +2 -3
  54. package/sdk-core/core/src/workflow/machines/child_workflow_state_machine.rs +2 -3
  55. package/sdk-core/core/src/workflow/machines/mod.rs +20 -17
  56. package/sdk-core/core/src/workflow/machines/signal_external_state_machine.rs +56 -19
  57. package/sdk-core/core/src/workflow/machines/transition_coverage.rs +5 -0
  58. package/sdk-core/core/src/workflow/machines/upsert_search_attributes_state_machine.rs +230 -22
  59. package/sdk-core/core/src/workflow/machines/workflow_machines.rs +81 -115
  60. package/sdk-core/core/src/workflow/machines/workflow_task_state_machine.rs +4 -4
  61. package/sdk-core/core/src/workflow/mod.rs +13 -1
  62. package/sdk-core/core/src/workflow/workflow_tasks/concurrency_manager.rs +70 -11
  63. package/sdk-core/core/src/workflow/workflow_tasks/mod.rs +65 -41
  64. package/sdk-core/core-api/Cargo.toml +9 -1
  65. package/sdk-core/core-api/LICENSE.txt +23 -0
  66. package/sdk-core/core-api/src/errors.rs +7 -38
  67. package/sdk-core/core-api/src/lib.rs +44 -52
  68. package/sdk-core/core-api/src/worker.rs +10 -2
  69. package/sdk-core/etc/deps.svg +127 -96
  70. package/sdk-core/protos/api_upstream/temporal/api/command/v1/message.proto +11 -7
  71. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +10 -0
  72. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/namespace.proto +6 -1
  73. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/workflow.proto +6 -0
  74. package/sdk-core/protos/api_upstream/temporal/api/errordetails/v1/message.proto +6 -0
  75. package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +2 -1
  76. package/sdk-core/protos/api_upstream/temporal/api/replication/v1/message.proto +3 -0
  77. package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +12 -0
  78. package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +25 -0
  79. package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +4 -0
  80. package/sdk-core/protos/local/temporal/sdk/core/bridge/bridge.proto +19 -35
  81. package/sdk-core/protos/local/temporal/sdk/core/core_interface.proto +2 -6
  82. package/sdk-core/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +53 -11
  83. package/sdk-core/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +14 -7
  84. package/sdk-core/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +3 -5
  85. package/sdk-core/sdk/Cargo.toml +16 -2
  86. package/sdk-core/sdk/LICENSE.txt +23 -0
  87. package/sdk-core/sdk/src/interceptors.rs +11 -0
  88. package/sdk-core/sdk/src/lib.rs +139 -151
  89. package/sdk-core/sdk/src/workflow_context/options.rs +86 -1
  90. package/sdk-core/sdk/src/workflow_context.rs +36 -17
  91. package/sdk-core/sdk/src/workflow_future.rs +19 -25
  92. package/sdk-core/sdk-core-protos/Cargo.toml +1 -1
  93. package/sdk-core/sdk-core-protos/build.rs +1 -0
  94. package/sdk-core/sdk-core-protos/src/history_info.rs +17 -4
  95. package/sdk-core/sdk-core-protos/src/lib.rs +251 -47
  96. package/sdk-core/test-utils/Cargo.toml +3 -1
  97. package/sdk-core/test-utils/src/canned_histories.rs +27 -0
  98. package/sdk-core/test-utils/src/histfetch.rs +3 -3
  99. package/sdk-core/test-utils/src/lib.rs +223 -68
  100. package/sdk-core/tests/integ_tests/client_tests.rs +27 -4
  101. package/sdk-core/tests/integ_tests/heartbeat_tests.rs +93 -14
  102. package/sdk-core/tests/integ_tests/polling_tests.rs +18 -12
  103. package/sdk-core/tests/integ_tests/queries_tests.rs +50 -53
  104. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +117 -103
  105. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +8 -1
  106. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +10 -5
  107. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +7 -1
  108. package/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +32 -9
  109. package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +7 -1
  110. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +76 -15
  111. package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +19 -3
  112. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +39 -42
  113. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +84 -0
  114. package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +30 -8
  115. package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +21 -6
  116. package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +26 -16
  117. package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +66 -0
  118. package/sdk-core/tests/integ_tests/workflow_tests.rs +78 -74
  119. package/sdk-core/tests/load_tests.rs +9 -6
  120. package/sdk-core/tests/main.rs +43 -10
  121. package/src/conversions.rs +7 -12
  122. package/src/lib.rs +322 -357
  123. package/sdk-core/client/src/mocks.rs +0 -167
  124. package/sdk-core/core/src/worker/dispatcher.rs +0 -171
  125. package/sdk-core/protos/local/temporal/sdk/core/bridge/service.proto +0 -61
@@ -31,6 +31,8 @@ option java_outer_classname = "MessageProto";
31
31
  option ruby_package = "Temporal::Api::Replication::V1";
32
32
  option csharp_namespace = "Temporal.Api.Replication.V1";
33
33
 
34
+ import "temporal/api/enums/v1/namespace.proto";
35
+
34
36
  message ClusterReplicationConfig {
35
37
  string cluster_name = 1;
36
38
  }
@@ -38,4 +40,5 @@ message ClusterReplicationConfig {
38
40
  message NamespaceReplicationConfig {
39
41
  string active_cluster_name = 1;
40
42
  repeated ClusterReplicationConfig clusters = 2;
43
+ temporal.api.enums.v1.ReplicationState state = 3;
41
44
  }
@@ -89,6 +89,18 @@ message PendingChildExecutionInfo {
89
89
  temporal.api.enums.v1.ParentClosePolicy parent_close_policy = 5;
90
90
  }
91
91
 
92
+ message PendingWorkflowTaskInfo {
93
+ temporal.api.enums.v1.PendingWorkflowTaskState state = 1;
94
+ google.protobuf.Timestamp scheduled_time = 2 [(gogoproto.stdtime) = true];
95
+ // original_scheduled_time is the scheduled time of the first workflow task during workflow task heartbeat.
96
+ // Heartbeat workflow task is done by RespondWorkflowTaskComplete with ForceCreateNewWorkflowTask == true and no command
97
+ // In this case, OriginalScheduledTime won't change. Then when current time - original_scheduled_time exceeds
98
+ // some threshold, the workflow task will be forced timeout.
99
+ google.protobuf.Timestamp original_scheduled_time = 3 [(gogoproto.stdtime) = true];
100
+ google.protobuf.Timestamp started_time = 4 [(gogoproto.stdtime) = true];
101
+ int32 attempt = 5;
102
+ }
103
+
92
104
  message ResetPoints {
93
105
  repeated ResetPointInfo points = 1;
94
106
  }
@@ -708,6 +708,7 @@ message DescribeWorkflowExecutionResponse {
708
708
  temporal.api.workflow.v1.WorkflowExecutionInfo workflow_execution_info = 2;
709
709
  repeated temporal.api.workflow.v1.PendingActivityInfo pending_activities = 3;
710
710
  repeated temporal.api.workflow.v1.PendingChildExecutionInfo pending_children = 4;
711
+ temporal.api.workflow.v1.PendingWorkflowTaskInfo pending_workflow_task = 5;
711
712
  }
712
713
 
713
714
  message DescribeTaskQueueRequest {
@@ -739,6 +740,30 @@ message GetClusterInfoResponse {
739
740
  string visibility_store = 8;
740
741
  }
741
742
 
743
+ message GetSystemInfoRequest {
744
+ }
745
+
746
+ message GetSystemInfoResponse {
747
+ // Version of the server.
748
+ string server_version = 1;
749
+
750
+ // All capabilities the system supports.
751
+ Capabilities capabilities = 2;
752
+
753
+ // System capability details.
754
+ message Capabilities {
755
+ // True if signal and query headers are supported.
756
+ bool signal_and_query_header = 1;
757
+
758
+ // True if internal errors are differentiated from other types of errors for purposes of
759
+ // retrying non-internal errors.
760
+ //
761
+ // When unset/false, clients retry all failures. When true, clients should only retry
762
+ // non-internal errors.
763
+ bool internal_error_differentiation = 2;
764
+ }
765
+ }
766
+
742
767
  message ListTaskQueuePartitionsRequest {
743
768
  string namespace = 1;
744
769
  temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
@@ -312,6 +312,10 @@ service WorkflowService {
312
312
  rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse){
313
313
  }
314
314
 
315
+ // GetSystemInfo returns information about the system.
316
+ rpc GetSystemInfo(GetSystemInfoRequest) returns (GetSystemInfoResponse) {
317
+ }
318
+
315
319
  rpc ListTaskQueuePartitions(ListTaskQueuePartitionsRequest) returns (ListTaskQueuePartitionsResponse) {
316
320
  }
317
321
  }
@@ -20,21 +20,23 @@ enum LogLevel {
20
20
  TRACE = 6;
21
21
  }
22
22
 
23
- message InitRequest {
24
- GatewayOptions gateway_options = 1;
25
- TelemetryOptions telemetry_options = 2;
26
-
27
- message GatewayOptions {
28
- string target_url = 1;
29
- string namespace = 2;
30
- string client_name = 3;
31
- string client_version = 4;
32
- map<string, string> static_headers = 5;
33
- string identity = 6;
34
- string worker_binary_id = 7;
35
- TlsConfig tls_config = 8;
36
- RetryConfig retry_config = 9;
37
- }
23
+ message InitTelemetryRequest {
24
+ string otel_collector_url = 1;
25
+ string tracing_filter = 2;
26
+ LogLevel log_forwarding_level = 3;
27
+ string prometheus_export_bind_address = 4;
28
+ }
29
+
30
+ message CreateClientRequest {
31
+ string target_url = 1;
32
+ string namespace = 2;
33
+ string client_name = 3;
34
+ string client_version = 4;
35
+ map<string, string> static_headers = 5;
36
+ string identity = 6;
37
+ string worker_binary_id = 7;
38
+ TlsConfig tls_config = 8;
39
+ RetryConfig retry_config = 9;
38
40
 
39
41
  message TlsConfig {
40
42
  bytes server_root_ca_cert = 1;
@@ -51,13 +53,6 @@ message InitRequest {
51
53
  google.protobuf.Duration max_elapsed_time = 5;
52
54
  google.protobuf.UInt32Value max_retries = 6;
53
55
  }
54
-
55
- message TelemetryOptions {
56
- string otel_collector_url = 1;
57
- string tracing_filter = 2;
58
- LogLevel log_forwarding_level = 3;
59
- string prometheus_export_bind_address = 4;
60
- }
61
56
  }
62
57
 
63
58
  message InitResponse {
@@ -68,7 +63,7 @@ message InitResponse {
68
63
  }
69
64
  }
70
65
 
71
- message RegisterWorkerRequest {
66
+ message CreateWorkerRequest {
72
67
  string task_queue = 1;
73
68
  google.protobuf.UInt32Value max_cached_workflows = 2;
74
69
  google.protobuf.UInt32Value max_outstanding_workflow_tasks = 3;
@@ -88,12 +83,10 @@ message RegisterWorkerResponse {
88
83
 
89
84
  message Error {
90
85
  string message = 1;
91
- bool worker_already_registered = 2;
92
86
  }
93
87
  }
94
88
 
95
89
  message PollWorkflowActivationRequest {
96
- string task_queue = 1;
97
90
  }
98
91
 
99
92
  message PollWorkflowActivationResponse {
@@ -109,7 +102,6 @@ message PollWorkflowActivationResponse {
109
102
  }
110
103
 
111
104
  message PollActivityTaskRequest {
112
- string task_queue = 1;
113
105
  }
114
106
 
115
107
  message PollActivityTaskResponse {
@@ -161,8 +153,7 @@ message RecordActivityHeartbeatResponse {
161
153
  }
162
154
 
163
155
  message RequestWorkflowEvictionRequest {
164
- string task_queue = 1;
165
- string run_id = 2;
156
+ string run_id = 1;
166
157
  }
167
158
 
168
159
  message RequestWorkflowEvictionResponse {
@@ -173,14 +164,7 @@ message RequestWorkflowEvictionResponse {
173
164
  }
174
165
  }
175
166
 
176
- message ShutdownRequest {
177
- }
178
-
179
- message ShutdownResponse {
180
- }
181
-
182
167
  message ShutdownWorkerRequest {
183
- string task_queue = 1;
184
168
  }
185
169
 
186
170
  message ShutdownWorkerResponse {
@@ -19,15 +19,11 @@ import "temporal/sdk/core/workflow_completion/workflow_completion.proto";
19
19
  // A request as given to `record_activity_heartbeat`
20
20
  message ActivityHeartbeat {
21
21
  bytes task_token = 1;
22
- // The task queue / worker this activity is associated with
23
- string task_queue = 2;
24
- repeated common.Payload details = 3;
22
+ repeated common.Payload details = 2;
25
23
  }
26
24
 
27
25
  // A request as given to `complete_activity_task`
28
26
  message ActivityTaskCompletion {
29
27
  bytes task_token = 1;
30
- // The task queue / worker this task is associated with
31
- string task_queue = 2;
32
- activity_result.ActivityExecutionResult result = 3;
28
+ activity_result.ActivityExecutionResult result = 2;
33
29
  }
@@ -7,7 +7,10 @@ syntax = "proto3";
7
7
  package coresdk.workflow_activation;
8
8
 
9
9
  import "google/protobuf/timestamp.proto";
10
+ import "google/protobuf/duration.proto";
10
11
  import "temporal/api/failure/v1/message.proto";
12
+ import "temporal/api/common/v1/message.proto";
13
+ import "temporal/api/enums/v1/workflow.proto";
11
14
  import "temporal/sdk/core/activity_result/activity_result.proto";
12
15
  import "temporal/sdk/core/child_workflow/child_workflow.proto";
13
16
  import "temporal/sdk/core/common/common.proto";
@@ -63,22 +66,56 @@ message WorkflowActivationJob {
63
66
  }
64
67
  }
65
68
 
66
- /// Start a new workflow
69
+ // Start a new workflow
67
70
  message StartWorkflow {
68
- /// The identifier the lang-specific sdk uses to execute workflow code
71
+ // The identifier the lang-specific sdk uses to execute workflow code
69
72
  string workflow_type = 1;
70
- /// The workflow id used on the temporal server
73
+ // The workflow id used on the temporal server
71
74
  string workflow_id = 2;
72
- /// Inputs to the workflow code
75
+ // Inputs to the workflow code
73
76
  repeated common.Payload arguments = 3;
74
- /// The seed must be used to initialize the random generator used by SDK.
75
- /// RandomSeedUpdatedAttributes are used to deliver seed updates.
77
+ // The seed must be used to initialize the random generator used by SDK.
78
+ // RandomSeedUpdatedAttributes are used to deliver seed updates.
76
79
  uint64 randomness_seed = 4;
77
- /// Used to add metadata e.g. for tracing and auth, meant to be read and written to by interceptors.
80
+ // Used to add metadata e.g. for tracing and auth, meant to be read and written to by interceptors.
78
81
  map<string, common.Payload> headers = 5;
79
-
80
- // TODO: Do we need namespace here, or should that just be fetchable easily?
81
- // will be others - workflow exe started attrs, etc
82
+ // Identity of the client who requested this execution
83
+ string identity = 6;
84
+ // If this workflow is a child, information about the parent
85
+ common.NamespacedWorkflowExecution parent_workflow_info = 7;
86
+ // Total workflow execution timeout including retries and continue as new.
87
+ google.protobuf.Duration workflow_execution_timeout = 8;
88
+ // Timeout of a single workflow run.
89
+ google.protobuf.Duration workflow_run_timeout = 9;
90
+ // Timeout of a single workflow task.
91
+ google.protobuf.Duration workflow_task_timeout = 10;
92
+ // Run id of the previous workflow which continued-as-new or retired or cron executed into this
93
+ // workflow, if any.
94
+ string continued_from_execution_run_id = 11;
95
+ // If this workflow was a continuation, indicates the type of continuation.
96
+ temporal.api.enums.v1.ContinueAsNewInitiator continued_initiator = 12;
97
+ // If this workflow was a continuation and that continuation failed, the details of that.
98
+ temporal.api.failure.v1.Failure continued_failure = 13;
99
+ // If this workflow was a continuation and that continuation completed, the details of that.
100
+ temporal.api.common.v1.Payloads last_completion_result = 14;
101
+ // This is the very first run id the workflow ever had, following continuation chains.
102
+ string first_execution_run_id = 15;
103
+ // This workflow's retry policy
104
+ temporal.api.common.v1.RetryPolicy retry_policy = 16;
105
+ // Starting at 1, the number of times we have tried to execute this workflow
106
+ int32 attempt = 17;
107
+ // If this workflow runs on a cron schedule, it will appear here
108
+ string cron_schedule = 18;
109
+ // The absolute time at which the workflow will be timed out.
110
+ // This is passed without change to the next run/retry of a workflow.
111
+ google.protobuf.Timestamp workflow_execution_expiration_time = 19;
112
+ // For a cron workflow, this contains the amount of time between when this iteration of
113
+ // the cron workflow was scheduled and when it should run next per its cron_schedule.
114
+ google.protobuf.Duration cron_schedule_to_schedule_interval = 20;
115
+ // User-defined memo
116
+ temporal.api.common.v1.Memo memo = 21;
117
+ // Search attributes created/updated when this workflow was started
118
+ temporal.api.common.v1.SearchAttributes search_attributes = 22;
82
119
  }
83
120
 
84
121
  /// Notify a workflow that a timer has fired
@@ -147,6 +184,8 @@ message QueryWorkflow {
147
184
  /// The query's function/method/etc name
148
185
  string query_type = 2;
149
186
  repeated common.Payload arguments = 3;
187
+ /// Headers attached to the query
188
+ map<string, common.Payload> headers = 5;
150
189
  }
151
190
 
152
191
  /// Cancel a running workflow
@@ -155,11 +194,14 @@ message CancelWorkflow {
155
194
  repeated common.Payload details = 1;
156
195
  }
157
196
 
158
- /// Send a signal to a workflow
197
+ // Send a signal to a workflow
159
198
  message SignalWorkflow {
160
199
  string signal_name = 1;
161
200
  repeated common.Payload input = 2;
201
+ // Identity of the sender of the signal
162
202
  string identity = 3;
203
+ // Headers attached to the signal
204
+ map<string, common.Payload> headers = 5;
163
205
  }
164
206
 
165
207
  // Inform lang what the result of a call to `patched` or similar API should be -- this is always
@@ -32,9 +32,7 @@ message WorkflowCommand {
32
32
  CancelSignalWorkflow cancel_signal_workflow = 15;
33
33
  ScheduleLocalActivity schedule_local_activity = 16;
34
34
  RequestCancelLocalActivity request_cancel_local_activity = 17;
35
-
36
- // To be added as/if needed:
37
- // UpsertWorkflowSearchAttributes upsert_workflow_search_attributes_command_attributes = 14;
35
+ UpsertWorkflowSearchAttributes upsert_workflow_search_attributes_command_attributes = 18;
38
36
  }
39
37
  }
40
38
 
@@ -57,7 +55,7 @@ message ScheduleActivity {
57
55
  string namespace = 4;
58
56
  // The name of the task queue to place this activity request in
59
57
  string task_queue = 5;
60
- map<string, common.Payload> header_fields = 6;
58
+ map<string, common.Payload> headers = 6;
61
59
  /// Arguments/input to the activity. Called "input" upstream.
62
60
  repeated common.Payload arguments = 7;
63
61
  /// Indicates how long the caller is willing to wait for an activity completion. Limits how long
@@ -93,7 +91,7 @@ message ScheduleLocalActivity {
93
91
  /// If this local activity is a retry (as per the attempt field) this needs to be the original
94
92
  /// scheduling time (as provided in `DoBackoff`)
95
93
  google.protobuf.Timestamp original_schedule_time = 5;
96
- map<string, common.Payload> header_fields = 6;
94
+ map<string, common.Payload> headers = 6;
97
95
  /// Arguments/input to the activity.
98
96
  repeated common.Payload arguments = 7;
99
97
  /// Indicates how long the caller is willing to wait for local activity completion. Limits how
@@ -187,7 +185,7 @@ message ContinueAsNewWorkflowExecution {
187
185
  /// Memo fields
188
186
  map<string, common.Payload> memo = 6;
189
187
  /// Header fields
190
- map<string, common.Payload> header = 7;
188
+ map<string, common.Payload> headers = 7;
191
189
  /// Search attributes
192
190
  map<string, common.Payload> search_attributes = 8;
193
191
  }
@@ -230,7 +228,7 @@ message StartChildWorkflowExecution {
230
228
  common.RetryPolicy retry_policy = 13;
231
229
  string cron_schedule = 14;
232
230
  /// Header fields
233
- map<string, common.Payload> header = 15;
231
+ map<string, common.Payload> headers = 15;
234
232
  /// Memo fields
235
233
  map<string, common.Payload> memo = 16;
236
234
  /// Search attributes
@@ -273,6 +271,8 @@ message SignalExternalWorkflowExecution {
273
271
  string signal_name = 4;
274
272
  /// Arguments for the handler
275
273
  repeated common.Payload args = 5;
274
+ /// Headers to attach to the signal
275
+ map<string, common.Payload> headers = 6;
276
276
  }
277
277
 
278
278
  /// Can be used to cancel not-already-sent `SignalExternalWorkflowExecution` commands
@@ -280,3 +280,10 @@ message CancelSignalWorkflow {
280
280
  /// Lang's incremental sequence number as passed to `SignalExternalWorkflowExecution`
281
281
  uint32 seq = 1;
282
282
  }
283
+
284
+ message UpsertWorkflowSearchAttributes {
285
+ /// Lang's incremental sequence number as passed to `UpsertWorkflowSearchAttributes`
286
+ uint32 seq = 1;
287
+ /// SearchAttributes fields - equivalent to indexed_fields on api. Key = search index, Value = value?
288
+ map<string, common.Payload> search_attributes = 2;
289
+ }
@@ -8,13 +8,11 @@ import "temporal/sdk/core/workflow_commands/workflow_commands.proto";
8
8
 
9
9
  /// Result of a single workflow activation, reported from lang to core
10
10
  message WorkflowActivationCompletion {
11
- // The task queue the workflow activation you are completing originated from
12
- string task_queue = 1;
13
11
  // The run id from the workflow activation you are completing
14
- string run_id = 2;
12
+ string run_id = 1;
15
13
  oneof status {
16
- Success successful = 3;
17
- Failure failed = 4;
14
+ Success successful = 2;
15
+ Failure failed = 3;
18
16
  }
19
17
  }
20
18
 
@@ -2,19 +2,29 @@
2
2
  name = "temporal-sdk"
3
3
  version = "0.1.0-alpha.1"
4
4
  edition = "2021"
5
+ authors = ["Spencer Judge <spencer@temporal.io>"]
6
+ license-file = "LICENSE.txt"
7
+ description = "Temporal Rust SDK"
8
+ homepage = "https://temporal.io/"
9
+ repository = "https://github.com/temporalio/sdk-core"
10
+ keywords = ["temporal", "workflow"]
11
+ categories = ["development-tools"]
5
12
 
6
13
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
14
 
8
15
  [dependencies]
9
16
  anyhow = "1.0"
17
+ base64 = "0.13"
10
18
  crossbeam = "0.8"
11
19
  derive_more = "0.99"
12
20
  futures = "0.3"
13
- parking_lot = { version = "0.11", features = ["send_guard"] }
21
+ once_cell = "1.10"
22
+ parking_lot = { version = "0.12", features = ["send_guard"] }
14
23
  prost-types = "0.9"
24
+ sha2 = "0.10"
15
25
  serde = "1.0"
16
26
  tokio = { version = "1.1", features = ["rt", "rt-multi-thread", "parking_lot", "time", "fs"] }
17
- tokio-util = { version = "0.6.9" }
27
+ tokio-util = { version = "0.7" }
18
28
  tokio-stream = "0.1"
19
29
  tonic = "0.6"
20
30
  tracing = { version = "0.1", features = ["log-always"] }
@@ -30,3 +40,7 @@ version = "0.1"
30
40
  [dependencies.temporal-sdk-core-api]
31
41
  path = "../core-api"
32
42
  version = "0.1"
43
+
44
+ [dependencies.temporal-client]
45
+ path = "../client"
46
+ version = "0.1"
@@ -0,0 +1,23 @@
1
+ Temporal Core SDK
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2021 Temporal Technologies, Inc. All Rights Reserved
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ //! User-definable interceptors are defined in this module
2
+
3
+ use temporal_sdk_core_protos::coresdk::workflow_completion::WorkflowActivationCompletion;
4
+
5
+ /// Implementors can intercept certain actions that happen within the Worker.
6
+ ///
7
+ /// Advanced usage only.
8
+ pub trait WorkerInterceptor {
9
+ /// Called every time a workflow activation completes
10
+ fn on_workflow_activation_completion(&self, completion: &WorkflowActivationCompletion);
11
+ }