# Events

An **event** represents something that happened — a new order, a product update, midnight rolling around, or a webhook arriving from an external service. Events are the entry point to all Mechanic automation: when an event occurs, Mechanic checks which tasks are subscribed to it and runs them. Tasks can also emit new events, making it possible to build multi-step workflows where one task's output drives another.

An event always has a [**topic**](https://learn.mechanic.dev/core/events/topics) and **data** (even if the data is null/nil). Event attributes may be referenced in Liquid using the [**Event object**](https://learn.mechanic.dev/platform/liquid/objects/event).

## Where events come from

Events reach Mechanic from several sources:

* **Shopify webhooks** — Shopify sends events when something changes in your store. For example, `shopify/orders/create` fires when a new order is placed, and `shopify/products/update` fires when a product is edited. These are the most common event source.
* **Schedules** — Mechanic can generate events on a schedule. A topic like [`mechanic/scheduler/daily`](https://learn.mechanic.dev/core/topics-1#scheduler) fires once per day, useful for reporting, cleanup, or monitoring tasks.
* **On-demand runs** — Tasks can be run manually using `mechanic/user` topics. Topics like `mechanic/user/trigger`, `mechanic/user/text`, and `mechanic/user/form` add a "Run task" button in the Mechanic app. Topics like `mechanic/user/order` respond to [Shopify admin action links](https://learn.mechanic.dev/core/shopify/admin-action-links).
* **Custom events** — Developers can define their own event topics in the `user/` domain (e.g. `user/orders/export`). These are generated by tasks using the [Event action](https://learn.mechanic.dev/core/actions/event) or via [webhooks](https://learn.mechanic.dev/platform/webhooks), and are useful for chaining tasks together in multi-step workflows.

Each event carries **data** that tasks can use. For a Shopify webhook event, this is the resource data sent by Shopify (e.g. the order object). For scheduled events, the data is minimal. Tasks access this data through the [Event object](https://learn.mechanic.dev/platform/liquid/objects/event) in Liquid.

For a complete reference of available event topics, see [Topics](https://learn.mechanic.dev/core/events/topics).

## What happens next

When an event arrives, Mechanic creates a [**run**](https://learn.mechanic.dev/core/runs) to process it. Each run evaluates every [task](https://learn.mechanic.dev/core/tasks) that subscribes to that event's topic. If a task generates [actions](https://learn.mechanic.dev/core/actions) (like a Shopify API call or an email), those actions are queued and performed after the task run completes.

This is the core execution flow: **Event** → **Task Run** → **Action Run(s)**. To learn more, see [Runs](https://learn.mechanic.dev/core/runs).

{% hint style="info" %}
Incoming events may be selectively skipped using [event filters](https://learn.mechanic.dev/platform/events/filters). For handling high-frequency events, see [Debouncing events](https://learn.mechanic.dev/techniques/debouncing-events).
{% endhint %}
