A Wait state pauses a flow execution for a specified number of seconds, then resumes from the next state. Use it to introduce delays between states -- for example, waiting before retrying an operation or spacing out API calls.
Important
The maximum pause duration depends on the flow mode:
Standard mode: 1 to 300 seconds
Express mode: 1 to 20 seconds
Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
| Type | string | Yes | The state type. Set to Wait. |
| Name | string | Yes | The state name. |
| Seconds | int | Yes | Pause duration in seconds. Valid values: 1 to 300 (Standard mode) or 1 to 20 (Express mode). To set the value dynamically, use an expression (see Set the wait duration dynamically). |
| Description | string | No | A description of the state. |
| Next | string | No | The state to run after this one completes. Not required if End is true. |
| End | bool | No | Marks this state as the terminal state of the current scope. |
| InputConstructor | map[string]any | No | The input constructor. For details, see the InputConstructor section in Inputs and outputs. |
| OutputConstructor | map[string]any | No | The output constructor. For details, see the OutputConstructor section in Inputs and outputs. |
Examples
Wait a fixed number of seconds
The following flow pauses for 12 seconds before ending:
Type: StateMachine
Name: my-wkfl
SpecVersion: v1
StartAt: Wait1
States:
- Type: Wait
Name: Wait1
Seconds: 12
End: trueSet the wait duration dynamically
To determine the pause duration at runtime, use the .$ suffix on the Seconds field to read the value from the flow input.
Type: StateMachine
Name: my-wkfl
SpecVersion: v1
StartAt: DynamicWait
States:
- Type: Wait
Name: DynamicWait
Seconds.$: $Input.timeout
End: trueIn this example, Seconds.$: $Input.timeout reads the timeout value from the flow input and uses it as the pause duration in seconds.