> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omneo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reaction Filters

> Using filter actions to conditionally gate reaction chains in Omneo.

A `filter` action evaluates a JSON Logic condition against the event context. If the condition returns `true`, the reaction chain continues. If it returns `false`, the chain stops and no further actions execute.

Filters are ordered by `sort_order` alongside other actions. Place filters before the actions you want to gate.

## Filter action structure

```json theme={null}
{
  "name": "filter",
  "sort_order": 1,
  "arguments": [
    {
      "name": "condition",
      "value": { ...JSON Logic condition... },
      "is_dynamic": null
    }
  ]
}
```

## Example: Filter by tier handle

Only continue if the achieved tier is "tier-2":

```json theme={null}
{
  "name": "filter",
  "sort_order": 1,
  "arguments": [
    {
      "name": "condition",
      "value": {
        "===": [
          { "var": "definition.handle" },
          "tier-2"
        ]
      },
      "is_dynamic": null
    }
  ]
}
```

## Example: Filter by product brand

Only continue if the transaction item's brand is in a specific list:

```json theme={null}
{
  "name": "filter",
  "sort_order": 1,
  "arguments": [
    {
      "name": "condition",
      "value": {
        "in": [
          { "var": "product.brand" },
          ["brand", "BRAND", "example", "EXAMPLE"]
        ]
      },
      "is_dynamic": null
    }
  ]
}
```

## Multiple filters

Chain multiple filter actions with increasing `sort_order` values. All filters must pass for the chain to proceed:

```json theme={null}
[
  {
    "name": "filter",
    "sort_order": 1,
    "arguments": [{ "name": "condition", "value": { "===": [{"var": "tier_handle"}, "gold"] }, "is_dynamic": null }]
  },
  {
    "name": "filter",
    "sort_order": 2,
    "arguments": [{ "name": "condition", "value": { ">": [{"var": "aggregations.spend_12m"}, 500] }, "is_dynamic": null }]
  },
  {
    "name": "benefit.create",
    "sort_order": 3,
    "arguments": [...]
  }
]
```

## Data available in filters

Filter conditions have access to the full event context for the triggering event. The available variables depend on what fired the reaction:

* **Profile fields**: accessible at root level: `first_name`, `tier_handle`, `flattened_tags`, `reward_balance`, etc.
* **Aggregations**: accessible as `aggregations.spend_12m`, `aggregations.shop_count`, etc.
* **Tier definition**: `definition.handle`, `definition.name`
* **Transaction data**: `total`, `items`, `location_id`, etc.

For the full variable reference, see [Event Contexts](/dev-guides/webhooks/event-contexts) and [JSON Conditions](/dev-guides/reactions/json-conditions).
