• Tools
  • Tools
loading...
No Results
  • Get Started
    • Welcome to GoInsight.AI
    • GoInsight.AI Overview
    • LLM Selection Guide
  • InsightFlow
    • InsightFlow Introduction
    • Types of InsightFlow
    • Interactive Flow
      • Editing and Debugging Interactive Flow
      • Publishing an Interactive Flow
      • Security Settings for Interactive Flow
    • Service Flow
      • Editing and Debugging Service Flow
      • Publishing a Service Flow
    • Services & Tools
      • Tool
      • Service
      • Agent Strategy
    • Node
      • Start
      • Answer
      • LLM
      • Knowledge Retrieval
      • Document Read
      • Document Write
      • Document Delete
      • HTTP Request
      • KnowledgeFocus LLM
      • Agent
      • Progress
      • Tool Call
      • IF/ELSE
      • Question Classifier
      • Branch Aggregator
      • Multi branch Selector
      • Iteration
      • Interactive Form
      • Pause & Resume
      • Delay
      • Auto-Continue
      • Template
      • Code
      • JSON Variable Extractor
      • Variable Assigner
      • Variable Extractor
      • End
    • Node Error Handling Strategy
    • Create Your First Workflow
  • Marketplace
    • Marketplace
  • Documents
    • Workspace Documents
    • Personal Data
  • Workspace
    • GoInsight Workspace Introduction
    • Collaboration Workspace
  • Quick Chatbot
    • Build a Quick Bot
  • Team Management
    • Access Control
    • Usage
    • Audit Center
    • Credential Management
    • Model Management
  • Knowledge 101
    • Key Concepts
    • Data Security
    • ABEvent
    • Interactive Form: JSON Configuration
    • Context Is the Foundation of AI Collaboration
    • Build Collaborative Context with Say It for Me
    • Use Expressions with Variables
Home > Documentation > InsightFlow > Node

Iteration Node

Definition

The Iteration node is used to repeatedly execute a set of nodes within a workflow.

When a task requires applying the same processing logic to multiple objects, you can use the Iteration node. You can add child nodes inside the Iteration node, and the system will run these child nodes multiple times according to the specified iteration rules.

Common scenarios include:

  • Generating follow-up emails for a group of customers one by one
  • Generating usage reports for a group of devices one by one
  • Checking the status of a group of orders one by one
  • Summarizing a group of documents one by one
  • Processing multi-line text line by line
  • Querying data by pages and processing the results page by page

A single run of the Iteration node supports up to 60 iterations. If the data to be processed exceeds 60 items, it is recommended to split the data first or control the processing quantity in a preceding node.

Iteration Modes

The Iteration node supports three iteration modes: Specify Count, Iterate Collection, and Iterate Lines.

iteration mode

Specify Count

Specify Count means repeating the iteration for a set number of times.

For example, if the iteration count is set to 5, the nodes inside the iteration will execute 5 times.

This mode suits scenarios with a fixed number of executions, such as generating exactly 5 pieces of content or performing 3 fixed checks.

In Specify Count mode, the current iteration's Item changes with the iteration count: in the 1st iteration, Item is 1; in the 2nd iteration, Item is 2, and so forth.

Iterate Collection

Iterate Collection is used to process data of type Array.

This Array usually comes from the output variable of a preceding node. For example, a preceding node may query a list of customers, devices, or orders, or parse out a list. After the Iteration node selects this Array variable, it will iterate through the elements in order.

The number of elements in the array typically equals the number of iterations, but a single run supports up to 60 iterations.

For example, a preceding node outputs a customer list:

[
  {
    "name": "Alice",
    "email": "alice@example.com"
  },
  {
    "name": "Bob",
    "email": "bob@example.com"
  }
]

After the Iteration node selects this customer list as the input variable, it will execute 2 iterations:

  • 1st iteration: Item is Alice's customer information.
  • 2nd iteration: Item is Bob's customer information.

Inside the iteration, the LLM node can reference the current iteration's Item to generate email content for the current customer, analyze customer needs, or perform other processing logic.

Iterate Lines

Iterate Lines is used to process multi-line text.

The system splits the text by lines, with each line serving as an iteration element and processed once per iteration.

For example, the input content:

a@example.com
b@example.com
c@example.com

The Iteration node will execute 3 iterations, processing one email address per iteration.

In Iterate Lines mode, the current iteration's Item is the current line of text.

This mode is suitable for data where each line represents one object, such as email lists, keyword lists, task lists, etc.

Iteration Built-in Variables

Within the Iteration node, child nodes can use built-in variables provided by the iteration.

VariableTypeDescription
ItemString / Number / Object, etc.The data carried into the current iteration
CounterNumberThe current iteration number
ContinueBoolWhether the current iteration should continue

Item is the most commonly used variable in the iteration, representing the data being processed in the current round.

The meaning of Item varies by iteration mode:

  • Specify Count: in the 1st iteration, Item is 1; in the 2nd iteration, Item is 2, and so on.
  • Iterate Collection: Item is the current element in the array.
  • Iterate Lines: Item is the current line of text.

Counter indicates which iteration the process is currently on.

Continue is a Bool variable indicating whether the current iteration should continue.

Iteration Output

Nodes inside the iteration may produce results in each round.

If you want to unify and use these results after the iteration ends, you can configure the variables to be collected in "Iteration Output".

For example:

  • Generating one email per iteration, then getting a list of emails after the iteration ends.
  • Analyzing one device per iteration, then getting a list of device analysis results after the iteration ends.
  • Summarizing one document per iteration, then getting all summaries after the iteration ends.

After configuring iteration output, the system aggregates the specified variables' results from each round into an array for subsequent nodes after the Iteration node to use.

Ending Iteration

Inside the iteration, you can add an End Iteration node to end the entire iteration prematurely.

When the workflow reaches an End Iteration node, the iteration immediately ends regardless of any remaining rounds or unprocessed data; no further rounds will be executed.

This node is often used together with a condition node to stop the iteration early when a certain condition is met.

add end iteration

For example, when querying paged data, you can first set a large iteration count to request data page by page. Each round queries one page and judges whether the current page is the last page.

  • If not the last page, continue to the next round.
  • If it is the last page, enter End Iteration to end the iteration early.

This way, even if the iteration count has not reached the limit, the system will not continue executing unnecessary subsequent paged queries.

Error Response Method

The Iteration node supports configuring an error handling method to decide how to handle errors when a given round fails.

MethodDescription
Terminate on ErrorWhen an error occurs in any round, terminate the Iteration node and output the error information
Remove Error OutputIgnore the erroring item, continue processing subsequent elements, and keep only the normal results in the final output

If each round's task is critical, it is recommended to use "Terminate on Error".
If it is a batch processing task where some objects are allowed to fail, you can use "Remove Error Output".

Output Variables

The Iteration node outputs the following variables:

VariableTypeDescription
LoopsNumberTotal number of iterations
ElementsNumberNumber of output elements; if multiple outputs are configured, takes the largest element count
Custom Output VariablesArray[…] Variables configured in "Iteration Output", e.g., Text Array[String]

Custom output variables come from the "Iteration Output" configuration.

For example, inside the iteration, an LLM node generates email content, and this content is configured as an iteration output. After the iteration ends, the Iteration node outputs an array of email contents, with each element corresponding to the result generated in one iteration.

Example

Suppose the sales team needs to generate follow-up emails for a group of customers.

  1. A preceding node outputs a customer list, including customer name, email, and follow-up background.
  2. The Iteration node selects the "Iterate Collection" mode and uses the customer list as the input variable.
  3. Each iteration extracts one customer, and the

Frequently Asked Questions

Q1: How do I add other nodes to the Iteration node?
Click "+ Add" inside the Iteration node; nodes within the loop can be freely dragged and dropped.
Q2: How is this different from looping with a code execution node?
Looping operations with a code execution node requires writing code, which is not suitable for those without a coding background. The Iteration node supports various looping methods, making it more convenient.
Updated on: Jul 9, 2026
Was This Page Helpful?
Prev Multi branch Selector
Next Interactive Form
Discussion

Leave a Reply. Cancel reply

Your email address will not be published. Required fields are marked*

Product-related questions?Contact Our Support Team to Get a Quick Solution>
On this page
  • Definition
  • Iteration Modes
    • Specify Count
    • Iterate Collection
    • Iterate Lines
  • Iteration Built-in Variables
  • Iteration Output
  • End Iteration
  • Error Response Method
  • Output Variables
  • Example
loading...
No Results