Iteration

Updated at:

Definition

An iteration node acts as a task batch processor. It executes the same operation on each element in an array. After all elements are processed, the node outputs all the results. It is often used with an array variable.

For example, when translating a long article, inputting all the content into a large language model (LLM) node at once might exceed the length limit for a single conversation. In this case, you can first split the long article into multiple segments. Then, use an iteration node to perform batch translation on each segment. This helps you avoid exceeding the LLM message limit.

Prerequisites

Create an AI Studio service

Node configuration

Click the image after the Start node to add an Iteration node.

Feature overview

To use an iteration node, the input value must be a list object. The iteration node processes all elements in the array variable from the Iteration Start node. The same processing steps are applied to each element. The processing of a single element is called an iteration. The node outputs all results after all iterations are complete.

The structure of an iteration node typically consists of three main components: Input variable, Iteration workflow, and Output variable.

  • Input variable: Accepts only data of the Array variable type.

  • Iteration workflow: You can orchestrate multiple workflow nodes and design different task steps within the iteration node.

  • Output variable: Supports only output variables in the **Array[List]** format.