# Automations

> Run a backend function on a schedule or whenever records are created, updated or deleted.


Automations run one of your [backend functions](/docs/logic/backend-functions) without anyone clicking anything.

## Two kinds

| Trigger | Example |
|---|---|
| **Schedule** | "Every morning, email me yesterday's new orders." Runs every 5 minutes to every 7 days. |
| **Data change** | "When a booking is created, send the guest a confirmation." Runs on create, update and/or delete of a table. |

Describe what you want in the chat; Draftship writes the function and the automation file in `draftship/automations/`.

## Manage them

**Dashboard → Automations** lists each automation with its trigger, last run and result. **Run now** triggers it immediately; the **Enabled** switch pauses it. Every run is recorded in [Logs](/docs/logic/analytics-and-logs), including the function's response when it fails.

## Good to know

- Schedules start counting from the last run. A new automation runs within a minute of being created.
- A data-change automation receives the changed record. When many records change at once, it runs for up to 20 of them.
- Automations need a successful build of your app; they pause while a build is failing.
