Skip to content

Commit c9fab7a

Browse files
committed
Merge remote-tracking branch 'origin/master' into standalone-nexus-op
# Conflicts: # openapi/openapiv2.json # openapi/openapiv3.yaml # temporal/api/common/v1/message.proto
2 parents eb533ff + 6f298e7 commit c9fab7a

10 files changed

Lines changed: 390 additions & 77 deletions

File tree

openapi/openapiv2.json

Lines changed: 187 additions & 56 deletions
Large diffs are not rendered by default.

openapi/openapiv3.yaml

Lines changed: 81 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8878,6 +8878,11 @@ components:
88788878
canceledReason:
88798879
type: string
88808880
description: Set if activity cancelation was requested.
8881+
links:
8882+
type: array
8883+
items:
8884+
$ref: '#/components/schemas/Link'
8885+
description: Links to related entities, such as the entity that started this activity.
88818886
description: Information about a standalone activity.
88828887
ActivityExecutionListInfo:
88838888
type: object
@@ -9708,10 +9713,6 @@ components:
97089713
allOf:
97099714
- $ref: '#/components/schemas/Callback'
97109715
description: Information on how this callback should be invoked (e.g. its URL and type).
9711-
trigger:
9712-
allOf:
9713-
- $ref: '#/components/schemas/CallbackInfo_Trigger'
9714-
description: Trigger for this callback.
97159716
registrationTime:
97169717
type: string
97179718
description: The time when the callback was registered.
@@ -9726,6 +9727,7 @@ components:
97269727
- CALLBACK_STATE_SUCCEEDED
97279728
- CALLBACK_STATE_BLOCKED
97289729
type: string
9730+
description: The current state of the callback.
97299731
format: enum
97309732
attempt:
97319733
type: integer
@@ -9748,16 +9750,7 @@ components:
97489750
blockedReason:
97499751
type: string
97509752
description: If the state is BLOCKED, blocked reason provides additional information.
9751-
description: CallbackInfo contains the state of an attached workflow callback.
9752-
CallbackInfo_Trigger:
9753-
type: object
9754-
properties:
9755-
workflowClosed:
9756-
$ref: '#/components/schemas/CallbackInfo_WorkflowClosed'
9757-
CallbackInfo_WorkflowClosed:
9758-
type: object
9759-
properties: {}
9760-
description: Trigger for when the workflow is closed.
9753+
description: Common callback information. Specific CallbackInfo messages should embed this and may include additional fields.
97619754
Callback_Internal:
97629755
type: object
97639756
properties:
@@ -10581,6 +10574,11 @@ components:
1058110574
type: string
1058210575
description: Token for follow-on long-poll requests. Absent only if the activity is complete.
1058310576
format: bytes
10577+
callbacks:
10578+
type: array
10579+
items:
10580+
$ref: '#/components/schemas/CallbackInfo'
10581+
description: Callbacks attached to this activity execution and their current state.
1058410582
DescribeBatchOperationResponse:
1058510583
type: object
1058610584
properties:
@@ -11427,7 +11425,7 @@ components:
1142711425
type: array
1142811426
items:
1142911427
$ref: '#/components/schemas/Link'
11430-
description: Links associated with the event.
11428+
description: Links to related entities, such as the entity that started this event's workflow.
1143111429
principal:
1143211430
allOf:
1143311431
- $ref: '#/components/schemas/Principal'
@@ -11565,9 +11563,28 @@ components:
1156511563
sourceDeploymentRevisionNumber:
1156611564
type: string
1156711565
description: The revision number of the source deployment version of the parent/previous workflow.
11566+
continueAsNewInitialVersioningBehavior:
11567+
enum:
11568+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_UNSPECIFIED
11569+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_AUTO_UPGRADE
11570+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_USE_RAMPING_VERSION
11571+
type: string
11572+
description: |-
11573+
Experimental.
11574+
If this workflow is the result of a continue-as-new, this field is set to the initial_versioning_behavior
11575+
specified in that command.
11576+
Only used for the initial task of this run and the initial task of any retries of this run.
11577+
Not passed to children or to future continue-as-new.
11578+
11579+
Note: In the first release of Upgrade-on-CaN, when the only ContinueAsNewVersioningBehavior was AutoUpgrade,
11580+
a non-empty InheritedAutoUpgradeInfo meant that the workflow should start as AutoUpgrade. So for compatibility
11581+
with history events generated during that time, know that an UNSPECIFIED value here is equivalent to AutoUpgrade
11582+
value if the InheritedAutoUpgradeInfo is non-empty.
11583+
format: enum
1156811584
description: |-
1156911585
Used as part of WorkflowExecutionStartedEventAttributes to pass down the AutoUpgrade behavior and source deployment version
1157011586
to a workflow execution whose parent/previous workflow has an AutoUpgrade behavior.
11587+
Also used for Upgrade-on-CaN behaviors AutoUpgrade and UseRampingVersion.
1157111588
Input:
1157211589
type: object
1157311590
properties:
@@ -11612,13 +11629,25 @@ components:
1161211629
$ref: '#/components/schemas/Link_WorkflowEvent'
1161311630
batchJob:
1161411631
$ref: '#/components/schemas/Link_BatchJob'
11632+
activity:
11633+
$ref: '#/components/schemas/Link_Activity'
1161511634
nexusOperation:
1161611635
$ref: '#/components/schemas/Link_NexusOperation'
1161711636
description: |-
1161811637
Link can be associated with history events. It might contain information about an external entity
1161911638
related to the history event. For example, workflow A makes a Nexus call that starts workflow B:
1162011639
in this case, a history event in workflow A could contain a Link to the workflow started event in
1162111640
workflow B, and vice-versa.
11641+
Link_Activity:
11642+
type: object
11643+
properties:
11644+
namespace:
11645+
type: string
11646+
activityId:
11647+
type: string
11648+
runId:
11649+
type: string
11650+
description: A link to an activity.
1162211651
Link_BatchJob:
1162311652
type: object
1162411653
properties:
@@ -15280,6 +15309,20 @@ components:
1528015309
allOf:
1528115310
- $ref: '#/components/schemas/Priority'
1528215311
description: Priority metadata.
15312+
completionCallbacks:
15313+
type: array
15314+
items:
15315+
$ref: '#/components/schemas/Callback'
15316+
description: |-
15317+
Callbacks to be called by the server when this activity reaches a terminal state.
15318+
Callback addresses must be whitelisted in the server's dynamic configuration.
15319+
links:
15320+
type: array
15321+
items:
15322+
$ref: '#/components/schemas/Link'
15323+
description: |-
15324+
Links to be associated with the activity. Callbacks may also have associated links;
15325+
links already included with a callback should not be duplicated here.
1528315326
StartActivityExecutionResponse:
1528415327
type: object
1528515328
properties:
@@ -15289,6 +15332,10 @@ components:
1528915332
started:
1529015333
type: boolean
1529115334
description: If true, a new activity was started.
15335+
link:
15336+
allOf:
15337+
- $ref: '#/components/schemas/Link'
15338+
description: Link to the started activity.
1529215339
StartBatchOperationRequest:
1529315340
type: object
1529415341
properties:
@@ -17875,6 +17922,7 @@ components:
1787517922
enum:
1787617923
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_UNSPECIFIED
1787717924
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_AUTO_UPGRADE
17925+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_USE_RAMPING_VERSION
1787817926
type: string
1787917927
description: |-
1788017928
Experimental. Optionally decide the versioning behavior that the first task of the new run should use.
@@ -18649,6 +18697,24 @@ components:
1864918697
Note: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not
1865018698
face the problem of inconsistent dispatching that arises from eventual consistency between
1865118699
task queues and their partitions.
18700+
continueAsNewInitialVersioningBehavior:
18701+
enum:
18702+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_UNSPECIFIED
18703+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_AUTO_UPGRADE
18704+
- CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_USE_RAMPING_VERSION
18705+
type: string
18706+
description: |-
18707+
Experimental.
18708+
If this workflow is the result of a continue-as-new, this field is set to the initial_versioning_behavior
18709+
specified in that command.
18710+
Only used for the initial task of this run and the initial task of any retries of this run.
18711+
Not passed to children or to future continue-as-new.
18712+
18713+
Note: In the first release of Upgrade-on-CaN, when the only ContinueAsNewVersioningBehavior was AutoUpgrade,
18714+
a non-empty InheritedAutoUpgradeInfo meant that the workflow should start as AutoUpgrade. So for compatibility
18715+
with ContinueAsNew history commands generated during that time, know that an UNSPECIFIED value here is equivalent
18716+
to ContinueAsNewVersioningBehaviorAutoUpgrade if the behavior of the workflow is AutoUpgrade.
18717+
format: enum
1865218718
description: |-
1865318719
Holds all the information about worker versioning for a particular workflow execution.
1865418720
Experimental. Versioning info is experimental and might change in the future.

temporal/api/activity/v1/message.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import "google/protobuf/timestamp.proto";
1515
import "temporal/api/common/v1/message.proto";
1616
import "temporal/api/deployment/v1/message.proto";
1717
import "temporal/api/enums/v1/activity.proto";
18+
import "temporal/api/callback/v1/message.proto";
1819
import "temporal/api/enums/v1/workflow.proto";
1920
import "temporal/api/failure/v1/message.proto";
2021
import "temporal/api/taskqueue/v1/message.proto";
@@ -161,6 +162,9 @@ message ActivityExecutionInfo {
161162

162163
// Set if activity cancelation was requested.
163164
string canceled_reason = 32;
165+
166+
// Links to related entities, such as the entity that started this activity.
167+
repeated temporal.api.common.v1.Link links = 33;
164168
}
165169

166170
// Limited activity information returned in the list response.
@@ -195,3 +199,20 @@ message ActivityExecutionListInfo {
195199
// This field is only populated if the activity is closed.
196200
google.protobuf.Duration execution_duration = 11;
197201
}
202+
203+
// CallbackInfo contains the state of an attached activity callback.
204+
message CallbackInfo {
205+
// Trigger for when the activity is closed.
206+
message ActivityClosed {}
207+
208+
message Trigger {
209+
oneof variant {
210+
ActivityClosed activity_closed = 1;
211+
}
212+
}
213+
214+
// Trigger for this callback.
215+
Trigger trigger = 1;
216+
// Common callback info.
217+
temporal.api.callback.v1.CallbackInfo info = 2;
218+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
package temporal.api.callback.v1;
4+
5+
option go_package = "go.temporal.io/api/callback/v1;callback";
6+
option java_package = "io.temporal.api.callback.v1";
7+
option java_multiple_files = true;
8+
option java_outer_classname = "MessageProto";
9+
option ruby_package = "Temporalio::Api::Callback::V1";
10+
option csharp_namespace = "Temporalio.Api.Callback.V1";
11+
12+
import "google/protobuf/timestamp.proto";
13+
14+
import "temporal/api/common/v1/message.proto";
15+
import "temporal/api/enums/v1/common.proto";
16+
import "temporal/api/failure/v1/message.proto";
17+
18+
// Common callback information. Specific CallbackInfo messages should embed this and may include additional fields.
19+
message CallbackInfo {
20+
// Information on how this callback should be invoked (e.g. its URL and type).
21+
temporal.api.common.v1.Callback callback = 1;
22+
// The time when the callback was registered.
23+
google.protobuf.Timestamp registration_time = 2;
24+
// The current state of the callback.
25+
temporal.api.enums.v1.CallbackState state = 3;
26+
// The number of attempts made to deliver the callback.
27+
// This number represents a minimum bound since the attempt is incremented after the callback request completes.
28+
int32 attempt = 4;
29+
// The time when the last attempt completed.
30+
google.protobuf.Timestamp last_attempt_complete_time = 5;
31+
// The last attempt's failure, if any.
32+
temporal.api.failure.v1.Failure last_attempt_failure = 6;
33+
// The time when the next attempt is scheduled.
34+
google.protobuf.Timestamp next_attempt_schedule_time = 7;
35+
// If the state is BLOCKED, blocked reason provides additional information.
36+
string blocked_reason = 8;
37+
}

temporal/api/common/v1/message.proto

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ message Link {
240240
string job_id = 1;
241241
}
242242

243+
// A link to an activity.
244+
message Activity {
245+
string namespace = 1;
246+
string activity_id = 2;
247+
string run_id = 3;
248+
}
249+
243250
// A link to a standalone Nexus operation.
244251
message NexusOperation {
245252
string namespace = 1;
@@ -250,7 +257,8 @@ message Link {
250257
oneof variant {
251258
WorkflowEvent workflow_event = 1;
252259
BatchJob batch_job = 2;
253-
NexusOperation nexus_operation = 3;
260+
Activity activity = 3;
261+
NexusOperation nexus_operation = 4;
254262
}
255263
}
256264

temporal/api/deployment/v1/message.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ option csharp_namespace = "Temporalio.Api.Deployment.V1";
1111

1212
import "google/protobuf/timestamp.proto";
1313

14+
import "temporal/api/enums/v1/workflow.proto";
1415
import "temporal/api/enums/v1/deployment.proto";
1516
import "temporal/api/enums/v1/task_queue.proto";
1617
import "temporal/api/common/v1/message.proto";
@@ -316,9 +317,21 @@ message RoutingConfig {
316317

317318
// Used as part of WorkflowExecutionStartedEventAttributes to pass down the AutoUpgrade behavior and source deployment version
318319
// to a workflow execution whose parent/previous workflow has an AutoUpgrade behavior.
320+
// Also used for Upgrade-on-CaN behaviors AutoUpgrade and UseRampingVersion.
319321
message InheritedAutoUpgradeInfo {
320322
// The source deployment version of the parent/previous workflow.
321323
temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1;
322324
// The revision number of the source deployment version of the parent/previous workflow.
323325
int64 source_deployment_revision_number = 2;
326+
// Experimental.
327+
// If this workflow is the result of a continue-as-new, this field is set to the initial_versioning_behavior
328+
// specified in that command.
329+
// Only used for the initial task of this run and the initial task of any retries of this run.
330+
// Not passed to children or to future continue-as-new.
331+
//
332+
// Note: In the first release of Upgrade-on-CaN, when the only ContinueAsNewVersioningBehavior was AutoUpgrade,
333+
// a non-empty InheritedAutoUpgradeInfo meant that the workflow should start as AutoUpgrade. So for compatibility
334+
// with history events generated during that time, know that an UNSPECIFIED value here is equivalent to AutoUpgrade
335+
// value if the InheritedAutoUpgradeInfo is non-empty.
336+
temporal.api.enums.v1.ContinueAsNewVersioningBehavior continue_as_new_initial_versioning_behavior = 3;
324337
}

temporal/api/enums/v1/workflow.proto

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,31 @@ enum VersioningBehavior {
178178
enum ContinueAsNewVersioningBehavior {
179179
CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_UNSPECIFIED = 0;
180180

181+
// Experimental.
181182
// Start the new run with AutoUpgrade behavior. Use the Target Version of the workflow's task queue at
182183
// start-time, as AutoUpgrade workflows do. After the first workflow task completes, use whatever
183184
// Versioning Behavior the workflow is annotated with in the workflow code.
184185
//
185-
// Note that if the previous workflow had a Pinned override, that override will be inherited by the
186+
// Note that if the workflow being continued has a Pinned override, that override will be inherited by the
186187
// new workflow run regardless of the ContinueAsNewVersioningBehavior specified in the continue-as-new
187-
// command. If a Pinned override is inherited by the new run, and the new run starts with AutoUpgrade
188-
// behavior, the base version of the new run will be the Target Version as described above, but the
189-
// effective version will be whatever is specified by the Versioning Override until the override is removed.
188+
// command. Versioning Override always takes precedence until it's removed manually via UpdateWorkflowExecutionOptions.
190189
CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_AUTO_UPGRADE = 1;
190+
191+
// Experimental.
192+
// Use the Ramping Version of the workflow's task queue at start time, regardless of the workflow's
193+
// Target Version (according to f(workflow_id, ramp_percentage)). After the first workflow task completes,
194+
// the workflow will use whatever Versioning Behavior it is annotated with. If there is no Ramping
195+
// Version by the time that the first workflow task is dispatched, it will be sent to the Current Version.
196+
//
197+
// It is highly discouraged to use this if the workflow is annotated with AutoUpgrade behavior, because
198+
// this setting ONLY applies to the first task of the workflow. If, after the first task, the workflow
199+
// is AutoUpgrade, it will behave like a normal AutoUpgrade workflow and go to the Target Version, which
200+
// may be the Current Version instead of the Ramping Version.
201+
//
202+
// Note that if the workflow being continued has a Pinned override, that override will be inherited by the
203+
// new workflow run regardless of the ContinueAsNewVersioningBehavior specified in the continue-as-new
204+
// command. Versioning Override always takes precedence until it's removed manually via UpdateWorkflowExecutionOptions.
205+
CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_USE_RAMPING_VERSION = 2;
191206
}
192207

193208
// SuggestContinueAsNewReason specifies why SuggestContinueAsNew is true.

temporal/api/history/v1/message.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ message HistoryEvent {
11521152
// * timer_started_event_attributes - summary represents an identifier for the timer for use by
11531153
// user interfaces.
11541154
temporal.api.sdk.v1.UserMetadata user_metadata = 301;
1155-
// Links associated with the event.
1155+
// Links to related entities, such as the entity that started this event's workflow.
11561156
repeated temporal.api.common.v1.Link links = 302;
11571157
// Server-computed authenticated caller identity associated with this event.
11581158
temporal.api.common.v1.Principal principal = 303;

temporal/api/workflow/v1/message.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ message WorkflowExecutionVersioningInfo {
231231
// face the problem of inconsistent dispatching that arises from eventual consistency between
232232
// task queues and their partitions.
233233
int64 revision_number = 8;
234+
// Experimental.
235+
// If this workflow is the result of a continue-as-new, this field is set to the initial_versioning_behavior
236+
// specified in that command.
237+
// Only used for the initial task of this run and the initial task of any retries of this run.
238+
// Not passed to children or to future continue-as-new.
239+
//
240+
// Note: In the first release of Upgrade-on-CaN, when the only ContinueAsNewVersioningBehavior was AutoUpgrade,
241+
// a non-empty InheritedAutoUpgradeInfo meant that the workflow should start as AutoUpgrade. So for compatibility
242+
// with ContinueAsNew history commands generated during that time, know that an UNSPECIFIED value here is equivalent
243+
// to ContinueAsNewVersioningBehaviorAutoUpgrade if the behavior of the workflow is AutoUpgrade.
244+
temporal.api.enums.v1.ContinueAsNewVersioningBehavior continue_as_new_initial_versioning_behavior = 9;
234245
}
235246

236247
// Holds information about ongoing transition of a workflow execution from one deployment to another.

0 commit comments

Comments
 (0)