Skip to content

Commit 1709567

Browse files
Fix state execution timeout schema and text (#564)
* Fix state execution timeout schema and text Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io> * update Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io> * Update specification.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com>
1 parent 02c22e9 commit 1709567

File tree

3 files changed

+14
-51
lines changed

3 files changed

+14
-51
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ _Status description:_
2424
| Status | Description | Comments |
2525
| --- | --- | --- |
2626
| ✔️| Fix support for workflow extensions | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
27+
| ✔️| Fix state execution timeout | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
2728
| ✏️️| Add inline state defs in branches | |
2829
| ✏️️| Update rest function definition | |
2930
| ✏️️| Add "completedBy" functionality | |

schema/timeouts.json

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,40 +73,18 @@
7373
]
7474
},
7575
"stateExecTimeout": {
76-
"oneOf": [
77-
{
78-
"type": "string",
79-
"description": "Total state execution timeout (including retries) (ISO 8601 duration format)",
80-
"minLength": 1
81-
},
82-
{
83-
"type": "object",
84-
"description": "Workflow default timeouts",
85-
"properties": {
86-
"single": {
87-
"type": "string",
88-
"description": "Single state execution timeout, not including retries (ISO 8601 duration format)",
89-
"minLength": 1
90-
},
91-
"total": {
92-
"type": "string",
93-
"description": "Total state execution timeout, including retries (ISO 8601 duration format)",
94-
"minLength": 1
95-
}
96-
},
97-
"additionalProperties": false,
98-
"required": ["total"]
99-
}
100-
]
76+
"type": "string",
77+
"description": "Workflow state execution timeout duration (ISO 8601 duration format)",
78+
"minLength": 1
10179
},
10280
"actionExecTimeout": {
10381
"type": "string",
104-
"description": "Single actions definition execution timeout duration (ISO 8601 duration format)",
82+
"description": "Action execution timeout duration (ISO 8601 duration format)",
10583
"minLength": 1
10684
},
10785
"branchExecTimeout": {
10886
"type": "string",
109-
"description": "Single branch execution timeout duration (ISO 8601 duration format)",
87+
"description": "Branch execution timeout duration (ISO 8601 duration format)",
11088
"minLength": 1
11189
},
11290
"eventTimeout": {

specification.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5460,9 +5460,9 @@ If `object` type, it is used to define the timeout definitions in-line and has t
54605460
| Parameter | Description | Type | Required |
54615461
| --- | --- | --- | --- |
54625462
| workflowExecTimeout | Workflow execution timeout (ISO 8601 duration format) | string or object | no |
5463-
| stateExecTimeout | Default workflow state execution timeout (ISO 8601 duration format) | string or object | no |
5464-
| actionExecTimeout | Default single actions definition execution timeout (ISO 8601 duration format) | string | no |
5465-
| branchExecTimeout | Default single branch execution timeout (ISO 8601 duration format) | string | no |
5463+
| stateExecTimeout | Workflow state execution timeout (ISO 8601 duration format) | string or object | no |
5464+
| actionExecTimeout | Actions execution timeout (ISO 8601 duration format) | string | no |
5465+
| branchExecTimeout | Branch execution timeout (ISO 8601 duration format) | string | no |
54665466
| eventTimeout | Default timeout for consuming defined events (ISO 8601 duration format) | string | no |
54675467

54685468
The `eventTimeout` property defines the maximum amount of time to wait to consume defined events. If not specified it should default to
@@ -5552,27 +5552,11 @@ timeout settings are available for each state type.
55525552

55535553
Workflow states timeouts cannot define the `workflowExecTimeout` property.
55545554

5555-
All workflow states can define the `stateExecTimeout` property. This property can have two types, namely string
5556-
and object.
5557-
If defined as string type, it defines the total state execution timeout, including any [retries](#Retry-Definition)
5558-
as defined in the states retry policy.
5559-
If defined as object type it has the following properties:
5560-
5561-
| Parameter | Description | Type | Required |
5562-
| --- | --- | --- | --- |
5563-
| single | Single state execution timeout, not including retries (ISO 8601 duration format) | string | no |
5564-
| total | Total state execution timeout, including retries (ISO 8601 duration format) | string | yes |
5565-
5566-
The `single` property defines a single state execution timeout. This property does not take in account retries.
5567-
Each time the state is executed, whether when it is executes as part of standard control flow logic, or as part of a retry,
5568-
its total execution timeouts is the value of the `single` property.
5569-
To show an example, let's say that we set the `single`
5570-
property to "PT10S", meaning 10 seconds. A workflow state "X" which defines this timeout when first executed has the max execution timeout
5571-
set to 10 seconds. If the state execution is then retried, each time it is retried, the individual retry max execution timeout is again 10 seconds.
5572-
5573-
The `total` property on the other hand defines a state execution timeout taking in account retries.
5574-
This means when this state is executed, its execution timeout is the value of the `total` property no matter how many retries
5575-
have to be performed. If a state execution includes zero or one hundred retries, the total execution timeout is set by this property.
5555+
Workflow states can set their `stateExecTimeout` property inside the `timeouts` definition.
5556+
The value of this property is a time duration (ISO 8601 duration format).
5557+
It must be a duration that's greater than zero and defines the total state execution timeout.
5558+
When this timeout is reached, state execution
5559+
should be stopped and can be handled as a timeout error in the states `onErrors` definition.
55765560

55775561
#### Branch Timeout Definition
55785562

0 commit comments

Comments
 (0)