> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buttons.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Cron triggers

> Run a button on a recurring schedule.

A cron trigger fires a **button** press on a recurring schedule. It lives on the
button's spec and runs under the `buttons serve` trigger engine.

```bash theme={null}
buttons trigger add daily-snapshot --cron --schedule "0 3 * * *"
buttons trigger add slack-sync --cron --schedule "0 */2 * * *"
```

Schedules are standard **5-field** cron expressions (parsed with `cron.ParseStandard`).
Cron attaches to a button only — drawers support webhook triggers, not cron (the
`cron` drawer kind is reserved but not implemented).

## Passing args

Pass `--arg KEY=VALUE` (repeatable) to set the args the press runs with each tick:

```bash theme={null}
buttons trigger add report --cron --schedule "0 9 * * 1" --arg window=weekly
```

`buttons trigger add` requires exactly one kind flag: `--cron`, `--watch`, or
`--webhook`. The trigger id is generated automatically (a short hex id) — there is
no `--name`, `--timezone`, or `--overlap` flag.

## Management

```bash theme={null}
buttons trigger list             # every trigger, across all buttons
buttons trigger list <button>    # just this button's triggers
buttons trigger rm <button> <trigger-id>
```

There is no `show`, `pause`, or `resume` — to stop a schedule, remove the trigger
with `buttons trigger rm` (the id comes from `buttons trigger list`).

## How it fires

A cron schedule is inert without a process watching it. The engine that fires
triggers runs **in-process inside `buttons serve`** (the local REST API server),
not a separate daemon:

* On startup, `buttons serve` collects every button's triggers. The cron scheduler
  starts only if at least one cron trigger exists.
* Each scheduled fire presses the target button with the trigger's configured args
  and **records a normal run in the button's history**.
* Run `buttons serve --no-triggers` to start the API without the trigger engine.

Cron triggers fire only while `buttons serve` is running — keep it up (or under a
process supervisor) for schedules to tick.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.