# 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&#x26;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 %}
