Skip to content

Commit caf4573

Browse files
committed
all inheritance decisions on producer
1 parent 2d6a6d8 commit caf4573

3 files changed

Lines changed: 33 additions & 107 deletions

File tree

openapi/openapiv2.json

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7190,26 +7190,6 @@
71907190
},
71917191
"description": "RequestIdReference is a indirect reference to a history event through the request ID."
71927192
},
7193-
"WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo": {
7194-
"type": "object",
7195-
"properties": {
7196-
"deploymentVersion": {
7197-
"$ref": "#/definitions/v1WorkerDeploymentVersion"
7198-
},
7199-
"behavior": {
7200-
"$ref": "#/definitions/v1VersioningBehavior",
7201-
"description": "Base versioning behavior of source workflow."
7202-
},
7203-
"taskQueue": {
7204-
"type": "string",
7205-
"description": "Task queue name of source workflow if different from started workflow."
7206-
},
7207-
"pinnedOverride": {
7208-
"$ref": "#/definitions/v1VersioningOverride",
7209-
"description": "Override of source workflow if that override is pinned.\nPinned overrides are automatically inherited by child workflows,\ncontinue-as-new workflows, workflow retries, and cron workflows."
7210-
}
7211-
}
7212-
},
72137193
"WorkflowRuleActionActionActivityPause": {
72147194
"type": "object"
72157195
},
@@ -15611,7 +15591,7 @@
1561115591
},
1561215592
"versioningOverride": {
1561315593
"$ref": "#/definitions/v1VersioningOverride",
15614-
"description": "Versioning override applied to this workflow when it was started."
15594+
"description": "Versioning override applied to this workflow when it was started.\nChildren, crons, retries, and continue-as-new will inherit source run's override if pinned\nand if the new workflow's Task Queue belongs to the override version."
1561515595
},
1561615596
"parentPinnedWorkerDeploymentVersion": {
1561715597
"type": "string",
@@ -15621,13 +15601,9 @@
1562115601
"$ref": "#/definitions/v1Priority",
1562215602
"title": "Priority metadata"
1562315603
},
15624-
"previousRunVersioningInfo": {
15625-
"$ref": "#/definitions/WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo",
15626-
"description": "When present, this workflow is part of a retry and/or ContinueAsNew chain, and the previous run in the\nchain was versioned. The `initiator` field of this event specifies why this new workflow was initiated.\nIf present, and the previous run's base behavior is PINNED, and the new run's Task Queue belongs\nto the previous run's Version, the new run will inherit the previous run's Version.\n\nIf initiated by a workflow ContinueAsNew, always populate.\n\nIf initiated by a workflow Cron, never populate, because new cron workflows should start their own version chain.\n\nIf initiated by a workflow retry, pass the retried run's `previous_run_versioning_info`, because a retry of a\nroot workflow or Cron workflow should not inherit the Pinned Version, but if the retried workflow has a PINNED\nparent or is part of a Pinned continue-as-new chain, the the new workflow should inherit the version of the\nexisting tree or chain.\n\nIf a versioning override is present, it will take precedence over the inherited base version."
15627-
},
15628-
"parentVersioningInfo": {
15629-
"$ref": "#/definitions/WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo",
15630-
"description": "When present, this is a child workflow of a versioned parent.\nIf the parent's base behavior is PINNED, and the child's Task Queue belongs to the\nparent's Version, the child workflow will inherit the parent's Version.\n\nIf `versioning_override` is present, it will take precedence over the inherited base version.\nIf `previous_run_versioning_info` is present, it will take precedence over `parent_versioning_info`."
15604+
"inheritedPinnedVersion": {
15605+
"$ref": "#/definitions/v1WorkerDeploymentVersion",
15606+
"description": "If present, the new workflow should start on this version with pinned base behavior.\nChild of pinned parent will inherit the parent's version if the Child's Task Queue belongs to that version.\n\nNew run initiated by workflow ContinueAsNew of pinned run, will inherit the previous run's version if the\nnew run's Task Queue belongs to that version.\n\nNew run initiated by workflow Cron will never inherit.\n\nNew run initiated by workflow Retry will only inherit if the retried run is effectively pinned at the time\nof retry, and the retried run inherited a pinned version when it started (ie. it is a child of a pinned\nparent, or a CaN of a pinned run, and is running on a Task Queue in the inherited version).\n\nPinned override is inherited if Task Queue of new run is compatible with the override version.\nOverride is inherited separately and takes precedence over inherited base version."
1563115607
}
1563215608
},
1563315609
"title": "Always the first event in workflow history"

openapi/openapiv3.yaml

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13133,7 +13133,10 @@ components:
1313313133
versioningOverride:
1313413134
allOf:
1313513135
- $ref: '#/components/schemas/VersioningOverride'
13136-
description: Versioning override applied to this workflow when it was started.
13136+
description: |-
13137+
Versioning override applied to this workflow when it was started.
13138+
Children, crons, retries, and continue-as-new will inherit source run's override if pinned
13139+
and if the new workflow's Task Queue belongs to the override version.
1313713140
parentPinnedWorkerDeploymentVersion:
1313813141
type: string
1313913142
description: |-
@@ -13147,59 +13150,25 @@ components:
1314713150
allOf:
1314813151
- $ref: '#/components/schemas/Priority'
1314913152
description: Priority metadata
13150-
previousRunVersioningInfo:
13153+
inheritedPinnedVersion:
1315113154
allOf:
13152-
- $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo'
13155+
- $ref: '#/components/schemas/WorkerDeploymentVersion'
1315313156
description: |-
13154-
When present, this workflow is part of a retry and/or ContinueAsNew chain, and the previous run in the
13155-
chain was versioned. The `initiator` field of this event specifies why this new workflow was initiated.
13156-
If present, and the previous run's base behavior is PINNED, and the new run's Task Queue belongs
13157-
to the previous run's Version, the new run will inherit the previous run's Version.
13158-
13159-
If initiated by a workflow ContinueAsNew, always populate.
13157+
If present, the new workflow should start on this version with pinned base behavior.
13158+
Child of pinned parent will inherit the parent's version if the Child's Task Queue belongs to that version.
1316013159

13161-
If initiated by a workflow Cron, never populate, because new cron workflows should start their own version chain.
13160+
New run initiated by workflow ContinueAsNew of pinned run, will inherit the previous run's version if the
13161+
new run's Task Queue belongs to that version.
1316213162

13163-
If initiated by a workflow retry, pass the retried run's `previous_run_versioning_info`, because a retry of a
13164-
root workflow or Cron workflow should not inherit the Pinned Version, but if the retried workflow has a PINNED
13165-
parent or is part of a Pinned continue-as-new chain, the the new workflow should inherit the version of the
13166-
existing tree or chain.
13163+
New run initiated by workflow Cron will never inherit.
1316713164

13168-
If a versioning override is present, it will take precedence over the inherited base version.
13169-
parentVersioningInfo:
13170-
allOf:
13171-
- $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo'
13172-
description: |-
13173-
When present, this is a child workflow of a versioned parent.
13174-
If the parent's base behavior is PINNED, and the child's Task Queue belongs to the
13175-
parent's Version, the child workflow will inherit the parent's Version.
13165+
New run initiated by workflow Retry will only inherit if the retried run is effectively pinned at the time
13166+
of retry, and the retried run inherited a pinned version when it started (ie. it is a child of a pinned
13167+
parent, or a CaN of a pinned run, and is running on a Task Queue in the inherited version).
1317613168

13177-
If `versioning_override` is present, it will take precedence over the inherited base version.
13178-
If `previous_run_versioning_info` is present, it will take precedence over `parent_versioning_info`.
13169+
Pinned override is inherited if Task Queue of new run is compatible with the override version.
13170+
Override is inherited separately and takes precedence over inherited base version.
1317913171
description: Always the first event in workflow history
13180-
WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo:
13181-
type: object
13182-
properties:
13183-
deploymentVersion:
13184-
$ref: '#/components/schemas/WorkerDeploymentVersion'
13185-
behavior:
13186-
enum:
13187-
- VERSIONING_BEHAVIOR_UNSPECIFIED
13188-
- VERSIONING_BEHAVIOR_PINNED
13189-
- VERSIONING_BEHAVIOR_AUTO_UPGRADE
13190-
type: string
13191-
description: Base versioning behavior of source workflow.
13192-
format: enum
13193-
taskQueue:
13194-
type: string
13195-
description: Task queue name of source workflow if different from started workflow.
13196-
pinnedOverride:
13197-
allOf:
13198-
- $ref: '#/components/schemas/VersioningOverride'
13199-
description: |-
13200-
Override of source workflow if that override is pinned.
13201-
Pinned overrides are automatically inherited by child workflows,
13202-
continue-as-new workflows, workflow retries, and cron workflows.
1320313172
WorkflowExecutionTerminatedEventAttributes:
1320413173
type: object
1320513174
properties:

temporal/api/history/v1/message.proto

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ message WorkflowExecutionStartedEventAttributes {
119119
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
120120
string inherited_build_id = 32 [deprecated = true];
121121
// Versioning override applied to this workflow when it was started.
122+
// Children, crons, retries, and continue-as-new will inherit source run's override if pinned
123+
// and if the new workflow's Task Queue belongs to the override version.
122124
temporal.api.workflow.v1.VersioningOverride versioning_override = 33;
123125
// When present, it means this is a child workflow of a parent that is Pinned to this Worker
124126
// Deployment Version. In this case, child workflow will start as Pinned to this Version instead
@@ -134,42 +136,21 @@ message WorkflowExecutionStartedEventAttributes {
134136
reserved 36;
135137
reserved "parent_pinned_deployment_version";
136138

137-
// When present, this workflow is part of a retry and/or ContinueAsNew chain, and the previous run in the
138-
// chain was versioned. The `initiator` field of this event specifies why this new workflow was initiated.
139-
// If present, and the previous run's base behavior is PINNED, and the new run's Task Queue belongs
140-
// to the previous run's Version, the new run will inherit the previous run's Version.
139+
// If present, the new workflow should start on this version with pinned base behavior.
140+
// Child of pinned parent will inherit the parent's version if the Child's Task Queue belongs to that version.
141141
//
142-
// If initiated by a workflow ContinueAsNew, always populate.
142+
// New run initiated by workflow ContinueAsNew of pinned run, will inherit the previous run's version if the
143+
// new run's Task Queue belongs to that version.
143144
//
144-
// If initiated by a workflow Cron, never populate, because new cron workflows should start their own version chain.
145+
// New run initiated by workflow Cron will never inherit.
145146
//
146-
// If initiated by a workflow retry, pass the retried run's `previous_run_versioning_info`, because a retry of a
147-
// root workflow or Cron workflow should not inherit the Pinned Version, but if the retried workflow has a PINNED
148-
// parent or is part of a Pinned continue-as-new chain, the the new workflow should inherit the version of the
149-
// existing tree or chain.
147+
// New run initiated by workflow Retry will only inherit if the retried run is effectively pinned at the time
148+
// of retry, and the retried run inherited a pinned version when it started (ie. it is a child of a pinned
149+
// parent, or a CaN of a pinned run, and is running on a Task Queue in the inherited version).
150150
//
151-
// If a versioning override is present, it will take precedence over the inherited base version.
152-
SourceWorkflowVersioningInfo previous_run_versioning_info = 37;
153-
154-
// When present, this is a child workflow of a versioned parent.
155-
// If the parent's base behavior is PINNED, and the child's Task Queue belongs to the
156-
// parent's Version, the child workflow will inherit the parent's Version.
157-
//
158-
// If `versioning_override` is present, it will take precedence over the inherited base version.
159-
// If `previous_run_versioning_info` is present, it will take precedence over `parent_versioning_info`.
160-
SourceWorkflowVersioningInfo parent_versioning_info = 38;
161-
162-
message SourceWorkflowVersioningInfo {
163-
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 1;
164-
// Base versioning behavior of source workflow.
165-
temporal.api.enums.v1.VersioningBehavior behavior = 2;
166-
// Task queue name of source workflow if different from started workflow.
167-
string task_queue = 3;
168-
// Override of source workflow if that override is pinned.
169-
// Pinned overrides are automatically inherited by child workflows,
170-
// continue-as-new workflows, workflow retries, and cron workflows.
171-
temporal.api.workflow.v1.VersioningOverride pinned_override = 4;
172-
}
151+
// Pinned override is inherited if Task Queue of new run is compatible with the override version.
152+
// Override is inherited separately and takes precedence over inherited base version.
153+
temporal.api.deployment.v1.WorkerDeploymentVersion inherited_pinned_version = 37;
173154
}
174155

175156
message WorkflowExecutionCompletedEventAttributes {

0 commit comments

Comments
 (0)