Process Nodes

For Loop

Category
Process Flow
Node Type
Loop / Iteration

Overview

The For Loop Process Node allows you to repeat a group of workflow steps multiple times. You define how many times the loop should run using a start value and an end value, or by iterating over a list of items.

This is useful when a task needs to be executed several times, such as sending multiple notifications, performing repeated calculations, or processing multiple items from a database query.

Description

Execute actions repeatedly.

The For Loop node creates a cycle in your workflow. It runs the nodes placed inside it for each iteration until the end condition is met.

Counter Loop

Run a set number of times (e.g., from 1 to 5).

Array Loop

Iterate over a list of items (e.g., process each user in a list).

You can access the current loop variable dynamically within the inner nodes using specific notation.

Input Parameters

The For Loop node accepts settings to define the range or data to iterate over.

StartnumberRequired
The starting value of the loop counter.
Example
1
EndnumberRequired
The final value of the loop counter.
Example
5
StepnumberOptional
The increment value for each cycle. Default is 1.
Example
1
Loop VariablearrayOptional
Select an array field from a previous node to iterate over its items.
Example
"{{fetchData.data}}"
Accessing Loop Variables

Loop Notation: When iterating over an array, you can access the current item's data using the [] notation.

  • Current Item: {{nodeId.variable[]}}
  • Specific Field: {{nodeId.variable[].name}} or {{nodeId.variable[].email}}

Example: If you are looping over a list of users from a node named fetchUsers, you can use {{fetchUsers.data[].email}} in a "Send Email" node inside the loop.

Output Parameters

The node provides a summary of the execution.

iterationsarrayOptional
List of iteration values produced during the loop.
Example
[1, 2, 3, 4, 5]
totalIterationsnumberOptional
Total count of times the loop ran.
Example
5
Final OutputanyOptional
A summary of the loop execution results.

Output Type

Output Type: Iterative / Array

The node produces an iterative output, meaning it runs the inner steps multiple times. The final output is often an array containing the results from each cycle.

Example Usage

Example 1: Simple Counter

Loop 5 times to create 5 records.

{  "start": 1,  "end": 5,  "step": 1}
{  "iterations": [1, 2, 3, 4, 5],  "totalIterations": 5}

Example 2: Array Iteration

Process a list of 3 users.

{  "start": 0,  "end": 2,  "loopVariable": "{{fetchUsers.data}}"}
{  "iterations": [0, 1, 2],  "totalIterations": 3}

Inside the loop, {{fetchUsers.data[].name}} would resolve to "Alice", then "Bob", then "Charlie".

How to Use in a No-Code Workflow

1

Add the Node

Drag and drop the For Loop Process node into your workflow.

2

Set Range

Set the Start and End values. If looping over an array, use the array length or map the array field.

3

Add Inner Nodes

Place nodes inside the loop container. These nodes will run for every cycle.

4

Use Loop Variables

In the inner nodes, use the [] notation (e.g., {{nodeId.data[].field}}) to use data from the current iteration.

5

Run Workflow

Save and run. The workflow will execute the inner nodes repeatedly.

Best Practices

  • Test with a small range first (e.g., 1 to 3) to verify logic.
  • Always place at least one node inside the loop.
  • Use logging nodes inside the loop to debug each iteration.

Do / Don’t

Do
  • ✔️ Use the [] notation to access dynamic data for each item.
  • ✔️ Ensure your End value is not excessively high to avoid timeouts.
  • ✔️ Use Step to skip values if needed (e.g., process every 2nd item).
Don’t
  • ❌ Don’t create infinite loops (Start must be less than End, or logic must terminate).
  • ❌ Don’t forget to map the loop variable correctly in inner nodes.
  • ❌ Don’t nest too many loops deep as it complicates debugging.

Common Errors

Loop does not runErrorOptional
Start or End values are missing, or Start > End.
Empty OutputWarningOptional
No inner nodes produced output, or loop range was 0.
Variable not foundErrorOptional
Incorrect loop notation used. Ensure you use `[]`.

Example Workflow Integration

Use Case 1: Send Bulk Emails

Send a personalized email to a list of subscribers.

  1. Fetch Data: Get list of subscribers from database.
  2. For Loop: Iterate from 0 to {{subscribers.count}}.
  3. Send Email (Inside Loop):
    • To: {{subscribers.data[].email}}
    • Body: "Hello {{subscribers.data[].name}}..."
  4. Summary: Log "All emails sent".

Workflow Data Flow:

{{subscribers.data[].email}} →  {{sendEmail.to}}

Use Case 2: Process Order Items

Update inventory for each item in an order.

  1. Trigger: New Order Received.
  2. For Loop: Iterate over {{order.items}}.
  3. Update Data (Inside Loop): Decrease stock for {{order.items[].product_id}}.

Workflow Data Flow:

{{order.items[].product_id}} →  {{updateData.query.id}}