Nodes
Append to array
Adds values to a list variable, creating the list on first use.
The Append to array node adds one or more values to a list kept in a variable. It is how a flow collects things as it goes: flags, reasons, matched rules.
When to use it
- Gather the results of several branches into one list, such as every risk flag raised.
- Replace hand-written
mergeformulas inside a Calculate node.
How it works
- The node checks the target variable: it must be a list, or not exist yet.
- Each value expression is evaluated.
- The values are appended, in order, to a copy of the list (created empty on first use) and the result is stored back.
Ports
| Port | Taken when |
|---|---|
Next | Always, after the list is updated. |
Configuration
| Field | What it does |
|---|---|
| Name | Label shown on the canvas and in the trace. |
| Variable | The list variable. A plain name, not a dotted path. |
| Values | One or more values (an expression or a literal) to append. |
What it writes
The list variable, longer than before: vars.flags. The trace shows how many items were appended and the new length.
In a real flow
When the amount is large, a flag is appended to flags. Both paths reach the output, which returns whatever the list holds, possibly empty.
When it fails
- The variable already holds something that is not a list:
VARIABLE_NOT_ARRAY. The node refuses to guess instead of coercing it. - A value expression fails:
EXPRESSION_FAILED. - A dotted variable name is an error; nesting belongs in the Output mapping. No values is a warning.
Good to know
- Branches that skip the node simply leave the list untouched, so downstream nodes should expect it to be missing or empty.