# Loop

### Description

Loops the node for a certain amount or time.

**To create it**, right-click on the node and select <mark style="color:purple;">Add Decorator/Loop</mark>.

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2FWSxrHHWi9Qiu3erFNwuA%2FLoop%201.png?alt=media&#x26;token=0439ecd6-0f87-46a5-9aec-05b87f2ec6bd" alt=""><figcaption><p>How to create this decorator</p></figcaption></figure>

This decorator has a number of fields, that are highlighted in picture below.

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2F5aXSraTbREBOwFyrTWzg%2FLoop%202.png?alt=media&#x26;token=b7f0e7d8-0855-436d-bfda-fa90a62f961c" alt=""><figcaption><p>Fields</p></figcaption></figure>

### Fields

| Name      | Description     |
| --------- | --------------- |
| Node Name | Name of node    |
| Type      | Type of looping |

### Looping types

{% tabs %}
{% tab title="Count" %}
Loops on a certain number of occurrences

#### Parameters

| Name      | Description     |
| --------- | --------------- |
| Num Loops | Number of loops |

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2FLZOnohZRtEDVTU4ZL1fG%2FLoop%203.png?alt=media&#x26;token=a4abd0fc-d395-4fc6-b104-58cf9e09bcd5" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Infinite" %}
&#x20;Waiting for a certain time before exiting the node.

#### Parameters

| Name                       | Description                                  |
| -------------------------- | -------------------------------------------- |
| Infinite Loop Timeout Time | Waiting time after which it exits the node   |
| Finish state               | State that is returned when exiting the node |

#### Finish States

* Success
* Failure
* Aborted
* Running

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2FF7VGDZJRrBfhgWl6RLH0%2FLoop%204.png?alt=media&#x26;token=8088d5ea-fee9-49b9-98fa-dd89008bb75f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Infinite Loop Timeout Time is set to -1 by default. This value makes the loop infinite.
{% endhint %}

{% hint style="info" %}
Finish State is enabled only if Infinite Loop Timeout Time is greater than zero.
{% endhint %}
{% endtab %}

{% tab title="Until" %}
Waiting until the given value is returned

#### Parameters

| Name       | Description            |
| ---------- | ---------------------- |
| Until Type | Type of desired result |

#### Until Type

* Until Success
* Until Failure

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2FagZoH3WUasFbIhSeH2zn%2FLoop%205.png?alt=media&#x26;token=a87004e3-8b65-4565-bfc7-fd5ed713575c" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
