Skip to main content

Loop Execution

The Loop Execution Node can be used to execute a specific functional node in a loop based on a specified data object.

Configuration Instructions

When configuring loop execution, first drag and drop a Loop Execution Node, then drag and drop the action node to be executed in a loop onto the loop node. The action node set for loop execution will display a loop icon in its upper-right corner.

Loop Object

Loop Object is a list object that can be retrieved and set from the output of any node preceding the loop node or from environment variables, for example manualTrigger.output.listdata.

The Loop Node iterates through the input list object, extracts each item, and invokes the specific function of the Action Node. Within the Action Node, you can access the current loop iteration count and loop object via $loop.index and $loop.value.

For example, the Loop Object contains

[
{"key1":"value1"},
{"key2":"value2"},
{"key3":"value3"},
]

During loop invocation, In the first loop iteration: $loop.index is 0, and $loop.value is {"key1":"value1"}; In the second loop iteration: $loop.index is 1, and $loop.value is {"key2":"value2"}; In the third loop iteration: $loop.index is 2, and $loop.value is {"key3":"value3"};

Loop Node Configuration

The other configurations of the Loop Node are identical to those of the Action Node on it. In any configuration within the Loop Node, where expressions are supported, you can access the specific values of the loop object via $loop.index and $loop.value.

Node Output

After iteratively invoking the Action Node, the Loop Node records and aggregates the return value of each invocation, outputting it as a new list object in the output field.

If the Action Node fails with an error during loop execution, the node will output the error message in the error field.