Array Filter
Description
Section titled “Description”The Array Filter node filters an array of objects using a JavaScript expression. Each element of the array is evaluated individually: if the condition is true, the element is included in the result; otherwise, it is discarded.
Unlike Key Filter (which only compares against a fixed list of values), Array Filter supports any JavaScript expression: ranges, multiple conditions, string methods, comparisons with data from other nodes, etc.
The variable item represents the current element being evaluated. The variable data gives access to the full payload of the current node, useful for comparing against values from previous nodes.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| source | text | No | Dot-notation path to the array within data. If empty, uses data directly. Example: items, result.rows |
| condition | textarea | Yes | JavaScript expression. Use item for the current element and data for the full payload |
| includeNonMatching | select | No | false (default): returns only the matching array. true: returns { matching, nonMatching, _matched, _removed, _total } |
Output
Section titled “Output”Default (includeNonMatching: false)
Section titled “Default (includeNonMatching: false)”Returns the matching elements as a direct array (compatible with other nodes that expect an array):
[ { "name": "Luis", "country": "ES", "price": 120 }, { "name": "Marie", "country": "FR", "price": 200 }, { "name": "Marc", "country": "FR", "price": 150 }, { "name": "Rosa", "country": "ITA", "price": 180 }]With includeNonMatching: true
Section titled “With includeNonMatching: true”{ "matching": [ { "name": "Luis", "price": 120 }, { "name": "Marie", "price": 200 } ], "nonMatching": [ { "name": "Ana", "price": 50 }, { "name": "Jean", "price": 30 } ], "_matched": 2, "_removed": 2, "_total": 4}Usage Examples
Section titled “Usage Examples”Filter by exact country
Section titled “Filter by exact country”{ "label": "Only Spain", "condition": "item.country === 'ES'"}Filter by price range
Section titled “Filter by price range”{ "label": "Price between 50 and 200", "condition": "item.price >= 50 && item.price <= 200"}Filter active records of legal age
Section titled “Filter active records of legal age”{ "label": "Active Adults", "condition": "item.status === 'active' && item.age >= 18"}Filter by tag (array within object)
Section titled “Filter by tag (array within object)”{ "label": "VIP Customers", "condition": "item.tags && item.tags.includes('vip')"}Exclude cancelled orders
Section titled “Exclude cancelled orders”{ "label": "Non-cancelled", "condition": "item.status !== 'cancelled'"}Dynamic variable in condition
Section titled “Dynamic variable in condition”{ "label": "Above minimum price", "condition": "item.price > {{min_price}}"}The {{min_price}} value is resolved from the current node’s data before evaluating the condition.
Array from another node + include non-matching
Section titled “Array from another node + include non-matching”{ "label": "Filter Premium", "source": "customers", "condition": "item.plan === 'premium'", "includeNonMatching": "true"}data.matching → premium customers
data.nonMatching → the rest
Output Fields
Section titled “Output Fields”| Field | Description |
|---|---|
| (array) | When includeNonMatching: false — direct array of matching elements |
matching | When includeNonMatching: true — elements that passed the filter |
nonMatching | When includeNonMatching: true — elements that did not pass |
_matched | Count of matches |
_removed | Count of discarded elements |
_total | Total elements evaluated |
Condition Syntax
Section titled “Condition Syntax”The condition is a JavaScript expression evaluated with "use strict". Available variables:
| Variable | Description |
|---|---|
item | Current element of the array being evaluated |
data | Full payload of the current node |
Supported operators: ===, !==, >, <, >=, <=, &&, \|\|, !
Supported methods: item.field.includes(), item.field.startsWith(), item.field.endsWith(), Array.isArray(item.field), etc.
- If
itemdoes not have the field referenced in the condition, the expression returnsfalse(no error); the element goes tononMatching - Dynamic variables (
{{field}}) in the condition are resolved before evaluation - The
sourcefield supports cross-node variables:{{@NodeName.field}},{{#N.field}} - If the compiled condition throws an error for a specific element, that element is treated as non-matching (the overall flow is not broken)
- Does not require credentials
Related Nodes
Section titled “Related Nodes”- Array Group By — group array by field value
- Key Filter — filter by exact static value list
- Decision — conditional branching based on expression
- Iterator — iterate over filtered array