> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/platform/events/filters.md).

# Event filters

An **event filter** is a Liquid template that evaluates incoming events before they reach your tasks. If the template's output equals the string "false", the event is skipped—no tasks will run for that [event](/core/events.md). Any other output (including empty output) allows the event to proceed normally.

Event filters have access to `event.topic`, `event.data` (the event payload, after any source-specific processing such as custom Shopify webhook payload customization), and `shop` variables. They're commonly used during bulk operations or data migrations to prevent unnecessary task runs. For example, if you're bulk-updating thousands of customers and have tasks subscribed to `shopify/customers/update`, you can use a filter to skip those update events during the migration period.

{% hint style="warning" %}
Event filters should not be confused with [Liquid filters](/platform/liquid/basics/filters.md).
{% endhint %}

## Configuration

Event filters are configured in an account's Mechanic settings.

An event filter has two parts:

* Name – any descriptive string
* Template – a Liquid template that renders `false` for events that should be ignored

<figure><img src="/files/q5MvBvVWEPuf0HykRtO6" alt="The Event filters section in Mechanic settings"><figcaption></figcaption></figure>

## Operation

When an event is received, Mechanic begins by running any event filters that are present on a store's Mechanic account. (Order is not guaranteed.) Mechanic renders each event filter template, providing the `event` and `shop` variables. If an event filter's output equals the string "false", Mechanic halts processing of that event entirely—no tasks are run. Any other output (including empty output) allows the event to continue to tasks subscribing to the event's topic.

An event that *wasn't* processed will look something like this, in the Mechanic frontend:

![](/files/AxKyidWjhcuak1OFuFTt)

This feature is useful if a Mechanic account is experiencing (or will experience) a large volume of events that (a) don't need to be processed at all, (b) would slow down your account if they *were* processed ([learn more about concurrency](/core/runs/concurrency.md)), and (c) can be programmatically identified.

You can add, update, and remove event filters at any time. Any changes go into effect immediately.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.mechanic.dev/platform/events/filters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
