> For the complete documentation index, see [llms.txt](https://docs.helmut.de/helmut4-releases/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.helmut.de/helmut4-releases/v4.13.0/helmut4-components/streamdesigner/nodes/actions/misc-21/generic-json-iteration-node.md).

# Generic JSON Iteration Node

The **Generic JSON Iteration Node** iterates either over a defined range of numeric indexes or over the elements of a JSON array.

When both iteration methods are configured, the **JSON Array** takes priority over the **Start** and **End** values.

During each iteration, the node stores the current iteration data in temporary stream variables. These values can be used by subsequent nodes to process each array element or to build loop-based workflows.

***

### Configurable Settings

**Async**

Enables or disables asynchronous execution.

**Start**

The index at which a range-based iteration should begin.

The value must be parseable as an integer.

Example:

```
0
```

**End**

The final index for a range-based iteration.

The value must be parseable as an integer.

Example:

```
10
```

**JSON Array**

The JSON array that should be processed.

When a valid <mark style="color:$primary;">JSON</mark> <mark style="color:$primary;"></mark><mark style="color:$primary;">**array**</mark> is provided, the node iterates over its entries and ignores the configured **Start** and **End** values.

Example:

```json
[
  {
    "status": 200,
    "data": {
      "id": "123",
      "name": "Test"
    }
  },
  {
    "status": 200,
    "data": {
      "id": "456",
      "name": "Another Test"
    }
  }
]
```

The JSON value can also be provided through a wildcard, for example from a previous HTTP request or JSON-processing node.

***

### Temporary Variables

For every iteration, the node creates the following temporary variables. Replace `<nodeID>` with the UUID of the Generic JSON Iteration Node.

**Current Index**

```
{stream.variable.<nodeID>_index}
```

Contains the index currently being processed.

**End Index**

```
{stream.variable.<nodeID>_end}
```

Contains the configured or calculated final index of the iteration.

**Current Value**

```
{stream.variable.<nodeID>_value}
```

Contains the **current JSON array** element.

For the node shown above, the variables are:

```
{stream.variable.30cbc3a2-653a-4fc0-b23c-e03c5890a680_index}
{stream.variable.30cbc3a2-653a-4fc0-b23c-e03c5890a680_end}
{stream.variable.30cbc3a2-653a-4fc0-b23c-e03c5890a680_value}
```

<figure><img src="/files/avkHb1MhmGpU1sethF6b" alt="" width="375"><figcaption><p>Output all three stream variables (if available)</p></figcaption></figure>

<figure><img src="/files/38A1xfluqoiynjzX44ng" alt="" width="375"><figcaption><p>Output in a message just using start-end parameters</p></figcaption></figure>

<figure><img src="/files/nKJn6LyNUen2666BDrdH" alt="" width="375"><figcaption><p>Output in a message just using json array</p></figcaption></figure>

***

### Stopping a Range-Based Iteration

When using the **Start** and **End** settings, the loop can be stopped early by setting the current index variable to a value outside the configured range.

Example:

<figure><img src="/files/ROW9i9GyydFUmUvQSk0y" alt="" width="347"><figcaption><p>Set iteration index to higher value</p></figcaption></figure>

This is useful when a following condition determines that no further entries need to be processed.

***

#### Typical Usage

Use a JSON response returned by an HTTP Request Action:

```
JSON Array:
{node.result.body.items}
```

Then access the current array entry in following nodes:

```
{stream.variable.<nodeID>_value}
```

For example, when each array item contains an `id` field:

```
{json.extract.id.{stream.variable.<nodeID>_value}}
```
