DocsNodesFlowFor each

For each

Goes through a list one item at a time. Each pass leaves by body with the item; when the body leads back here, the next item goes. After the last one it leaves by done.

Kindcontrol:foreach
GroupFlow
Credits0.1 credits
Ports out2

How it looks

Settings

SettingRequiredWhat it does
ListcollectionYesWhere the list is in the run, like trigger.payload.readings or the json a URL answered with.

Ports

PortThe run leaves by it when
bodyOnce per item. Connect the last node of the body back to this node.
doneAfter the last item, or at once for an empty list.

What it adds to the run

Later nodes can read these, in a condition or as {{name}} in a text field.

ValueHolds
itemThe item for this pass.
indexIts position, from 0.
One at a time or all at onceFor each waits for each pass before the next. To handle every item at the same time, use For each, in parallel.

Problems you might see

CodeMeans
FOREACH_COLLECTION_NOT_ARRAYThe value at List isn't a list.

Problems found when you publish stop the publish and point at the node. Problems while a run is going fail the node, and its On failure setting decides what happens next. See the error codes for the API's own.