Group hooks allow you to execute a sequence of steps, optionally in a loop. This is particularly useful for running multiple operations together, iterating over datasets, or creating reusable step templates.
Configuration
- type: group
steps: # Required: Array of steps to execute
- type: log
message: "Step 1"
- type: http
url: "https://api.example.com"
loop: [1, 2, 3] # Optional: Array or jmespath expression for iteration
env: # Optional: Environment variables for all steps
ENV_VAR1: "value1"
ENV_VAR2: "value2"
on_failure: abort # Optional: abort/warn/quiet/skip
id: my_id # Optional. Will be generated. Use `log` hook with {runtime_state} to view state.
Properties
Property
Required
Description
steps
Yes
Array of step configurations to execute
loop
No
Array or jmespath expression defining iteration values
env
No
Map of environment variables available to all steps
on_failure
No
What to do if any step fails (abort/warn/quiet/skip)
Output
When the group hook executes successfully, it returns the following output that can be accessed in subsequent hooks:
status: success # Status of the hook execution
loop_values: 5 # The rendered values if loop was provided
You can access these values in subsequent hooks using the following syntax (jmespath):
{state.hook_id.status} - Status of the hook execution
{state.hook_id.loop_values} - Values used in loop (if provided)
Within loop iterations, steps can access:
{loop_index} - Current iteration index (0-based)
{loop_value} - Current value from the loop array/expression
Examples
Basic Step Group
Execute multiple steps in sequence:
- type: group
id: initialization
steps:
- type: log
message: "Starting initialization"
- type: query
connection: target_db
query: "CREATE SCHEMA IF NOT EXISTS processed"
- type: log
message: "Initialization complete"