# For Each Loop

**Introduction**

The "For-Each Loop" step iterates over a list of items, executing a defined set of actions for each item in the list. This step is useful for automating repetitive tasks across multiple elements.

**Configuration**

* **List**: The list of items to iterate over. This parameter is required and must be of a list type.

**Subpath: Loop**

* **Item**: Within the "Loop" subpath, the `Item` variable represents the current item in the iteration. Actions within this subpath are performed on each item in the list, one at a time.

You can use the `Item` variable in subsequent steps within the loop to perform actions specific to each element in the list.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexy.bot/modules/scripting/steps/for-each-loop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
