Blocks

Loop

Iterate and repeat operations

Create loops to iterate over data, repeat operations, or process arrays. Supports for loops, while loops, and foreach loops with break and continue conditions.

Back to Catalog
Core Blocksloop

Block Preview

Loop

Iterate and repeat operations

Usage

  1. Add the block to your workflow and connect it to the upstream step.
  2. Configure any required credentials or tokens in the inputs.
  3. Fill in required inputs and optional parameters for the run.
  4. Run a test execution, inspect outputs, and iterate before deploying.
  5. Deploy the loop block with monitoring enabled in production.

Inputs (UI)

Loop Type

dropdown

Layout: half

Options: For Loop (Count), While Loop, For Each (Array), For Each (Object)

Max Iterations

short-input

Placeholder: Maximum number of iterations

Layout: half

Iteration Count

short-input

Placeholder: Number of iterations

Layout: half

Condition: loopType = ["for"]

Start Value

short-input

Placeholder: Starting value

Layout: half

Condition: loopType = ["range"]

End Value

short-input

Placeholder: Ending value

Layout: half

Condition: loopType = ["range"]

Step Value

short-input

Placeholder: Step increment (default: 1)

Layout: half

Condition: loopType = ["range"]

Array Data

long-input

Placeholder: Array or object to iterate over... (JSON format)

Layout: full

Condition: loopType = ["foreach","foreach_object"]

While Condition

long-input

Placeholder: condition => condition.value < 100

Layout: full

Condition: loopType = ["while"]

Break Condition

long-input

Placeholder: item => item.error === true

Layout: full

Continue Condition

long-input

Placeholder: item => item.skip === true

Layout: full

Item Variable Name

short-input

Placeholder: Variable name for current item (default: item)

Layout: half

Condition: loopType = ["foreach","foreach_object"]

Index Variable Name

short-input

Placeholder: Variable name for current index (default: index)

Layout: half

Parallel Execution

switch

Execute iterations in parallel

Layout: half

Collect Results

switch

Collect results from each iteration

Layout: half

Inputs (API)

loopType

string

Optional

maxIterations

number

Optional

iterationCount

number

Optional

startValue

number

Optional

endValue

number

Optional

stepValue

number

Optional

arrayData

json

Optional

whileCondition

string

Optional

breakCondition

string

Optional

continueCondition

string

Optional

itemVariable

string

Optional

indexVariable

string

Optional

parallel

boolean

Optional

collectResults

boolean

Optional

Outputs

Primary response type:

{
  "content": "string",
  "loopType": "string",
  "iterations": "number",
  "currentIteration": "number",
  "loopData": "json",
  "currentItem": "json",
  "breakCondition": "string",
  "continueCondition": "string"
}

Tool Access

loop_processor
Loop | NowFlow Blocks