Skip to content

Commit 178128d

Browse files
authored
Clarify docs of root_workflow_execution in WorkflowExecutionStartedEventAttributes (#573)
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** Clarify docs of `root_workflow_execution` in `WorkflowExecutionStartedEventAttributes` <!-- Tell your future self why have you made these changes --> **Why?** <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR**
1 parent 770104f commit 178128d

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

openapi/openapiv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15138,7 +15138,7 @@
1513815138
},
1513915139
"rootWorkflowExecution": {
1514015140
"$ref": "#/definitions/v1WorkflowExecution",
15141-
"description": "Contains information about the root workflow execution.\nThe root workflow execution is defined as follows:\n1. A workflow without parent workflow is its own root workflow.\n2. A workflow that has a parent workflow has the same root workflow as its parent workflow.\nNote: workflows continued as new or reseted may or may not have parents, check examples below.\n\nExamples:\n Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.\n - The root workflow of all three workflows is W1.\n Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.\n - The root workflow of all three workflows is W1.\n Scenario 3: Workflow W1 continued as new W2.\n - The root workflow of W1 is W1 and the root workflow of W2 is W2.\n Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3\n - The root workflow of all three workflows is W1.\n Scenario 5: Workflow W1 is reseted, creating W2.\n - The root workflow of W1 is W1 and the root workflow of W2 is W2."
15141+
"description": "Contains information about the root workflow execution.\nThe root workflow execution is defined as follows:\n 1. A workflow without parent workflow is its own root workflow.\n 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.\nWhen the workflow is its own root workflow, then root_workflow_execution is nil.\nNote: workflows continued as new or reseted may or may not have parents, check examples below.\n\nExamples:\n Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.\n - The root workflow of all three workflows is W1.\n - W1 has root_workflow_execution set to nil.\n - W2 and W3 have root_workflow_execution set to W1.\n Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.\n - The root workflow of all three workflows is W1.\n - W1 has root_workflow_execution set to nil.\n - W2 and W3 have root_workflow_execution set to W1.\n Scenario 3: Workflow W1 continued as new W2.\n - The root workflow of W1 is W1 and the root workflow of W2 is W2.\n - W1 and W2 have root_workflow_execution set to nil.\n Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3\n - The root workflow of all three workflows is W1.\n - W1 has root_workflow_execution set to nil.\n - W2 and W3 have root_workflow_execution set to W1.\n Scenario 5: Workflow W1 is reseted, creating W2.\n - The root workflow of W1 is W1 and the root workflow of W2 is W2.\n - W1 and W2 have root_workflow_execution set to nil."
1514215142
},
1514315143
"inheritedBuildId": {
1514415144
"type": "string",

openapi/openapiv3.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12514,21 +12514,30 @@ components:
1251412514
description: |-
1251512515
Contains information about the root workflow execution.
1251612516
The root workflow execution is defined as follows:
12517-
1. A workflow without parent workflow is its own root workflow.
12518-
2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
12517+
1. A workflow without parent workflow is its own root workflow.
12518+
2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
12519+
When the workflow is its own root workflow, then root_workflow_execution is nil.
1251912520
Note: workflows continued as new or reseted may or may not have parents, check examples below.
1252012521

1252112522
Examples:
1252212523
Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
1252312524
- The root workflow of all three workflows is W1.
12525+
- W1 has root_workflow_execution set to nil.
12526+
- W2 and W3 have root_workflow_execution set to W1.
1252412527
Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
1252512528
- The root workflow of all three workflows is W1.
12529+
- W1 has root_workflow_execution set to nil.
12530+
- W2 and W3 have root_workflow_execution set to W1.
1252612531
Scenario 3: Workflow W1 continued as new W2.
1252712532
- The root workflow of W1 is W1 and the root workflow of W2 is W2.
12533+
- W1 and W2 have root_workflow_execution set to nil.
1252812534
Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
1252912535
- The root workflow of all three workflows is W1.
12536+
- W1 has root_workflow_execution set to nil.
12537+
- W2 and W3 have root_workflow_execution set to W1.
1253012538
Scenario 5: Workflow W1 is reseted, creating W2.
1253112539
- The root workflow of W1 is W1 and the root workflow of W2 is W2.
12540+
- W1 and W2 have root_workflow_execution set to nil.
1253212541
inheritedBuildId:
1253312542
type: string
1253412543
description: |-

temporal/api/history/v1/message.proto

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,30 @@ message WorkflowExecutionStartedEventAttributes {
112112

113113
// Contains information about the root workflow execution.
114114
// The root workflow execution is defined as follows:
115-
// 1. A workflow without parent workflow is its own root workflow.
116-
// 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
115+
// 1. A workflow without parent workflow is its own root workflow.
116+
// 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
117+
// When the workflow is its own root workflow, then root_workflow_execution is nil.
117118
// Note: workflows continued as new or reseted may or may not have parents, check examples below.
118119
//
119120
// Examples:
120121
// Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
121122
// - The root workflow of all three workflows is W1.
123+
// - W1 has root_workflow_execution set to nil.
124+
// - W2 and W3 have root_workflow_execution set to W1.
122125
// Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
123126
// - The root workflow of all three workflows is W1.
127+
// - W1 has root_workflow_execution set to nil.
128+
// - W2 and W3 have root_workflow_execution set to W1.
124129
// Scenario 3: Workflow W1 continued as new W2.
125130
// - The root workflow of W1 is W1 and the root workflow of W2 is W2.
131+
// - W1 and W2 have root_workflow_execution set to nil.
126132
// Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
127133
// - The root workflow of all three workflows is W1.
134+
// - W1 has root_workflow_execution set to nil.
135+
// - W2 and W3 have root_workflow_execution set to W1.
128136
// Scenario 5: Workflow W1 is reseted, creating W2.
129137
// - The root workflow of W1 is W1 and the root workflow of W2 is W2.
138+
// - W1 and W2 have root_workflow_execution set to nil.
130139
temporal.api.common.v1.WorkflowExecution root_workflow_execution = 31;
131140
// When present, this execution is assigned to the build ID of its parent or previous execution.
132141
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]

0 commit comments

Comments
 (0)