Sequentially performs the same operations on array elements until all results are outputted, functioning as a task batch processor. Iteration nodes typically work in conjunction with array variables.
For example, when processing long text translations, inputting all content directly into an LLM node may reach the single conversation limit. To address the issue, upstream nodes first split the long text into multiple chunks, then use iteration nodes to perform batch translations, thus avoiding the message limit of a single LLM conversation.
Using iteration nodes requires input values to be formatted as list objects. The node sequentially processes all elements in the array variable from the iteration start node, applying identical processing steps to each element. Each processing cycle is called an iteration, culminating in the final output.
An iteration node consists of three core components: Input Variables, Iteration Workflow, and Output Variables.
Input Variables: Accepts only Array type data.
Iteration Workflow: Supports multiple workflow nodes to orchestrate task sequences within the iteration node.
Output Variables: Outputs only array variables (Array[List]
).
Detailed Configuration Steps
sections
, and the parameter type is Array[Object]
.The effectiveness of parameter extraction is influenced by the model’s inference capability and the instructions given. Using a model with stronger inference capabilities and adding examples in the instructions can improve the parameter extraction results.
Configure the input variables GenerateOverallOutline/output
and Iteration/item
in the LLM Node.
Built-in variables for iteration: items[object]
and index[number]
.
items[object]
represents the input item for each iteration;
index[number]
represents the current iteration round;
The iteration node supports parallel processing, improving execution efficiency when enabled.
Below illustrates the comparison between parallel and sequential execution in the iteration node.
Parallel mode supports up to 10 concurrent iterations. When processing more than 10 tasks, the first 10 elements execute simultaneously, with remaining tasks processed after the completion of the initial batch.
Avoid placing Direct Answer, Variable Assignment, or Tool nodes within the iteration node to prevent potential errors.
Iteration nodes process multiple tasks and may encounter errors during element processing. To prevent a single error from interrupting all tasks, configure the Error Response Method:
Input and output variables maintain a one-to-one correspondence. For example:
Error handling examples:
Array variables can be generated via the following nodes as iteration node inputs:
The output variable of the iteration node is in array format and cannot be directly output. You can use a simple step to convert the array back to text.
Convert Using a Code Node
CODE Example:
Convert Using a Template Node
CODE Example: