> For the complete documentation index, see [llms.txt](https://docs.dckapintegrator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dckapintegrator.com/project-manager/workflows/actions/loop.md).

# Loop

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

<figure><img src="https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2FfrbY6Kb1ZT0kUQJ0VkQm%2FScreenshot%20from%202023-10-17%2018-00-40.png?alt=media&amp;token=839ee783-23a8-451c-99c4-487c6fb7bd11" 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
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://docs.dckapintegrator.com/project-manager/workflows/actions/loop.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.
