# Loop

Executes a block of code a specified number of times or based on a range of values.

<figure><img src="/files/MqJZKP1pHIHXRZwvqIVT" alt=""><figcaption></figcaption></figure>

### Options

* ***Iterable** -* Iterable element which can be traversed or looped through its items one at a time.&#x20;

  You can select the previous node value from the data hub or you can provide it directly.
* ***Batch Processing** -* Allows processing a group of records in batches, rather than one by one.
* ***Batch size** -* Single batch size. To be provided, only if batch processing is enabled. The batch size should be a minimum of 100.

### Examples

<table data-header-hidden><thead><tr><th width="245">Iterable</th><th width="165.33333333333331">Batch Processing</th><th>Output</th></tr></thead><tbody><tr><td>[11,12,13,14,15]</td><td>No</td><td><p>Number of iterations: 5</p><p></p><p>Iteration 1: <em>{'item': 11, 'index': 0}</em></p><p>Iteration 2: <em>{'item': 12, 'index': 1}</em></p><p>Iteration 3: <em>{'item': 13, 'index': 2}</em></p><p>Iteration 4: <em>{'item': 14, 'index': 3}</em></p><p>Iteration 5: <em>{'item': 15, 'index': 4}</em></p></td></tr><tr><td>[11,12,13,14,15]</td><td><p>Yes. </p><p>Batch size: 3 </p></td><td><p>Number of iterations: 2</p><p></p><p>Iteration 1: <em>{'item': [11,12,13], 'index': 0}</em><br>Iteration 2: <em>{'item': [14,15], 'index': 1}</em></p></td></tr><tr><td>[{"name": "abc", "age": 20}, {"name": "def", "age": 25}, {"name": "ghi", "age": 30}, {"name": "jkl", "age": 35}, {"name": "mno", "age": 40}] </td><td><p>Yes. </p><p>Batch size: 3 </p></td><td><p>Number of iterations: 2</p><p></p><p>Iteration 1: </p><p><em>{'item': [{"name": "abc", "age": 20}, {"name": "def", "age": 25}, {"name": "ghi", "age": 30}], 'index': 0}</em></p><p>Iteration 2: <br><em>{'item': [{"name": "jkl", "age": 35}, {"name": "mno", "age": 40}], 'index': 1}</em></p></td></tr><tr><td>{{1.response.products}}</td><td><p>Yes. </p><p>Batch size: 100</p></td><td>It will return each product data with index. </td></tr></tbody></table>

{% hint style="info" %}
*Batch size 3 is used for illustration purpose only. Minimum Batch Size allowed is 100.*
{% endhint %}


---

# 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.dckapintegrator.com/project-manager/workflows/actions/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.
