# Add a Loop to Process a List of Items

# Add a Loop to Process a List of Items

Follow these steps to enable iterative processing over a collection of data, such as multiple files or database records.

  • Step 1: Add and Link the Component

    • Drag the Loop component from the "Flow Control" section onto the canvas and link it to a preceding node.
  • Step 2: Configure the Loop Input

    • In the Configuration Panel, map an array from a previous step to the mandatory Input field, labeled "List of Item(s)".
  • Step 3: Set the Error Handling Action

    • Select an option from the On Error Action dropdown. "Continue on Error" will allow the loop to proceed to the next item if one iteration fails, while other options will stop the entire workflow.
  • Step 4: Define the Loop Body

    • Add components inside the loop's container on the canvas. Within these components, you can reference the currentItem and currentIndex variables to process each item from the input array individually.
  • Step 5: Configure the Loop Output (Optional)

    • In the Output field, you can define a context variable to store and pass the aggregated results of the loop's operations to subsequent components.

#