# Automations

> Scheduled tasks for the agent: schedules, run permissions, manual runs, pause, history. A service on the machine runs them — even with the window closed.

An **automation** is a task for the agent that starts by itself on a schedule: “every Monday
at 9:00 run the tests and write down what failed”, “on Fridays put together a summary of the week’s commits”.
Each run is a new session in the project; the result waits for you in the session list.

The Buff Code service on this machine starts them — even when the window is closed. If the machine
is off, the run at that time does not happen.

_Illustration: Two automations: a morning test check on Mondays and a commit summary on Fridays._

## The list

The tabs at the top filter automations by state: **All**, **Now running**, **Awaiting
permission**, **With errors**, **Paused**. Each card has:

- the name and the state — “Active” or “Paused”;
- the schedule and the project: “Mon at 09:00 · teashop”;
- the **next run** and how many runs there have been; the result of the last one — “Completed”, “Failed”…;
- buttons:

| Button | What it does |
| --- | --- |
| **Run now** | an extra run; the schedule does not shift |
| **Open session** | the session of the last run |
| **Pause** / **Resume** | stop the schedule (“Paused — does not run on schedule”) and bring it back |
| **Edit** | open the editor |
| **History** | all runs: when, manually or on schedule, how long it ran, the result, a link to the session |
| **Delete** | delete the automation; the run sessions stay |

## A new automation

**“New automation”** opens the editor:

_Illustration: A schedule by days of the week: Friday, 18:00. Under the time — when the next run will be._

| Field | What it sets |
| --- | --- |
| **Name** | what the automation is called in the list and in the run sessions |
| **Schedule** | “Every N minutes or hours”, “Daily”, “On days of the week”, “Every N weeks”, “Monthly”; under it — the time and a “Next run — …” line, so you see right away what you have set |
| **What the agent should do** | the whole task. Each run is a new session: the agent does not see past conversations, so write as if explaining for the first time |
| **Project** | the folder the agent works in |
| **Permissions in a run** | “Ask”, “Edit on its own” or “Full access” — the same [modes](/en/docs/buff-code/work/session#permission-modes). If a run still asks for permission, it waits for your answer in its session, and the card goes to the “Awaiting permission” tab |
| **Model** | an organisation model or “Project default” |

The time is the local time of the machine the service runs on.

## Run history

_Illustration: History: when it ran, how (manually or on schedule), how long it took and how it ended._

An entry can be deleted — the run’s session stays.

## How it is recorded

A run session is an ordinary development session: it is visible in the column and in the Buff workspace and goes into
the [work records](/en/docs/buff-code/sessions) just like yours. Usage is charged to the organisation’s plan.

## In the console

_Illustration: /automations in the console._

`/automations` — the same list with search: schedule, project and next run; choosing a row gives
a manual run, pause, history. `/automation-new` — a new automation step by step. The agent can do it too —
ask in the chat: “create an automation: check the tests every day at 9:00”.
