Guides

Loop

Repeat operations a specified number of times

Overview

Looping is built from a pair of nodes - Loop Start and Loop End - placed at the beginning and end of the section you want to repeat. Unlike Array Iterator, which splits existing array data into bundles, a loop simply re-runs the nodes between Start and End until your exit condition (or the safety limit) is reached.

This is useful for batch operations, retries, generating test data, or any scenario where you need to repeat an action multiple times without an input array to iterate over.

Configuration

Max Iterations (Loop Start)

A safety limit on how many times the loop can run. Set to 0 for unlimited (combine with a Break Iteration / IF check inside the loop to avoid runaway loops).

10Stop after at most 10 passes

Timeout (Loop Start)

Optional time limit in milliseconds for the whole loop. Default is 0 (no timeout).

Output

On each pass, the Loop Start node outputs:

Output fields:

  • loopId - ID of this Loop Start node
  • iteration - 1-based current pass number
  • maxIterations - The configured safety limit

Reference these from downstream nodes the same way as any other node's output - by its sequence number, e.g. {{#2.iteration}}.

Examples

Example 1: Generate Test Data

Create 50 test records for development:

Max Iterations:50

Use the Loop Start node's output (e.g. {{#2.iteration}}) to create unique IDs for each record.

Example 2: Retry Logic

Attempt an operation up to 3 times:

[Loop Start: max 3] ──▶ [HTTP Request] ──▶ [IF: Success] ──▶ True: [Break Iteration]
     │                                            │
     ▼                                            ▼
  Attempt 1                                False: back to [Loop End] for next attempt
  Attempt 2
  Attempt 3

Combine with Break Iteration to exit early when successful.

Example 3: Pagination

Fetch multiple pages of data from an API:

Max Iterations:10

In HTTP Request: ?page={{#2.iteration}}
Fetches pages 1 through 10 (adjust the field mapping if your API is 0-based).

Example 4: Batch Processing

Process data in batches of 100:

Total items: 500
Batch size: 100
Iterations needed: 5

[Loop Start: max 5] ──▶ [Code: Get Batch] ──▶ [Process Batch] ──▶ [Loop End]
    │
    ▼
  Batch 1: items 0-99
  Batch 2: items 100-199
  Batch 3: items 200-299
  ...

Tips

Tip: Use Break Iteration inside the loop to exit early based on a condition.

Tip: iteration is 1-based, so subtract 1 in a mapping if you need a 0-based index.

Warning: Always set a Max Iterations safety limit (or an explicit exit condition via IF + Break Iteration). Leaving it at 0/unlimited with no exit condition can cause very long executions.

Note: A loop doesn't automatically carry forward data between passes. Use Set Variable or input mappings to pass data from one pass to the next.