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.

Existence operators

These do not require a value — they check the field itself.

Field paths

Use dot notation to reach nested fields:
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.
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:
Filter configuration: Conditions: What happens at runtime: Given this input:
The Filter step returns:
  • 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}}.