Step groups and flows both help you organize test steps, but they serve different purposes.
- Step groups are a lightweight way to label and structure steps within a test for readability.
- Flows are reusable, shareable sets of steps with their own versioning, parameters, and looping capabilities.
This article covers when to use each and how they can work together.
When to use step groups
Use step groups when your primary goal is readability and navigation. Step groups are ideal for:
- Labeling sections of a test - group related steps under a descriptive header like “Log in” or “Complete checkout” so you can scan the test structure at a glance.
- Organizing long tests - break a 30-step test into named sections so that failures are immediately locatable in test output.
- Making tests accessible to your team - new team members can read step group labels like an outline instead of parsing every individual step.
- Giving context in AI-generated tests - the Test Creation Agent automatically organizes generated steps into step groups to provide structure from the start.
When to use flows
Use flows when you need to reuse, parameterize, or loop through a set of steps. Flows are the right choice when:
- Multiple tests share the same steps. A “Log in” flow can be referenced across dozens of tests. Update it once, and every test that uses it gets the change.
- You need looping. Flows support looping to a fixed or variable number of iterations. Step groups don’t support loops.
- You need scoped variables. Flow parameters let you pass different values into the same set of steps depending on the context. Step groups cannot be parameterized.
- You need independent versioning. Flows have their own version history and branch support. Step groups are versioned as part of the test.
How step groups and flows complement each other
Step groups and flows aren’t mutually exclusive. You can nest flows inside step groups, place step groups inside flows, and combine both with conditionals. Here are some common patterns:
Wrap flows in a step group
Put related flows inside a step group to show how steps and flows fit together.
For example, a “Complete checkout” step group might contain:
- a reusable “Apply coupon” flow
- some one-off steps for selecting a shipping method
- a reusable “Enter payment” flow
Organize a complex flow
Add step groups inside a reusable flow to make it easier to navigate.
For example, a “Create new user account” flow that contains several steps could be broken up into the following step groups:
- “Fill out profile info”
- “Set notification preferences”
- “Accept terms and submit”
Combine with conditionals
Use conditionals alongside step groups and flows to handle different scenarios.
For example, a conditional could check whether a logged-in user is an admin or standard user, and each scenario could use step groups to organize role-specific actions and shared flows to handle common steps like logging in.
Comparison
The following table provides a recap of the main similarities and differences between step groups and flows:
| Capability | Step groups | Flows |
|---|---|---|
| Collapse and expand in the Trainer | Yes | Yes |
| Looping | No | Yes |
| Parameters | No | Yes |
| Independent versioning | No | Yes |
| Can contain the other | Yes, step groups can contain flows | Yes, flows can contain step groups |
| Can be nested inside itself | Yes | No |