Loop

Loop integration for n8n

Overview

This node implements a looping mechanism within n8n workflows, allowing repeated execution of subsequent nodes or actions. It is useful for scenarios where you need to iterate over a set of items or repeatedly perform a task until a condition is met. For example, it can be used to process batches of data, retry operations multiple times, or create custom loops in automation workflows.

Use Case Examples

  1. Processing a list of items in batches by looping through each batch.
  2. Retrying an API call multiple times until a successful response is received.
  3. Creating a custom loop to perform a series of actions repeatedly based on dynamic conditions.

Output

JSON

  • loopCount - The current iteration count of the loop
  • loopData - Data associated with the current loop iteration

Dependencies

  • An API key credential for the loop API

Troubleshooting

  • Ensure the loop API credential is correctly configured to avoid authentication errors.
  • If the loop does not behave as expected, verify the workflow logic and conditions controlling the loop iterations.
  • Timeouts or infinite loops can occur if exit conditions are not properly set; always define clear stopping criteria.

Discussion