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

# Automations

> Schedule recurring agent tasks with email, Slack, and GitHub integrations

Automations let you run headless agent tasks on a cron schedule or from an external webhook. Each automation stores a natural-language prompt, one or more triggers, and optional integrations so the agent can deliver results to email, Slack, or GitHub without anyone opening the chat.

## Activity feed

The **Feed** page in the left sidebar shows a chronological log of all automation activity across your project. Each entry shows the automation name, run status, timestamp, and links to the resulting chat or story. Use the feed to monitor scheduled runs at a glance without opening individual automations.

## Creating an automation

1. Click **Automations** in the left sidebar.
2. Click **New automation**.
3. Enter a title and the prompt you want the agent to run.
4. Pick a schedule and configure integrations (see below).
5. Save.

After creation, each automation gets its own detail page where you can edit settings, review previous runs, and trigger a manual run.

## Triggers

An automation can be started **on a schedule**, **via a webhook**, or both. Pick the trigger(s) in the automation form. An automation needs at least one trigger to be active.

## Schedule

The schedule trigger runs the automation on a cron cadence. The UI offers presets:

* Hourly
* Daily (9 am)
* Weekdays (9 am)
* Weekly (Monday 9 am)
* Monthly (1st at 9 am)

You can also enter a custom cron expression for any other cadence.

Use the toggle on the automation detail page to pause or resume the schedule at any time.

## Webhook trigger

The webhook trigger lets an external system start an automation with an HTTP request instead of (or in addition to) a schedule. Enable **Via webhook** in the trigger picker; the detail page then shows the endpoint URL and a copyable example `curl`.

Send a `POST` to the automation's run endpoint, authenticated with an organization API key (the same `nao_...` bearer keys used by `nao deploy`):

```bash theme={null}
curl -X POST https://<your-nao-host>/api/automations/<automationId>/run \
  -H "Authorization: Bearer nao_..."
```

On success the endpoint starts a run and responds `202` with `{ runId, automationId, status }`. It returns `401` for a missing or invalid key, `404` for an unknown automation or a key from another organization, `403` if the webhook trigger is disabled, and `409` if the automation is paused.

Pausing gates every trigger: a paused automation rejects its webhook too. Webhook-only automations (no schedule) stay active until you disable the webhook.

## Run now

Click **Run now** on the automation detail page to trigger an immediate run outside any schedule or webhook. The run follows the same flow as a scheduled execution.

## Integrations

Each automation can optionally deliver results through one or more integrations. Configure these in the right sidebar of the automation form.

### Email

When enabled, the agent sends its output by email after the run completes.

* The automation owner's email is included by default.
* Add extra recipients as a comma-separated list.
* Optionally override the email subject line.

### Slack

When enabled, the agent posts a message to a Slack channel with its results.

* Enter the Slack channel ID (e.g. `C0123456789`).
* Requires a Slack integration configured in your project settings.
* The agent resolves `@handle` mentions to Slack user IDs before posting.

To keep the channel uncluttered, the agent posts a short headline to start a thread, then delivers the full report inside that thread. Charts and stories are uploaded into the thread automatically.

### GitHub

When enabled, the agent gets a set of dedicated GitHub tools:

* **github\_read** - fetch repository data (issues, PRs, files, branches) for context
* **github\_create\_issue** - open new issues
* **github\_create\_pull\_request** - open new pull requests
* **github\_add\_comment** - comment on issues or PRs

Requirements:

* A GitHub OAuth connection on the automation owner's account.
* Optionally filter to specific repos (comma-separated) to scope which repositories the agent can access.

### MCP servers

When enabled, the agent can call tools from your connected MCP servers during the run. Toggle individual servers on or off per automation.

## Model selection

By default, automations use your project's default model. You can override this per automation from the model selector in the form sidebar.

## Previous runs

The automation detail page shows a list of previous runs with:

* Timestamp and duration
* Status badge (running, completed, or failed)
* Integration result icons showing which deliveries succeeded or failed
* A link to open the full agent chat for any run

A run is marked failed if the agent did not call an expected integration tool, or if the agent loop itself errored.
