Skip to main content
The Filter step takes a JSON array and returns only the items that match your conditions. Use it to extract relevant records from an API response, remove incomplete entries before passing data to a model, or isolate items that meet specific business rules. You define one or more conditions, choose whether all (AND) or any (OR) must match, and the step outputs the filtered array — same structure, fewer items.

Configuration

1

Input

An expression that resolves to a JSON array — for example, {{Steps.API_Call.Output.Body.data.orders}}.
2

Logical operator

AND (default) — an item must match every condition to be kept. OR — an item is kept if it matches at least one condition.
3

Conditions

One or more rules to evaluate against each item. Each condition has:
  • Field path — dot-notation path to the field (e.g., status, address.city). Leave empty to filter by the item value itself (useful for arrays of strings or numbers).
  • Operator — the comparison to apply.
  • Value — the value to compare against. Supports expressions like {{Variables.threshold}}. Not required for existence and emptiness operators.
  • Case sensitive — toggle for string comparisons (off by default).

Operators

Value operators

These require a comparison value.
OperatorWhat it checks
EqualsField value matches exactly (supports numeric and boolean coercion)
Not EqualsField value does not match
Greater ThanField > Value (numeric first, then lexicographic fallback)
Greater Than or EqualField ≥ Value
Less ThanField < Value
Less Than or EqualField ≤ Value
ContainsField string includes Value as a substring
Not ContainsField string does not include Value
Starts WithField string begins with Value
Ends WithField string ends with Value

Existence operators

These do not require a value — they check the field itself.
OperatorWhat it checks
ExistsThe field is present on the item (even if its value is null)
Not ExistsThe field is not present on the item
Is EmptyThe field is null, whitespace, or an empty array
Is Not EmptyThe field has a non-empty value

Field paths

Use dot notation to reach nested fields:
Field pathReaches
statusitem.status
address.cityitem.address.city
user.profile.emailitem.user.profile.email
(empty)The item itself — useful for primitive arrays like ["a", "b", "c"]
If a field path does not exist on an item, the condition evaluates to false for most operators. The exception is Not Exists, which returns true for missing fields.

Type coercion

The Filter step applies smart comparison:
  1. Numeric fields — if both the field value and the condition value parse as numbers, a numeric comparison is used. This means "10" is correctly treated as less than "9" in numeric mode, unlike string comparison.
  2. Boolean fieldstrue / false values are compared as booleans.
  3. String fallback — if neither numeric nor boolean applies, string comparison is used with the case sensitivity toggle.

Output

The step returns a JSON array containing only the items that passed your conditions. The original order is preserved.
{{Steps.Filter.Value}}  →  [ ...matching items... ]
If no items match, the output is an empty array [].

Use case: extract overdue invoices from an API

A finance agent fetches all invoices from an accounting API and needs to isolate the ones that are overdue and above a minimum amount before passing them to a model for follow-up email drafting. Agent flow:
Input → Fetch Invoices (HTTP) → Filter → Draft Emails (AI Model)
Filter configuration:
SettingValue
Input{{Steps.Fetch_Invoices.Output.Body.data.invoices}}
Logical operatorAND
Conditions:
#Field pathOperatorValueCase sensitive
1statusEqualsoverdueOff
2amountGreater Than500
3contact.emailIs Not Empty
What happens at runtime: Given this input:
[
  { "id": "INV-001", "status": "overdue", "amount": 1200, "contact": { "email": "jane@acme.com" } },
  { "id": "INV-002", "status": "paid", "amount": 800, "contact": { "email": "bob@corp.io" } },
  { "id": "INV-003", "status": "overdue", "amount": 300, "contact": { "email": "sue@example.com" } },
  { "id": "INV-004", "status": "overdue", "amount": 950, "contact": {} }
]
The Filter step returns:
[
  { "id": "INV-001", "status": "overdue", "amount": 1200, "contact": { "email": "jane@acme.com" } }
]
  • INV-002 is excluded: status is paid (fails condition 1)
  • INV-003 is excluded: amount is 300, below the 500 threshold (fails condition 2)
  • INV-004 is excluded: contact.email is empty (fails condition 3)
The AI Model step downstream receives only the qualifying invoice and drafts a follow-up email.

Tips

Use OR logic when you want to catch multiple categories at once. For example, to find invoices that are either overdue or disputed, set the logical operator to OR and add two conditions on the status field.
Chain a Filter step before a Sort step to first narrow down the data, then order the results. This keeps token usage low when the sorted output is passed to a model.
The input must be a JSON array. If your expression resolves to a single object or a primitive value, the step throws an error. If your upstream step returns a JSON object with an array inside it, reference the array field directly — for example, {{Steps.API.Output.Body.data.items}} instead of {{Steps.API.Output.Body}}.