Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Each

Overview

The Each Component iterates over a list and outputs a new message for each item.

The recommended way to build a loop in Appmixer is Each with Sequential turned on, the steps you want to run for every item, and the Continue Each component at the end:

Each (Sequential) ──item──▶ step ▶ step ▶ Continue Each
      │
      └──done──▶ steps after the loop (use the collected result)

Each sends one item, waits until Continue Each confirms it, and only then sends the next one. The items are processed one at a time and in order, and every item can add values to the loop's Result. Once all items are done, the done port emits the result, one entry per item. You don't need Storage or Join Each to collect it.

Running items in parallel (without Sequential) is still possible, see Other Options (Advanced).

Building a Loop

  1. Provide a List

    • Set Field (list) to an array, or to a string with a valid JSON array.

  2. Turn On Sequential

    • Leave Item Timeout at its default (300 seconds) unless one item can take longer.

  3. Add the Steps for One Item

    • Connect them to the item port. Use the value variable of the item port for the current item.

  4. End the Loop with Continue Each

    • Connect Continue Each after the last step that has to finish before the next item starts.

    • Map its Correlation ID and Index to the correlationId and index variables of the item port.

  5. Collect Results (Optional)

    • In Continue Each, add a row to Add to Result for every value you want to keep, for example id → ID of the created record.

  6. Continue After the Loop

    • Connect the steps that should run once all items are done to the done port. The collected values are in result.

If an item is not confirmed within Item Timeout (a step failed, or a Condition filtered the item out before Continue Each), the loop moves on to the next item instead of stopping. That item's entry in result is null.

Usage

Input Parameters

Parameter
Type
Description

list

array / string

The list to iterate over. If a string is provided, it must be a valid JSON array.

sequential

boolean

Send the next item only after the previous one has been confirmed by Continue Each. Off by default. Turn it on for the recommended loop.

itemTimeout

number

Sequential mode only. How long (in seconds) to wait for Continue Each to confirm an item before the loop moves on to the next one. Default 300, minimum 60.

delay

number

Optional. Delay between items in milliseconds (at most 60000). In sequential mode it is an extra pause before each next item, for example to stay within an API rate limit.

Input Ports

Port
Description

in

Receives the list to iterate over.

Output Ports

Port
Description

item

Emits each item from the list with additional metadata.

done

Fires after all items have been processed, with the total count, the correlation ID and the collected result.

Output Data for item Port

Field
Description

index

The index of the current item in the list.

value

The value of the current item.

count

Total number of items in the list.

correlationId

Unique identifier of this loop run.

Output Data for done Port

Field
Description

count

The total number of processed items.

correlationId

Unique identifier of this loop run.

result

One entry per item, in item order: an object with the fields that Continue Each added for that item, {} when it added none, or null for an item that was skipped after Item Timeout. Always an empty list when Sequential is off.

Example of result for a loop that created a record for every item, where the second item timed out:

Other Options (Advanced)

  • Parallel processing (Sequential off): all items are sent right away. This is faster, but when the steps after Each take a varying amount of time, faster items overtake slower ones, so the items leave the loop in a different order. result on the done port is empty, and done fires as soon as all items have been sent, not processed. To collect the processed items, use Join Each with the correlationId and count of Each.

  • Delay without Sequential: spaces the items out in time, but does not keep them in order.

Notes

  • Supports JSON Parsing: If list is a string, it will attempt to parse it as JSON.

  • State Persistence: Keeps track of progress and resumes processing if interrupted.

  • Nested Loops: Every sequential Each needs its own Continue Each, mapped to its own correlationId and index.

Last updated

Was this helpful?