Skip to main content

Loop Node

warning

This node is in beta and may not be fully tested or documented. Use with caution.

Call a subflow for each item in an array The Loop Node iterates over each item in an array and calls a Sub Flow for each item concurrently, up to a specified maximum number of concurrent executions. The Error Handler property allows you to specify how errors should be handled during the execution of the subflows. There are three options available:

  1. None: If an error occurs, it will be thrown and the execution will stop. This is the default behavior.
  2. Catch: If an error occurs, it will be caught and the first error will be returned from the Loop Node. You can branch the flow logic to handle this error accordingly.
  3. Null Value: If an error occurs, the execution will continue and the result for the item that caused the error will be null. This option is useful if you want to ensure that the output array has the same length as the input array, even if some items cause errors.
warning

The Loop Node requires an array of objects as input, not an array of primitive types like string, number, or boolean. See the example below for details.

Input

"words": [
{
"word": "dog"
},
{
"word": "cat"
}
]

Output

{  
"results": [
{
"translated_word": "perro"
},
{
"translated_word": "gato"
}
]
}

Properties

LabelPropertyTypeDescriptionDefault ValueIs Required
Sub FlowsubFlowReferencebotdojo/types/subflow_referencenull
Max ConcurrentmaxConcurrentbotdojo/types/number5
Error HandlererrorHandlerbotdojo/types/optionsNone,Catch,Null Value