π― MF used in sequencer β
This section presents the merge fields that are specific to the Sequencer.
They are designed to be used only within actors like Loop and API Call, and their behavior depends on the actor configuration and triggers.
π loop_item Merge Field Documentation β
loop_item is a Sequencer-specific merge field available inside any actor that is executed downstream of a Loop actor. This includes actors connected directly or indirectly to the Loop actor.
During execution, the Loop actor iterates over a collection and exposes the current element as loop_item. Each downstream actor invocation receives the value corresponding to the current iteration.
π Table of Contents β
- π Overview
- π― Availability
- βοΈ Behavior
- ππ Good vs Bad Configuration Examples
- π Summary
π Overview β
The merge field loop_item represents the current item processed by a Loop actor.
It supports nested properties:
{{ loop_item.name }}
{{ loop_item.mime_type }}
{{ loop_item.size }}Depending on the Loop's source, may represent:
- an array item (Array source, API Call source, Variable source)
- a document representation (Document Picker source)
Example usage inside an API Call actor:
url="https://example.test/{{ loop_item.size }}"
headers="?file={{ loop_item.name }}"
params='{"type": "{{ loop_item.mime_type }}"}'π― Availability β
loop_item can be used in any actor executed downstream of a Loop actor.
- directly connected to a Loop actor triggered by "Loop item processed"
- indirectly connected through other actors
The merge field is available within the execution context of a single loop iteration, meaning each downstream actor receives the value of loop_item corresponding to the currently processed element.
βοΈ Behavior β
1. Correct Rendering During API Call Test β
When testing an API Call actor connected via "Loop item processed":
loop_itemresolves to the actual current itemNested properties render correctly
If the Loop's source is misconfigured (not an array):
It attempts to use the first item of the provided data
If no usable item exists β empty string
2. Behavior with "Actor completed" Trigger β
When the API Call actor is connected using "Actor completed":
- During testing,
loop_itemβ empty string
3. Document Picker as Loop Source β
Assumptions:
- Loop actor uses Document Picker
- API Call actor is connected via "Loop item processed"
- API Call is configured correctly
Behavior:
Document Picker Input loop_item result
Empty "" (empty string)
Contains document Document representation
4. Exception Handling β
During API Call testing:
- If resolving
loop_itemthrows any exception, it is rendered as empty string
5. Multiple Loop Connections β
If the API Call actor is connected to multiple Loop actors, each potentially supplying a :
- During testing, the Sequencer always uses the most recently modified Loop actor
- All other Loop connections are ignored for the purpose of
evaluation in testing mode
ππ Good vs Bad Configuration Examples β
Loop with Array Source β
π Good β
{
"files": [
{ "name": "file1.txt", "size": 1200 },
{ "name": "file2.txt", "size": 3400 }
]
}where json.path is files
π Bad β
{}or
{
"files": [
{ "name": "file1.txt", "size": 1200 },
{ "name": "file2.txt", "size": 3400 }
]
}where json.path is not set
Loop with Document Picker β
π Good β
{{ loop_item.size }} β "312345"
{{ loop_item.name }} β "invoice.pdf"
{{ loop_item.mime_type }} β "application/pdf"OR β
{{ loop_item }} β
{
"name": "invoice.pdf",
"size": 312345,
"mime_type": "application/pdf",
}Incorrect Triggers β
π Good β
- Loop item processed
π Bad β
- Actor completed
π Summary β
loop_item is a dynamic merge field tied to the execution context of a Loop actor:
- Available in any actor executed downstream of a Loop actor
- Represents the current element processed in a loop iteration
- Supports nested properties
- Handles arrays and documents
- In all error cases β resolves to an empty string
- When multiple Loops are connected, the last modified Loop is used during testing
π loop_counter Merge Field Documentation β
loop_counter is a Sequencer-specific merge field available inside any actor that is executed downstream of a Loop actor. This includes actors connected directly or indirectly to the Loop actor.
During execution, the Loop actor iterates over a collection and exposes the current iteration index as loop_counter.
The value starts from 1 for the first processed element and increases by 1 for each subsequent iteration.
π― Availability β
loop_counter can be used in any actor executed downstream of a Loop actor.
This includes actors that are:
- directly connected to the Loop actor
- indirectly connected through other actors
- triggered during the execution of the Loop iteration
The merge field is available within the execution context of a single loop iteration, meaning each downstream actor receives the loop_counter value corresponding to the current iteration.
βοΈ Behavior β
loop_counterrepresents the index of the current loop iteration.- The value increments with every processed element.
- The first iteration returns 1, the second 2, and so on.
- The value is recalculated for each loop iteration.