Event filters are configured in your account's Mechanic settings, and each one has two parts:
- A name – can be anything you like
- A template – a Liquid template that renders either
When an event is received, Mechanic begins by running any event filters that are present on your account. (Order is not guaranteed.) Mechanic renders each event filter template, providing the event and shop variables. If an event filter's result equals
false, Mechanic halts processing of that event entirely. No tasks are run, in this scenario. Otherwise, processing continues normally, and tasks subscribing to the event's topic will run.
An event that wasn't processed will look something like this, in the Mechanic frontend:
This feature is useful if your 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), and (c) can be programmatically identified.
You can add, update, and remove event filters at any time. Any changes go into effect immediately.