> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/en/autify-university/foundation/step-groups/step-group-for-the-middleend-of-a-scenario.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# 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]

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-b37edcb6da2b4e3d13c9d0116fc83b2b5a6faa03%2FScreen%20Shot%202022-04-05%20at%2016.44.13.png?alt=media)

3. Name your Step Group and click \[Done]

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-ae690b212f5463484a9e42e142073bc4f63f0c8b%2FScreen%20Shot%202022-04-05%20at%2016.47.28.png?alt=media)

4. 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.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-85dcff255eca811966765891254a20b8ee78a161%2FScreen%20Shot%202022-04-05%20at%2016.47.48.png?alt=media)

You can view what’s inside the Step Group by clicking it:

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-4f37a2ad64f0d5e09244bbb1f6731bc5692c02fc%2FScreen%20Shot%202022-04-05%20at%2016.48.14.png?alt=media)

## 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.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-b30412082236d003b29b0f8b1508c97bc6d98b5e%2FScreen%20Shot%202022-04-05%20at%2020.53.27.png?alt=media)

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.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-8595e19b3f65713fb08e0a482d69c3c35990be45%2FScreen%20Shot%202022-04-05%20at%2020.57.47.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/en/autify-university/foundation/step-groups/step-group-for-the-middleend-of-a-scenario.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
