# 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**](/core/events/topics.md) and **data** (even if the data is null/nil). Event attributes may be referenced in Liquid using the [**Event object**](/platform/liquid/objects/event.md).

## 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`](/platform/events/topics.md#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](/core/shopify/admin-action-links.md).
* **Custom events** — Developers can define their own event topics in the `user/` domain (e.g. `user/orders/export`). Tasks can generate them with the [Event action](/core/actions/event.md), which is useful for chaining tasks together in multi-step workflows. [Mechanic webhooks](/platform/webhooks.md) can generate them from external HTTP requests, and [custom Shopify webhooks](/platform/shopify/custom-webhooks.md) can generate them from filtered or customized Shopify webhook deliveries.

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](/platform/liquid/objects/event.md) in Liquid.

For a complete reference of available event topics, see the [Event topic list](/platform/events/topics.md).

## What happens next

When an event arrives, Mechanic creates a [**run**](/core/runs.md) to process it. Each run evaluates every [task](/core/tasks.md) that subscribes to that event's topic. If a task generates [actions](/core/actions.md) (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](/core/runs.md).

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


---

# Agent Instructions: 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:

```
GET https://learn.mechanic.dev/core/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
