Skip to content

Commit fd15e36

Browse files
authored
Add workflow expiration and run timestamps to execution info (#505)
_**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?** Add new structure -WorkflowExecutionExtendedInfo That structure has few fields: * execution timeout time * run timeout time * last reset time * cancel requested (the last one from #339) <!-- Tell your future self why have you made these changes --> **Why?** Per customer request. Execution timeout timestamp may change after workflow reset, and in this case customers have no idea when it will fire. WorkflowExecutionInfo is reused in other server calls, like ListWorkflow, etc. Because of that we either add any new field to ES, or it will be nil which is bad user experience. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** N/A
1 parent 38d2ac0 commit fd15e36

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

openapi/openapiv2.json

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8466,6 +8466,9 @@
84668466
"type": "object",
84678467
"$ref": "#/definitions/v1PendingNexusOperationInfo"
84688468
}
8469+
},
8470+
"workflowExtendedInfo": {
8471+
"$ref": "#/definitions/v1WorkflowExecutionExtendedInfo"
84698472
}
84708473
}
84718474
},
@@ -12901,6 +12904,36 @@
1290112904
}
1290212905
}
1290312906
},
12907+
"v1WorkflowExecutionExtendedInfo": {
12908+
"type": "object",
12909+
"properties": {
12910+
"executionExpirationTime": {
12911+
"type": "string",
12912+
"format": "date-time",
12913+
"description": "Workflow execution expiration time is defined as workflow start time plus expiration timeout.\nWorkflow start time may change after workflow reset."
12914+
},
12915+
"runExpirationTime": {
12916+
"type": "string",
12917+
"format": "date-time",
12918+
"description": "Workflow run expiration time is defined as current workflow run start time plus workflow run timeout."
12919+
},
12920+
"cancelRequested": {
12921+
"type": "boolean",
12922+
"title": "indicates if the workflow received a cancel request"
12923+
},
12924+
"lastResetTime": {
12925+
"type": "string",
12926+
"format": "date-time",
12927+
"description": "Last workflow reset time. Nil if the workflow was never reset."
12928+
},
12929+
"originalStartTime": {
12930+
"type": "string",
12931+
"format": "date-time",
12932+
"description": "Original workflow start time."
12933+
}
12934+
},
12935+
"description": "Holds all the extra information about workflow execution that is not part of Visibility."
12936+
},
1290412937
"v1WorkflowExecutionFailedEventAttributes": {
1290512938
"type": "object",
1290612939
"properties": {
@@ -13015,7 +13048,8 @@
1301513048
"$ref": "#/definitions/v1WorkflowExecutionVersioningInfo",
1301613049
"description": "Absent value means the workflow execution is not versioned. When present, the execution might\nbe versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.\nExperimental. Versioning info is experimental and might change in the future."
1301713050
}
13018-
}
13051+
},
13052+
"description": "Hold basic information about a workflow execution.\nThis structure is a part of visibility, and thus contain a limited subset of information."
1301913053
},
1302013054
"v1WorkflowExecutionOptions": {
1302113055
"type": "object",

openapi/openapiv3.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,6 +6157,8 @@ components:
61576157
type: array
61586158
items:
61596159
$ref: '#/components/schemas/PendingNexusOperationInfo'
6160+
workflowExtendedInfo:
6161+
$ref: '#/components/schemas/WorkflowExecutionExtendedInfo'
61606162
Endpoint:
61616163
type: object
61626164
properties:
@@ -10390,6 +10392,31 @@ components:
1039010392
description: |-
1039110393
If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
1039210394
the assignment rules will be used to independently assign a Build ID to the new execution.
10395+
WorkflowExecutionExtendedInfo:
10396+
type: object
10397+
properties:
10398+
executionExpirationTime:
10399+
type: string
10400+
description: |-
10401+
Workflow execution expiration time is defined as workflow start time plus expiration timeout.
10402+
Workflow start time may change after workflow reset.
10403+
format: date-time
10404+
runExpirationTime:
10405+
type: string
10406+
description: Workflow run expiration time is defined as current workflow run start time plus workflow run timeout.
10407+
format: date-time
10408+
cancelRequested:
10409+
type: boolean
10410+
description: indicates if the workflow received a cancel request
10411+
lastResetTime:
10412+
type: string
10413+
description: Last workflow reset time. Nil if the workflow was never reset.
10414+
format: date-time
10415+
originalStartTime:
10416+
type: string
10417+
description: Original workflow start time.
10418+
format: date-time
10419+
description: Holds all the extra information about workflow execution that is not part of Visibility.
1039310420
WorkflowExecutionFailedEventAttributes:
1039410421
type: object
1039510422
properties:
@@ -10526,6 +10553,9 @@ components:
1052610553
Absent value means the workflow execution is not versioned. When present, the execution might
1052710554
be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
1052810555
Experimental. Versioning info is experimental and might change in the future.
10556+
description: |-
10557+
Hold basic information about a workflow execution.
10558+
This structure is a part of visibility, and thus contain a limited subset of information.
1052910559
WorkflowExecutionOptions:
1053010560
type: object
1053110561
properties:

temporal/api/workflow/v1/message.proto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ import "temporal/api/failure/v1/message.proto";
4343
import "temporal/api/taskqueue/v1/message.proto";
4444
import "temporal/api/sdk/v1/user_metadata.proto";
4545

46+
47+
// Hold basic information about a workflow execution.
48+
// This structure is a part of visibility, and thus contain a limited subset of information.
4649
message WorkflowExecutionInfo {
4750
temporal.api.common.v1.WorkflowExecution execution = 1;
4851
temporal.api.common.v1.WorkflowType type = 2;
@@ -109,6 +112,25 @@ message WorkflowExecutionInfo {
109112
WorkflowExecutionVersioningInfo versioning_info = 22;
110113
}
111114

115+
// Holds all the extra information about workflow execution that is not part of Visibility.
116+
message WorkflowExecutionExtendedInfo {
117+
// Workflow execution expiration time is defined as workflow start time plus expiration timeout.
118+
// Workflow start time may change after workflow reset.
119+
google.protobuf.Timestamp execution_expiration_time = 1;
120+
121+
// Workflow run expiration time is defined as current workflow run start time plus workflow run timeout.
122+
google.protobuf.Timestamp run_expiration_time = 2;
123+
124+
// indicates if the workflow received a cancel request
125+
bool cancel_requested = 3;
126+
127+
// Last workflow reset time. Nil if the workflow was never reset.
128+
google.protobuf.Timestamp last_reset_time = 4;
129+
130+
// Original workflow start time.
131+
google.protobuf.Timestamp original_start_time = 5;
132+
}
133+
112134
// Holds all the information about versioning for a workflow execution.
113135
// Experimental. Versioning info is experimental and might change in the future.
114136
message WorkflowExecutionVersioningInfo {

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ message DescribeWorkflowExecutionResponse {
982982
temporal.api.workflow.v1.PendingWorkflowTaskInfo pending_workflow_task = 5;
983983
repeated temporal.api.workflow.v1.CallbackInfo callbacks = 6;
984984
repeated temporal.api.workflow.v1.PendingNexusOperationInfo pending_nexus_operations = 7;
985+
temporal.api.workflow.v1.WorkflowExecutionExtendedInfo workflow_extended_info = 8;
985986
}
986987

987988
// (-- api-linter: core::0203::optional=disabled

0 commit comments

Comments
 (0)