Skip to main content

Process a list with a loop

In this tutorial, you will process each item in a list and return the collected results.

1. Prepare the input

Create an Array block with several representative values, such as document names or request IDs. Connect it to the loop input.

2. Add the loop

1

Create the loop body

Add the block or subflow that should run once for each item.
2

Use the current item

Connect the loop’s current-item output to the processing step.
3

Collect the result

Connect the processed value to the loop’s result collection.
4

Set a safe limit

Configure a maximum iteration count that matches the largest expected input. This prevents an unexpected condition from running indefinitely.

3. Test the loop

Run the workflow with:
  • An empty list
  • One item
  • Several valid items
  • An invalid item in the middle of the list
  • A list larger than the configured iteration limit
Confirm whether an item failure should stop the whole workflow or be recorded and allow remaining items to continue.

Loops or batching?

See Loops and Batching for detailed guidance.
Always set a clear completion condition and maximum iteration count. Test failure behavior before publishing the workflow.