--- title: "Optimizing Scenario Flow with Step Groups | Autify Guide" slug: "step-group-for-the-middleend-of-a-scenario" description: "Efficient Scenario Management with Autify's Step Groups. Streamline your testing process. Get started today!" updated: 2025-06-24T13:44:49Z published: 2025-06-24T13:44:49Z canonical: "help.autify.com/step-group-for-the-middleend-of-a-scenario" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # Step Group for the middle/end of a Scenario ## When to use This kind of Step Group can be used for any series of steps you wish to use in the middle or at the end of a scenario. For example, this could be a series of input steps that you want to repeat in the middle of a scenario, or a common cleanup process that can be used at the end of multiple scenarios! ## Creating a Step Group for the middle/end of a Scenario Step Group for the middle/end of a Scenario cannot be created from scratch, but it can be created from a part of a scenario. Let's do it by following these steps: 1. Record a Scenario containing a series of steps that you want to convert into a Step Group 2. Select the series of steps you want to convert by clicking the checkbox at the top left of each step, and click [Create step group] ![Screen Shot 2022-04-05 at 16.44.13.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2016.44.13.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D) 1. Name your Step Group and click [Done] ![Screen Shot 2022-04-05 at 16.47.28.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2016.47.28.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D) 1. Your selected steps have just turned into a Step Group! This new Step Group can be used in the middle or at the end of any of your scenarios. ![Screen Shot 2022-04-05 at 16.47.48.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2016.47.48.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D) You can view what’s inside the Step Group by clicking it: ![Screen Shot 2022-04-05 at 16.48.14.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2016.48.14.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D) ## Note Selected steps cannot be turned into a Step Group if - - They contain Step Groups - The steps are dependent on other steps in the Scenario - Specifically, when they include the following kinds of steps: - Steps using a return value of other JS steps - JS steps returning a value that is referred to by other steps - Steps using random email addresses - Steps using a value in the Data table - Switch Window steps referring to the windows created in other steps - A step that exists within a cleanup step ## Using a Step Group in the middle/end of a Scenario Now, let’s put the Step Group you created into a Scenario. Open a scenario to which you want to add the Step Group. When you click the [+] button between two steps, you will see `Insert Step Group` in the menu. Click the link. ![Screen Shot 2022-04-05 at 20.53.27.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2020.53.27.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D) You can see that a Step Group is successfully added to the Scenario. Select the Step Group you would like to add to this Scenario. *Note that only **Step Groups that don’t have visit steps** are displayed in the list. ![Screen Shot 2022-04-05 at 20.57.47.png](https://cdn.document360.io/a099d8a2-cfd2-42ca-9906-68b4a337f4a5/Images/Documentation/Screen%20Shot%202022-04-05%20at%2020.57.47.png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A32%3A04Z&se=2026-11-08T19%3A32%3A04Z&sr=c&sp=r&sig=AlQsE5KXN5bXWs0Z%2FzFpNkRhACnvf5moT5NKKsmWxU8%3D)