@temporalio/core-bridge 0.23.0 → 1.0.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 (135) hide show
  1. package/Cargo.lock +118 -15
  2. package/Cargo.toml +2 -1
  3. package/LICENSE.md +1 -1
  4. package/README.md +1 -1
  5. package/index.d.ts +47 -18
  6. package/package.json +7 -7
  7. package/releases/aarch64-apple-darwin/index.node +0 -0
  8. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  9. package/releases/x86_64-apple-darwin/index.node +0 -0
  10. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  11. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  12. package/sdk-core/.buildkite/docker/docker-compose.yaml +4 -2
  13. package/sdk-core/ARCHITECTURE.md +9 -7
  14. package/sdk-core/README.md +5 -1
  15. package/sdk-core/arch_docs/diagrams/workflow_internals.svg +1 -0
  16. package/sdk-core/bridge-ffi/src/wrappers.rs +0 -3
  17. package/sdk-core/client/src/lib.rs +26 -8
  18. package/sdk-core/client/src/raw.rs +166 -54
  19. package/sdk-core/client/src/retry.rs +9 -4
  20. package/sdk-core/client/src/workflow_handle/mod.rs +4 -2
  21. package/sdk-core/core/Cargo.toml +2 -0
  22. package/sdk-core/core/src/abstractions.rs +137 -16
  23. package/sdk-core/core/src/core_tests/activity_tasks.rs +258 -63
  24. package/sdk-core/core/src/core_tests/child_workflows.rs +1 -2
  25. package/sdk-core/core/src/core_tests/determinism.rs +2 -2
  26. package/sdk-core/core/src/core_tests/local_activities.rs +8 -7
  27. package/sdk-core/core/src/core_tests/queries.rs +146 -60
  28. package/sdk-core/core/src/core_tests/replay_flag.rs +1 -1
  29. package/sdk-core/core/src/core_tests/workers.rs +39 -23
  30. package/sdk-core/core/src/core_tests/workflow_cancels.rs +1 -1
  31. package/sdk-core/core/src/core_tests/workflow_tasks.rs +387 -280
  32. package/sdk-core/core/src/lib.rs +6 -4
  33. package/sdk-core/core/src/pollers/poll_buffer.rs +16 -10
  34. package/sdk-core/core/src/protosext/mod.rs +6 -6
  35. package/sdk-core/core/src/retry_logic.rs +1 -1
  36. package/sdk-core/core/src/telemetry/metrics.rs +21 -7
  37. package/sdk-core/core/src/telemetry/mod.rs +18 -4
  38. package/sdk-core/core/src/test_help/mod.rs +341 -109
  39. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +18 -9
  40. package/sdk-core/core/src/worker/activities/local_activities.rs +19 -16
  41. package/sdk-core/core/src/worker/activities.rs +156 -29
  42. package/sdk-core/core/src/worker/client.rs +1 -0
  43. package/sdk-core/core/src/worker/mod.rs +132 -659
  44. package/sdk-core/core/src/{workflow → worker/workflow}/bridge.rs +1 -1
  45. package/sdk-core/core/src/{workflow → worker/workflow}/driven_workflow.rs +1 -1
  46. package/sdk-core/core/src/{workflow → worker/workflow}/history_update.rs +16 -2
  47. package/sdk-core/core/src/{workflow → worker/workflow}/machines/activity_state_machine.rs +39 -4
  48. package/sdk-core/core/src/{workflow → worker/workflow}/machines/cancel_external_state_machine.rs +5 -2
  49. package/sdk-core/core/src/{workflow → worker/workflow}/machines/cancel_workflow_state_machine.rs +1 -1
  50. package/sdk-core/core/src/{workflow → worker/workflow}/machines/child_workflow_state_machine.rs +2 -4
  51. package/sdk-core/core/src/{workflow → worker/workflow}/machines/complete_workflow_state_machine.rs +0 -0
  52. package/sdk-core/core/src/{workflow → worker/workflow}/machines/continue_as_new_workflow_state_machine.rs +1 -1
  53. package/sdk-core/core/src/{workflow → worker/workflow}/machines/fail_workflow_state_machine.rs +0 -0
  54. package/sdk-core/core/src/{workflow → worker/workflow}/machines/local_activity_state_machine.rs +2 -5
  55. package/sdk-core/core/src/{workflow → worker/workflow}/machines/mod.rs +1 -1
  56. package/sdk-core/core/src/{workflow → worker/workflow}/machines/mutable_side_effect_state_machine.rs +0 -0
  57. package/sdk-core/core/src/{workflow → worker/workflow}/machines/patch_state_machine.rs +1 -1
  58. package/sdk-core/core/src/{workflow → worker/workflow}/machines/side_effect_state_machine.rs +0 -0
  59. package/sdk-core/core/src/{workflow → worker/workflow}/machines/signal_external_state_machine.rs +4 -2
  60. package/sdk-core/core/src/{workflow → worker/workflow}/machines/timer_state_machine.rs +1 -2
  61. package/sdk-core/core/src/{workflow → worker/workflow}/machines/transition_coverage.rs +1 -1
  62. package/sdk-core/core/src/{workflow → worker/workflow}/machines/upsert_search_attributes_state_machine.rs +5 -7
  63. package/sdk-core/core/src/{workflow → worker/workflow}/machines/workflow_machines/local_acts.rs +2 -2
  64. package/sdk-core/core/src/{workflow → worker/workflow}/machines/workflow_machines.rs +40 -16
  65. package/sdk-core/core/src/{workflow → worker/workflow}/machines/workflow_task_state_machine.rs +0 -0
  66. package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +198 -0
  67. package/sdk-core/core/src/worker/workflow/managed_run.rs +627 -0
  68. package/sdk-core/core/src/worker/workflow/mod.rs +1115 -0
  69. package/sdk-core/core/src/worker/workflow/run_cache.rs +143 -0
  70. package/sdk-core/core/src/worker/workflow/wft_poller.rs +88 -0
  71. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +936 -0
  72. package/sdk-core/core-api/src/errors.rs +3 -10
  73. package/sdk-core/core-api/src/lib.rs +2 -1
  74. package/sdk-core/core-api/src/worker.rs +26 -2
  75. package/sdk-core/etc/dynamic-config.yaml +2 -0
  76. package/sdk-core/integ-with-otel.sh +1 -1
  77. package/sdk-core/protos/api_upstream/Makefile +4 -4
  78. package/sdk-core/protos/api_upstream/api-linter.yaml +2 -0
  79. package/sdk-core/protos/api_upstream/buf.yaml +8 -9
  80. package/sdk-core/protos/api_upstream/temporal/api/cluster/v1/message.proto +83 -0
  81. package/sdk-core/protos/api_upstream/temporal/api/command/v1/message.proto +7 -1
  82. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/cluster.proto +40 -0
  83. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +3 -0
  84. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/reset.proto +3 -1
  85. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/schedule.proto +60 -0
  86. package/sdk-core/protos/api_upstream/temporal/api/enums/v1/workflow.proto +3 -0
  87. package/sdk-core/protos/api_upstream/temporal/api/errordetails/v1/message.proto +32 -4
  88. package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +69 -19
  89. package/sdk-core/protos/api_upstream/temporal/api/namespace/v1/message.proto +13 -0
  90. package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +163 -0
  91. package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +97 -0
  92. package/sdk-core/protos/api_upstream/temporal/api/schedule/v1/message.proto +300 -0
  93. package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +25 -0
  94. package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +180 -3
  95. package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +53 -3
  96. package/sdk-core/protos/local/temporal/sdk/core/activity_result/activity_result.proto +2 -2
  97. package/sdk-core/protos/local/temporal/sdk/core/activity_task/activity_task.proto +6 -5
  98. package/sdk-core/protos/local/temporal/sdk/core/bridge/bridge.proto +0 -1
  99. package/sdk-core/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +2 -1
  100. package/sdk-core/protos/local/temporal/sdk/core/common/common.proto +0 -64
  101. package/sdk-core/protos/local/temporal/sdk/core/core_interface.proto +2 -1
  102. package/sdk-core/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +11 -8
  103. package/sdk-core/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +30 -25
  104. package/sdk-core/sdk/src/activity_context.rs +12 -5
  105. package/sdk-core/sdk/src/app_data.rs +37 -0
  106. package/sdk-core/sdk/src/lib.rs +76 -43
  107. package/sdk-core/sdk/src/workflow_context/options.rs +8 -6
  108. package/sdk-core/sdk/src/workflow_context.rs +14 -19
  109. package/sdk-core/sdk/src/workflow_future.rs +11 -6
  110. package/sdk-core/sdk-core-protos/src/history_builder.rs +19 -5
  111. package/sdk-core/sdk-core-protos/src/history_info.rs +11 -6
  112. package/sdk-core/sdk-core-protos/src/lib.rs +74 -176
  113. package/sdk-core/test-utils/src/lib.rs +85 -72
  114. package/sdk-core/tests/integ_tests/heartbeat_tests.rs +11 -9
  115. package/sdk-core/tests/integ_tests/polling_tests.rs +12 -0
  116. package/sdk-core/tests/integ_tests/queries_tests.rs +39 -22
  117. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +49 -4
  118. package/sdk-core/tests/integ_tests/workflow_tests/appdata_propagation.rs +61 -0
  119. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
  120. package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +74 -13
  121. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +19 -0
  122. package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +1 -1
  123. package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +6 -3
  124. package/sdk-core/tests/integ_tests/workflow_tests.rs +10 -23
  125. package/sdk-core/tests/load_tests.rs +8 -3
  126. package/sdk-core/tests/main.rs +2 -1
  127. package/src/conversions.rs +47 -39
  128. package/src/errors.rs +10 -21
  129. package/src/lib.rs +342 -325
  130. package/sdk-core/core/src/pending_activations.rs +0 -173
  131. package/sdk-core/core/src/worker/wft_delivery.rs +0 -81
  132. package/sdk-core/core/src/workflow/mod.rs +0 -478
  133. package/sdk-core/core/src/workflow/workflow_tasks/cache_manager.rs +0 -194
  134. package/sdk-core/core/src/workflow/workflow_tasks/concurrency_manager.rs +0 -418
  135. package/sdk-core/core/src/workflow/workflow_tasks/mod.rs +0 -989
@@ -4,7 +4,6 @@ use prost_types::TimestampOutOfSystemRangeError;
4
4
  use temporal_sdk_core_protos::coresdk::{
5
5
  activity_result::ActivityExecutionResult,
6
6
  workflow_activation::remove_from_cache::EvictionReason,
7
- workflow_completion::WorkflowActivationCompletion,
8
7
  };
9
8
 
10
9
  /// Errors thrown by [crate::Worker::poll_workflow_activation]
@@ -44,16 +43,13 @@ pub enum PollActivityError {
44
43
  #[allow(clippy::large_enum_variant)]
45
44
  pub enum CompleteWfError {
46
45
  /// Lang SDK sent us a malformed workflow completion. This likely means a bug in the lang sdk.
47
- #[error("Lang SDK sent us a malformed workflow completion ({reason}): {completion:?}")]
46
+ #[error("Lang SDK sent us a malformed workflow completion for run ({run_id}): {reason}")]
48
47
  MalformedWorkflowCompletion {
49
48
  /// Reason the completion was malformed
50
49
  reason: String,
51
- /// The completion, which may not be included to avoid unnecessary copies.
52
- completion: Option<WorkflowActivationCompletion>,
50
+ /// The run associated with the completion
51
+ run_id: String,
53
52
  },
54
- /// There is no worker registered for the queue being polled
55
- #[error("No worker registered for queue: {0}")]
56
- NoWorkerForQueue(String),
57
53
  /// Unhandled error when calling the temporal server. Core will attempt to retry any non-fatal
58
54
  /// errors, so lang should consider this fatal.
59
55
  #[error("Unhandled grpc error when completing workflow task: {0:?}")]
@@ -75,9 +71,6 @@ pub enum CompleteActivityError {
75
71
  /// errors, so lang should consider this fatal.
76
72
  #[error("Unhandled grpc error when completing activity: {0:?}")]
77
73
  TonicError(#[from] tonic::Status),
78
- /// There is no worker registered or alive for the activity being completed
79
- #[error("No worker registered or alive for queue: {0}")]
80
- NoWorkerForQueue(String),
81
74
  }
82
75
 
83
76
  /// Errors thrown inside of workflow machines
@@ -90,7 +90,8 @@ pub trait Worker: Send + Sync {
90
90
  /// Return this worker's config
91
91
  fn get_config(&self) -> &WorkerConfig;
92
92
 
93
- /// TODO: Will be replaced/fixed/whatever by shutdown refactoring
93
+ /// Initiate shutdown. See [Worker::shutdown], this is just a sync version that starts the
94
+ /// process. You can then wait on `shutdown` or [Worker::finalize_shutdown].
94
95
  fn initiate_shutdown(&self);
95
96
 
96
97
  /// Initiates async shutdown procedure, eventually ceases all polling of the server and shuts
@@ -10,6 +10,14 @@ pub struct WorkerConfig {
10
10
  /// What task queue will this worker poll from? This task queue name will be used for both
11
11
  /// workflow and activity polling.
12
12
  pub task_queue: String,
13
+ /// A string that should be unique to the set of code this worker uses. IE: All the workflow,
14
+ /// activity, interceptor, and data converter code.
15
+ pub worker_build_id: String,
16
+ /// A human-readable string that can identify this worker. Using something like sdk version
17
+ /// and host name is a good default. If set, overrides the identity set (if any) on the client
18
+ /// used by this worker.
19
+ #[builder(default)]
20
+ pub client_identity_override: Option<String>,
13
21
  /// If set nonzero, workflows will be cached and sticky task queues will be used, meaning that
14
22
  /// history updates are applied incrementally to suspended instances of workflow execution.
15
23
  /// Workflows are evicted according to a least-recently-used policy one the cache maximum is
@@ -71,8 +79,15 @@ pub struct WorkerConfig {
71
79
  /// server-side. Note that this only takes effect upon an activity poll request. If multiple
72
80
  /// workers on the same queue have different values set, they will thrash with the last poller
73
81
  /// winning.
74
- #[builder(setter(strip_option), default)]
82
+ #[builder(default)]
75
83
  pub max_task_queue_activities_per_second: Option<f64>,
84
+
85
+ /// Limits the number of activities per second that this worker will process. The worker will
86
+ /// not poll for new activities if by doing so it might receive and execute an activity which
87
+ /// would cause it to exceed this limit. Negative, zero, or NaN values will cause building
88
+ /// the options to fail.
89
+ #[builder(default)]
90
+ pub max_worker_activities_per_second: Option<f64>,
76
91
  }
77
92
 
78
93
  impl WorkerConfig {
@@ -92,13 +107,22 @@ impl WorkerConfigBuilder {
92
107
  if self.max_concurrent_wft_polls == Some(0) {
93
108
  return Err("`max_concurrent_wft_polls` must be at least 1".to_owned());
94
109
  }
95
- if self.max_outstanding_workflow_tasks > self.max_cached_workflows {
110
+ if self.max_cached_workflows > Some(0)
111
+ && self.max_outstanding_workflow_tasks > self.max_cached_workflows
112
+ {
96
113
  return Err(
97
114
  "Maximum concurrent workflow tasks cannot exceed the maximum number of cached \
98
115
  workflows"
99
116
  .to_owned(),
100
117
  );
101
118
  }
119
+ if let Some(Some(ref x)) = self.max_worker_activities_per_second {
120
+ if !x.is_normal() || x.is_sign_negative() {
121
+ return Err(
122
+ "`max_worker_activities_per_second` must be positive and nonzero".to_owned(),
123
+ );
124
+ }
125
+ }
102
126
  Ok(())
103
127
  }
104
128
  }
@@ -0,0 +1,2 @@
1
+ system.enableActivityLocalDispatch:
2
+ - value: true
@@ -4,4 +4,4 @@
4
4
  export TEMPORAL_INTEG_OTEL_URL="grpc://localhost:4317"
5
5
  export TEMPORAL_TRACING_FILTER="temporal_sdk_core=DEBUG"
6
6
 
7
- cargo integ-test
7
+ cargo integ-test "${@:1}"
@@ -45,21 +45,21 @@ fix-path:
45
45
  ##### Plugins & tools #####
46
46
  grpc-install: gogo-protobuf-install
47
47
  printf $(COLOR) "Install/update gRPC plugins..."
48
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
48
+ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0
49
49
 
50
50
  gogo-protobuf-install: go-protobuf-install
51
51
  GO111MODULE=off go get github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick
52
52
 
53
53
  go-protobuf-install:
54
- go install github.com/golang/protobuf/protoc-gen-go@v1.4.3
54
+ go install github.com/golang/protobuf/protoc-gen-go@v1.5.2
55
55
 
56
56
  api-linter-install:
57
57
  printf $(COLOR) "Install/update api-linter..."
58
- go install github.com/googleapis/api-linter/cmd/api-linter@v1.22.0
58
+ go install github.com/googleapis/api-linter/cmd/api-linter@v1.31.0
59
59
 
60
60
  buf-install:
61
61
  printf $(COLOR) "Install/update buf..."
62
- go install github.com/bufbuild/buf/cmd/buf@v0.43.2
62
+ go install github.com/bufbuild/buf/cmd/buf@v1.4.0
63
63
 
64
64
  ##### Linters #####
65
65
  api-linter:
@@ -11,6 +11,7 @@
11
11
 
12
12
  - included_paths:
13
13
  - '**/workflowservice/v1/request_response.proto'
14
+ - '**/operatorservice/v1/request_response.proto'
14
15
  disabled_rules:
15
16
  - 'core::0122::name-suffix'
16
17
  - 'core::0131::request-name-required'
@@ -27,6 +28,7 @@
27
28
 
28
29
  - included_paths:
29
30
  - '**/workflowservice/v1/service.proto'
31
+ - '**/operatorservice/v1/service.proto'
30
32
  disabled_rules:
31
33
  - 'core::0127::http-annotation'
32
34
  - 'core::0131::method-signature'
@@ -1,12 +1,11 @@
1
- version: v1beta1
2
- build:
3
- roots:
4
- - .
5
- lint:
1
+ version: v1
2
+ breaking:
6
3
  ignore:
7
- - dependencies
4
+ - temporal/api/schedule/v1
8
5
  use:
9
- - DEFAULT
10
- breaking:
6
+ - PACKAGE
7
+ lint:
11
8
  use:
12
- - PACKAGE
9
+ - DEFAULT
10
+ ignore:
11
+ - dependencies
@@ -0,0 +1,83 @@
1
+ // The MIT License
2
+ //
3
+ // Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ // of this software and associated documentation files (the "Software"), to deal
7
+ // in the Software without restriction, including without limitation the rights
8
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ // copies of the Software, and to permit persons to whom the Software is
10
+ // furnished to do so, subject to the following conditions:
11
+ //
12
+ // The above copyright notice and this permission notice shall be included in
13
+ // all copies or substantial portions of the Software.
14
+ //
15
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ // THE SOFTWARE.
22
+
23
+ syntax = "proto3";
24
+
25
+ package temporal.api.cluster.v1;
26
+
27
+ option go_package = "go.temporal.io/api/cluster/v1;cluster";
28
+ option java_package = "io.temporal.api.cluster.v1";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "MessageProto";
31
+ option ruby_package = "Temporal::Api::Cluster::V1";
32
+ option csharp_namespace = "Temporal.Api.Cluster.V1";
33
+
34
+ import "dependencies/gogoproto/gogo.proto";
35
+ import "google/protobuf/timestamp.proto";
36
+
37
+ import "temporal/api/enums/v1/cluster.proto";
38
+ import "temporal/api/enums/v1/common.proto";
39
+ import "temporal/api/version/v1/message.proto";
40
+
41
+ // data column
42
+ message ClusterMetadata {
43
+ string cluster = 1;
44
+ int32 history_shard_count = 2;
45
+ string cluster_id = 3;
46
+ temporal.api.version.v1.VersionInfo version_info = 4;
47
+ map<string,IndexSearchAttributes> index_search_attributes = 5;
48
+ string cluster_address = 6;
49
+ int64 failover_version_increment = 7;
50
+ int64 initial_failover_version = 8;
51
+ bool is_global_namespace_enabled = 9;
52
+ bool is_connection_enabled = 10;
53
+ }
54
+
55
+ message IndexSearchAttributes{
56
+ map<string,temporal.api.enums.v1.IndexedValueType> custom_search_attributes = 1;
57
+ }
58
+
59
+ message HostInfo {
60
+ string identity = 1;
61
+ }
62
+
63
+ message RingInfo {
64
+ string role = 1;
65
+ int32 member_count = 2;
66
+ repeated HostInfo members = 3;
67
+ }
68
+
69
+ message MembershipInfo {
70
+ HostInfo current_host = 1;
71
+ repeated string reachable_members = 2;
72
+ repeated RingInfo rings = 3;
73
+ }
74
+
75
+ message ClusterMember {
76
+ temporal.api.enums.v1.ClusterMemberRole role = 1;
77
+ string host_id = 2;
78
+ string rpc_address = 3;
79
+ int32 rpc_port = 4;
80
+ google.protobuf.Timestamp session_start_time = 5 [(gogoproto.stdtime) = true];
81
+ google.protobuf.Timestamp last_heartbit_time = 6 [(gogoproto.stdtime) = true];
82
+ google.protobuf.Timestamp record_expiry_time = 7 [(gogoproto.stdtime) = true];
83
+ }
@@ -44,7 +44,8 @@ import "temporal/api/taskqueue/v1/message.proto";
44
44
  message ScheduleActivityTaskCommandAttributes {
45
45
  string activity_id = 1;
46
46
  temporal.api.common.v1.ActivityType activity_type = 2;
47
- string namespace = 3;
47
+ // This used to be a `namespace` field which allowed to schedule activity in another namespace.
48
+ reserved 3;
48
49
  temporal.api.taskqueue.v1.TaskQueue task_queue = 4;
49
50
  temporal.api.common.v1.Header header = 5;
50
51
  temporal.api.common.v1.Payloads input = 6;
@@ -79,6 +80,9 @@ message ScheduleActivityTaskCommandAttributes {
79
80
  // dynamic configuration. Retries will be attempted until `schedule_to_close_timeout` has
80
81
  // elapsed. To disable retries set retry_policy.maximum_attempts to 1.
81
82
  temporal.api.common.v1.RetryPolicy retry_policy = 11;
83
+ // Request to start the activity directly bypassing matching service and worker polling
84
+ // The slot for executing the activity should be reserved when setting this field to true.
85
+ bool request_eager_execution = 12;
82
86
  }
83
87
 
84
88
  message RequestCancelActivityTaskCommandAttributes {
@@ -124,6 +128,8 @@ message RequestCancelExternalWorkflowExecutionCommandAttributes {
124
128
  // command. The request will be rejected if it is set to true and the target workflow is *not*
125
129
  // a child of the requesting workflow.
126
130
  bool child_workflow_only = 5;
131
+ // Reason for requesting the cancellation
132
+ string reason = 6;
127
133
  }
128
134
 
129
135
  message SignalExternalWorkflowExecutionCommandAttributes {
@@ -0,0 +1,40 @@
1
+ // The MIT License
2
+ //
3
+ // Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ // of this software and associated documentation files (the "Software"), to deal
7
+ // in the Software without restriction, including without limitation the rights
8
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ // copies of the Software, and to permit persons to whom the Software is
10
+ // furnished to do so, subject to the following conditions:
11
+ //
12
+ // The above copyright notice and this permission notice shall be included in
13
+ // all copies or substantial portions of the Software.
14
+ //
15
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ // THE SOFTWARE.
22
+
23
+ syntax = "proto3";
24
+
25
+ package temporal.api.enums.v1;
26
+
27
+ option go_package = "go.temporal.io/api/enums/v1;enums";
28
+ option java_package = "io.temporal.api.enums.v1";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "ClusterProto";
31
+ option ruby_package = "Temporal::Api::Enums::V1";
32
+ option csharp_namespace = "Temporal.Api.Enums.V1";
33
+
34
+ enum ClusterMemberRole {
35
+ CLUSTER_MEMBER_ROLE_UNSPECIFIED = 0;
36
+ CLUSTER_MEMBER_ROLE_FRONTEND = 1;
37
+ CLUSTER_MEMBER_ROLE_HISTORY = 2;
38
+ CLUSTER_MEMBER_ROLE_MATCHING = 3;
39
+ CLUSTER_MEMBER_ROLE_WORKER = 4;
40
+ }
@@ -71,16 +71,19 @@ enum WorkflowTaskFailedCause {
71
71
  enum StartChildWorkflowExecutionFailedCause {
72
72
  START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0;
73
73
  START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_EXISTS = 1;
74
+ START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_NAMESPACE_NOT_FOUND = 2;
74
75
  }
75
76
 
76
77
  enum CancelExternalWorkflowExecutionFailedCause {
77
78
  CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0;
78
79
  CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND = 1;
80
+ CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_NAMESPACE_NOT_FOUND = 2;
79
81
  }
80
82
 
81
83
  enum SignalExternalWorkflowExecutionFailedCause {
82
84
  SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0;
83
85
  SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND = 1;
86
+ SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_NAMESPACE_NOT_FOUND = 2;
84
87
  }
85
88
 
86
89
  enum ResourceExhaustedCause {
@@ -31,7 +31,9 @@ option java_outer_classname = "ResetProto";
31
31
  option ruby_package = "Temporal::Api::Enums::V1";
32
32
  option csharp_namespace = "Temporal.Api.Enums.V1";
33
33
 
34
- // TODO: What is this?
34
+ // Reset reapplay(replay) options
35
+ // * RESET_REAPPLY_TYPE_SIGNAL (default) - Signals are reapplied when workflow is reset
36
+ // * RESET_REAPPLY_TYPE_NONE - nothing is reapplied
35
37
  enum ResetReapplyType {
36
38
  RESET_REAPPLY_TYPE_UNSPECIFIED = 0;
37
39
  RESET_REAPPLY_TYPE_SIGNAL = 1;
@@ -0,0 +1,60 @@
1
+ // The MIT License
2
+ //
3
+ // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ // of this software and associated documentation files (the "Software"), to deal
7
+ // in the Software without restriction, including without limitation the rights
8
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ // copies of the Software, and to permit persons to whom the Software is
10
+ // furnished to do so, subject to the following conditions:
11
+ //
12
+ // The above copyright notice and this permission notice shall be included in
13
+ // all copies or substantial portions of the Software.
14
+ //
15
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ // THE SOFTWARE.
22
+
23
+ syntax = "proto3";
24
+
25
+ package temporal.api.enums.v1;
26
+
27
+ option go_package = "go.temporal.io/api/enums/v1;enums";
28
+ option java_package = "io.temporal.api.enums.v1";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "ScheduleProto";
31
+ option ruby_package = "Temporal::Api::Enums::V1";
32
+ option csharp_namespace = "Temporal.Api.Enums.V1";
33
+
34
+
35
+ // ScheduleOverlapPolicy controls what happens when a workflow would be started
36
+ // by a schedule, and is already running.
37
+ enum ScheduleOverlapPolicy {
38
+ SCHEDULE_OVERLAP_POLICY_UNSPECIFIED = 0;
39
+ // SCHEDULE_OVERLAP_POLICY_SKIP (default) means don't start anything. When the
40
+ // workflow completes, the next scheduled event after that time will be considered.
41
+ SCHEDULE_OVERLAP_POLICY_SKIP = 1;
42
+ // SCHEDULE_OVERLAP_POLICY_BUFFER_ONE means start the workflow again soon as the
43
+ // current one completes, but only buffer one start in this way. If another start is
44
+ // supposed to happen when the workflow is running, and one is already buffered, then
45
+ // only the first one will be started after the running workflow finishes.
46
+ SCHEDULE_OVERLAP_POLICY_BUFFER_ONE = 2;
47
+ // SCHEDULE_OVERLAP_POLICY_BUFFER_ALL means buffer up any number of starts to all
48
+ // happen sequentially, immediately after the running workflow completes.
49
+ SCHEDULE_OVERLAP_POLICY_BUFFER_ALL = 3;
50
+ // SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER means that if there is another workflow
51
+ // running, cancel it, and start the new one after the old one completes cancellation.
52
+ SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER = 4;
53
+ // SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER means that if there is another workflow
54
+ // running, terminate it and start the new one immediately.
55
+ SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER = 5;
56
+ // SCHEDULE_OVERLAP_POLICY_ALLOW_ALL means start any number of concurrent workflows.
57
+ // Note that with this policy, last completion result and last failure will not be
58
+ // available since workflows are not sequential.
59
+ SCHEDULE_OVERLAP_POLICY_ALLOW_ALL = 6;
60
+ }
@@ -43,6 +43,9 @@ enum WorkflowIdReusePolicy {
43
43
  // Do not permit re-use of the workflow id for this workflow. Future start workflow requests
44
44
  // could potentially change the policy, allowing re-use of the workflow id.
45
45
  WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3;
46
+ // If a workflow is running using the same workflow ID, terminate it and start a new one.
47
+ // If no running workflow, then the behavior is the same as ALLOW_DUPLICATE
48
+ WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING = 4;
46
49
  }
47
50
 
48
51
  // Defines how child workflows will react to their parent completing
@@ -22,7 +22,8 @@
22
22
 
23
23
  syntax = "proto3";
24
24
 
25
- // These error details extend failures defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
25
+ // These error details are supplied in google.rpc.Status#details as described in "Google APIs, Error Model" (https://cloud.google.com/apis/design/errors#error_model)
26
+ // and extend standard Error Details defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
26
27
 
27
28
  package temporal.api.errordetails.v1;
28
29
 
@@ -33,7 +34,10 @@ option java_outer_classname = "MessageProto";
33
34
  option ruby_package = "Temporal::Api::ErrorDetails::V1";
34
35
  option csharp_namespace = "Temporal.Api.ErrorDetails.V1";
35
36
 
37
+ import "temporal/api/common/v1/message.proto";
38
+
36
39
  import "temporal/api/enums/v1/failed_cause.proto";
40
+ import "temporal/api/enums/v1/namespace.proto";
37
41
 
38
42
  message NotFoundFailure {
39
43
  string current_cluster = 1;
@@ -51,6 +55,22 @@ message NamespaceNotActiveFailure {
51
55
  string active_cluster = 3;
52
56
  }
53
57
 
58
+ message NamespaceInvalidStateFailure {
59
+ string namespace = 1;
60
+ // Current state of the requested namespace.
61
+ temporal.api.enums.v1.NamespaceState state = 2;
62
+ // Allowed namespace states for requested operation.
63
+ // For example NAMESPACE_STATE_DELETED is forbidden for most operations but allowed for DescribeNamespace.
64
+ repeated temporal.api.enums.v1.NamespaceState allowed_states = 3;
65
+ }
66
+
67
+ message NamespaceNotFoundFailure {
68
+ string namespace = 1;
69
+ }
70
+
71
+ message NamespaceAlreadyExistsFailure {
72
+ }
73
+
54
74
  message ClientVersionNotSupportedFailure {
55
75
  string client_version = 1;
56
76
  string client_name = 2;
@@ -62,9 +82,6 @@ message ServerVersionNotSupportedFailure {
62
82
  string client_supported_server_versions = 2;
63
83
  }
64
84
 
65
- message NamespaceAlreadyExistsFailure {
66
- }
67
-
68
85
  message CancellationAlreadyRequestedFailure {
69
86
  }
70
87
 
@@ -78,3 +95,14 @@ message PermissionDeniedFailure {
78
95
  message ResourceExhaustedFailure {
79
96
  temporal.api.enums.v1.ResourceExhaustedCause cause = 1;
80
97
  }
98
+
99
+ message SystemWorkflowFailure {
100
+ // WorkflowId and RunId of the Temporal system workflow performing the underlying operation.
101
+ // Looking up the info of the system workflow run may help identify the issue causing the failure.
102
+ temporal.api.common.v1.WorkflowExecution workflow_execution = 1;
103
+ // Serialized error returned by the system workflow performing the underlying operation.
104
+ string workflow_error = 2;
105
+ }
106
+
107
+ message WorkflowNotReadyFailure {
108
+ }