This topic describes Wait states and provides related examples.
Overview
A Wait state is used to pause a flow execution for a period of time and then resume the execution. You can pause a flow execution for a relative period of time, such as 12 seconds.
The following table describes the attributes that a Wait state contains.
Attribute | Type | Required | Description | Example |
Seconds | int | Yes | The waiting time. Unit: seconds. Valid values:
| 12 |
Expression construction is supported. You can dynamically set the value based on the context. | Seconds.$: $Input.timeout | |||
Name | string | Yes | The name of the state. | my state |
Description | string | No | The description of the state. | describe it here |
Type | string | Yes | The type of the state. | Pass |
Next | string | No | The next state that is executed after the current state is complete. If the End attribute is true, you do not need to specify this attribute. | my next |
End | bool | No | Specifies whether the state is the terminal state of the current scope. | true |
InputConstructor | map[string]any | No | The input constructor. | See the InputConstructor section of the "inputs and outputs" topic. |
OutputConstructor | map[string]any | No | The output constructor. | See the OutputConstructor section of the "inputs and outputs" topic. |
Example
Wait 12 seconds.
Type: StateMachine
Name: my-wkfl
SpecVersion: v1
StartAt: Wait1
States:
- Type: Wait
Name: Wait1
Seconds: 12
End: true