Skip to content

Array Filter

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.

ParameterTypeRequiredDescription
sourcetextNoDot-notation path to the array within data. If empty, uses data directly. Example: items, result.rows
conditiontextareaYesJavaScript expression. Use item for the current element and data for the full payload
includeNonMatchingselectNofalse (default): returns only the matching array. true: returns { matching, nonMatching, _matched, _removed, _total }

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 }
]
{
"matching": [
{ "name": "Luis", "price": 120 },
{ "name": "Marie", "price": 200 }
],
"nonMatching": [
{ "name": "Ana", "price": 50 },
{ "name": "Jean", "price": 30 }
],
"_matched": 2,
"_removed": 2,
"_total": 4
}
{
"label": "Only Spain",
"condition": "item.country === 'ES'"
}
{
"label": "Price between 50 and 200",
"condition": "item.price >= 50 && item.price <= 200"
}
{
"label": "Active Adults",
"condition": "item.status === 'active' && item.age >= 18"
}
{
"label": "VIP Customers",
"condition": "item.tags && item.tags.includes('vip')"
}
{
"label": "Non-cancelled",
"condition": "item.status !== 'cancelled'"
}
{
"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

FieldDescription
(array)When includeNonMatching: false — direct array of matching elements
matchingWhen includeNonMatching: true — elements that passed the filter
nonMatchingWhen includeNonMatching: true — elements that did not pass
_matchedCount of matches
_removedCount of discarded elements
_totalTotal elements evaluated

The condition is a JavaScript expression evaluated with "use strict". Available variables:

VariableDescription
itemCurrent element of the array being evaluated
dataFull payload of the current node

Supported operators: ===, !==, >, <, >=, <=, &&, \|\|, !

Supported methods: item.field.includes(), item.field.startsWith(), item.field.endsWith(), Array.isArray(item.field), etc.

  • If item does not have the field referenced in the condition, the expression returns false (no error); the element goes to nonMatching
  • Dynamic variables ({{field}}) in the condition are resolved before evaluation
  • The source field 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