Filters an array to keep only items that match a condition. Use it after a RAG query, HTTP request, or Loop that produces a list, to narrow down results before passing them to another step.
filterWhen a workflow receives a large array of items โ search results, orders, users, log entries โ you often only need a subset of them. The Filter node lets you reduce that array to just the relevant items using a simple condition before passing it on to a Loop, an Agent, or any subsequent step.
You specify a property name on each array item and compare it against a value using one of the built-in operators. The condition is evaluated once per item. Items for which it evaluates to true are kept; all others are discarded. The filtered result and item counts are then available to downstream steps via the standard step output syntax.
| Field | Status | Description |
|---|---|---|
| Array | Required | Reference to the array to filter, e.g. {{ search.output.results }}. |
| Condition Field | Required | The property name on each array item to evaluate, e.g. score. |
| Operator | Required | Comparison operator โ equals, not_equals, greater_than, less_than, contains, not_contains, is_null, is_not_null, is_empty, is_not_empty. |
| Value | Optional | The value to compare against. Not needed for is_null, is_not_null, is_empty, is_not_empty. |
The Filter node exposes the following fields on its step output:
| Field | Type | Description |
|---|---|---|
items | array | Filtered array containing only items that matched the condition. |
count | number | Number of items in the filtered array. |
excluded_count | number | Number of items removed by the filter. |
search) that returns an array of
result objects, each with a score property.
{{ search.output.results }}, Condition Field to
score, Operator to greater_than, and
Value to 0.8.
{{ filter.output.count }} is greater_than 0
before continuing.
{{ filter.output.items }} โ the agent now processes only
high-confidence matches.
items is an empty array and count is 0. Use a Logic Gate after the Filter to handle the empty-result case gracefully.is_null or is_not_null to filter items where a field may be absent, avoiding errors that would occur with a direct comparison.