> For the complete documentation index, see [llms.txt](https://docs.incari.com/incari-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.incari.com/incari-studio/2022.2/toolbox/flow-control/forloop.md).

# For Loop

## Overview

![The For Loop Node.](/files/Ggk9C2azIsGmET97rfhP)

The **For Loop Node** triggers an iterative process that steps through the provided **Int** inputs. The output can then, for example, be printed to the **Console** or affect the next **Node** in the **Logic Branch**.

[**Scope**](/incari-studio/2022.2/toolbox/overview.md#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The For Loop Node Attributes.](/files/fhsCMc3LJGz77xCLWyUE)

| Attribute                | Type     | Description                                                                |
| ------------------------ | -------- | -------------------------------------------------------------------------- |
| `First Index`            | **Int**  | The starting index.                                                        |
| `Last Index`             | **Int**  | The stopping index.                                                        |
| `Step`                   | **Int**  | The amount to increase or decrease by.                                     |
| `Is Last Index Included` | **Bool** | Notes whether the last index is included or excluded during the iteration. |

## Inputs

| Input             | Type      | Description                                                           |
| ----------------- | --------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse** | A standard **Input Pulse**, to trigger the execution of the **Node**. |
| `First Index`     | **Int**   | The starting index.                                                   |
| `Last Index`      | **Int**   | The stopping index.                                                   |
| `Step`            | **Int**   | The amount to increase or decrease by.                                |

## Outputs

| Output             | Type      | Description                                                                                                                            |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse** | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Index`            | **Int**   | The output index.                                                                                                                      |
| `OnEnd`(►)         | **Pulse** | A **Pulse** that flows to an action, such as a **Console** message, once the **For Loop** has ended.                                   |

## See Also

* [**For Each Loop**](/incari-studio/2022.2/toolbox/flow-control/foreachloop.md)

## External Links

* [*For loop explanation*](https://en.wikipedia.org/wiki/For_loop) on Wikipedia.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.incari.com/incari-studio/2022.2/toolbox/flow-control/forloop.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
