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

# Create and edit automations

> Create CodeRabbit automations in the web app editor, from Slack or Discord chat, or with the CodeRabbit API, then pause, resume, and edit them.

Cloud Only (This feature is available on CodeRabbit Cloud only. It is not available on self-hosted CodeRabbit deployments.)

The web app editor creates scheduled, channel message, and webhook automations. Slack and Discord chat and the CodeRabbit API are other ways to create the same automations. One-time automations are created from Slack chat.

## Before you start

An automation can only use what your workspace has set up. Check these before you create one, or ask a CodeRabbit admin:

| Requirement | Who sets it up |
| - | - |
| Agent billing. Runs use Agent minutes. Automations without a Slack or Discord destination need the Automations Agent trial or paid Agent access. See [Who can use Automations](https://docs.coderabbit.ai/automations.md#who-can-use-automations). | A CodeRabbit admin |
| A connection for each tool the trigger or destination uses, such as Linear, Jira, or PagerDuty. See [Connections](https://docs.coderabbit.ai/connections.md). | A CodeRabbit admin |
| Those connections in the automation's scope, which is Base Scope unless you choose another. See [Connections and Base Scope](https://docs.coderabbit.ai/automations/destinations.md#connections-and-base-scope). | A CodeRabbit admin |
| The CodeRabbit GitHub App on the repositories that runs read or change. See [Identity for changes](https://docs.coderabbit.ai/automations/destinations.md#identity-for-changes). | A GitHub organization owner |

## Create an automation in the web app

![The Create automation editor in the CodeRabbit web app. The Trigger card shows tiles for Datadog, GCP, GitHub, GitLab, Sentry, PagerDuty, Linear, Jira, Intercom, Zendesk, Pylon, Custom, Slack message, Discord message, and Scheduled. Below it, the Agent instructions card holds the instruction Summarize merged pull requests and open deployment blockers, with Agent scope set to Workspace default and a Customize agent scope button. An Active toggle sits in the top-right corner.](https://mintcdn.com/coderabbit/gKPHgRl-bneGQ2yQ/assets/images/automations-editor.png?fit=max\&auto=format\&n=gKPHgRl-bneGQ2yQ\&q=85\&s=e41de55cf5dac6644b06c559700b9d99)

The automation editor: pick a trigger tile, then tell CodeRabbit what to do on each run

**1. Open Automations**

In the CodeRabbit web app, select **Automations** > **Home** in the sidebar. To start from scratch, select **Create Automation**.

To start from a template, pick a category under **Templates** on the same page: **Investigate tickets**, **Investigate alerts**, or **Implement code changes**. Each category shows a card that says what the automation does, such as **Investigate new tickets** or **Implement PRs for labeled tickets**. If the card asks you to **Choose your ticketing system**, pick **Linear**, **Jira**, or **GitHub Issues**; tools that are already connected show **Connected**. The row at the bottom of the card shows where the automation starts and where the result goes, for example Linear → CodeRabbit → GitHub. Select **Set up** to open the editor with the trigger, instructions, and destination filled in, and with the template's name, such as **Recommend fix on Linear issue**, as the automation's name.

![The Templates section of the Automations page. The Investigate tickets category is selected and shows the Investigate new tickets card: when a ticket is created, CodeRabbit investigates the codebase and comments with the likely cause and a suggested fix. Under Choose your ticketing system, Linear is selected, and Linear, Jira, and GitHub Issues all show Connected. The flow row reads Linear, CodeRabbit, Linear, next to a Set up button.](https://mintcdn.com/coderabbit/gKPHgRl-bneGQ2yQ/assets/images/automations-templates.webp?fit=max\&auto=format\&n=gKPHgRl-bneGQ2yQ\&q=85\&s=3e2801dc9d284a11b0fef7e6b4acd6ea)

The Investigate tickets template with Linear selected: CodeRabbit comments on each new Linear issue

**2. Name the automation**

Replace **Untitled automation** with a name, and optionally add a description.

**3. Choose a trigger**

In the **Trigger** card, select a tile: **Scheduled**, **Slack message**, **Discord message**, or one of the webhook providers, such as **Linear**, **Jira**, **GitHub**, or **PagerDuty**. Then fill in the trigger's settings. See [Automation triggers](https://docs.coderabbit.ai/automations/triggers.md).

**4. Write the agent instructions**

In the **Agent instructions** card, tell CodeRabbit what to do on each run. See [Write agent instructions](#write-agent-instructions).

**5. Choose a destination**

In the **Target** card, choose where results go: a Slack or Discord channel, a Slack DM, a GitHub repository, or any connected tool CodeRabbit can write to, such as Linear, Jira, PagerDuty, Notion, or HubSpot. Select **Add target** to deliver to more than one. See [Automation destinations](https://docs.coderabbit.ai/automations/destinations.md).

**6. Save**

Set the toggle next to the name to **Active** to start running right away, or to **Paused** to save a draft. Then select **Save automation**.

**7. Test it**

With the automation active, start a run: select **Run now** on a scheduled automation's page, post a matching message in the channel, or cause a matching event in the other tool, such as adding the label to a Linear issue. Follow the run on the automation's page and check what it delivered. See [Test a trigger](https://docs.coderabbit.ai/automations/triggers.md#test-a-trigger).

For a webhook provider that CodeRabbit doesn't manage, the editor shows the webhook URL and setup steps after you save. Configure them in the other tool before you expect runs. See [Webhook events](https://docs.coderabbit.ai/automations/triggers.md#webhook-events).

Slack and Discord have their own templates. In the web app, open **Slack** > **Automations** or **Discord** > **Automations** and look under **Prebuilt automations** for templates such as **Triage Linear issue** and **Triage PagerDuty incident**, which post results to a channel.

## Write agent instructions

The agent instructions are the task CodeRabbit runs each time the trigger fires. They can be up to 20,000 characters. Write them the way you would brief a teammate:

* **Say what to look at.** Name the repositories, services, or connected tools to check, such as "the backend repositories" or "recent deploys in Datadog".
* **Say what to do.** Investigate, summarize, recommend a fix, or implement a change and open a pull request.
* **Describe the result.** Say what the output should contain and how long it should be. For webhook triggers, refer to the event, for example "the new Linear issue" or "the triggered PagerDuty incident".
* **Say what to do when there's nothing to report.** For example, "If there are no new advisories, reply with one line saying so."

Instructions can also ask CodeRabbit to follow an existing [durable skill](https://docs.coderabbit.ai/agent/skills.md), so every run reuses an established procedure.

The **Agent instructions** card also shows the automation's **Agent scope**, the repositories and connections each run can use. It's the workspace default unless you choose a shared or custom scope. See [Agent scope](https://docs.coderabbit.ai/automations/destinations.md#agent-scope).

Each destination can also have its own instructions that say how to deliver the result, such as the format of a Linear comment. See [Automation destinations](https://docs.coderabbit.ai/automations/destinations.md#choose-a-destination).

In Slack, the instructions can also add buttons to the reply, post to a second channel, or send DMs. See [Buttons, second channel, and DMs](https://docs.coderabbit.ai/slack-agent/automations.md#buttons-second-channel-and-dms).

## Create an automation from chat

In Slack, ask `@coderabbit` to automate a job in a channel or DM, or run `/automations`. For a recurring or message-triggered automation, CodeRabbit runs the job once as a trial, then shows a draft card so you can review the output before anything is saved. Slack chat is also where you create one-time automations, which skip the trial. See [Automations in Slack](https://docs.coderabbit.ai/slack-agent/automations.md#create-an-automation-from-slack).

In Discord, ask CodeRabbit in a public channel or run `/automations`. The automation belongs to the parent channel even when you create it in a thread. See [Automations in Discord](https://docs.coderabbit.ai/discord-agent/automations.md).

Automations created from chat appear in the web app with the others, and you can edit them in the web app editor, except one-time automations.

## Create automations with the API

The [CodeRabbit API](https://docs.coderabbit.ai/api.md) manages automations under `/v1/automations`. A key needs the `automations:read` scope to read automations and runs, and `automations:write` to create, update, or control them. See [Authentication](https://docs.coderabbit.ai/api/authentication.md). The [CodeRabbit MCP server](https://docs.coderabbit.ai/api/mcp.md) offers the same operations as tools, such as `create_automation` and `list_automation_runs`, with the same scopes; see [MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md).

| Operation | Endpoint |
| - | - |
| [List automations](https://docs.coderabbit.ai/api/reference/list-automations.md) | `GET /v1/automations` |
| [Create an automation](https://docs.coderabbit.ai/api/reference/create-automation.md) | `POST /v1/automations` |
| [Read an automation and its definition](https://docs.coderabbit.ai/api/reference/get-automation.md) | `GET /v1/automations/{automation_id}` |
| [Replace an automation's definition](https://docs.coderabbit.ai/api/reference/update-automation.md) | `PUT /v1/automations/{automation_id}` |
| [Run now, pause, resume, or delete](https://docs.coderabbit.ai/api/reference/command-automation.md) | `POST /v1/automations/{automation_id}/commands` |
| [List runs](https://docs.coderabbit.ai/api/reference/list-automation-runs.md) | `GET /v1/automations/{automation_id}/runs` |

Updates and commands take the `expected_revision` that you read from the automation, so a change made in the meantime isn't overwritten. A `run_now` command only starts the run; read the runs endpoint to follow it. The same permission, billing, and availability checks apply as in the web app.

## Active and paused automations

Every automation is either active or paused. You choose with the **Active** and **Paused** toggle in the editor, and you can switch later from the automation's page. See [Run now, pause, resume, and delete](https://docs.coderabbit.ai/automations/manage.md#run-now-pause-resume-and-delete).

| State | Behavior |
| - | - |
| Active | Runs on its schedule, on matching channel messages, or on matching webhook events. |
| Paused | Keeps its configuration but doesn't run. Schedules are skipped, and new channel messages and webhook events are ignored. **Run now** isn't available. |

Save a new automation as paused when you still need to set up the other tool, such as a webhook in Datadog, or when you want a teammate to review the instructions first.

## Edit an automation

Open the automation from **Automations** > **Home** and select **Edit**, or select **Edit** in the row's menu in the list. The editor opens with the same **Trigger**, **Agent instructions**, and **Target** cards. Change what you need and select **Save automation**.

* If you can view an automation but not manage it, the editor opens read-only. See [Permissions](https://docs.coderabbit.ai/automations/manage.md#permissions).
* One-time automations can't be edited in the web app editor.

## Who can create automations

Each Slack workspace and Discord server has a setting that controls who can create automations in it:

| Value | Who can create |
| - | - |
| Any user (default) | Every member |
| Slack or Discord workspace admins | Slack workspace admins or Discord server admins, and CodeRabbit admins |
| Automation admins | Automation admins |

CodeRabbit admins can always create automations. When the setting doesn't include you, creating an automation fails with a message such as "Only Slack workspace admins or CodeRabbit admins can create automations in this workspace." Ask an admin to create the automation or to change the setting.

Creating an automation doesn't require permission to add connections. If the trigger or destination needs a tool that isn't connected yet, the editor tells you to ask a CodeRabbit admin to connect it. Adding connections requires a CodeRabbit admin. See [Connections and Base Scope](https://docs.coderabbit.ai/automations/destinations.md#connections-and-base-scope).

## What's next

> [card] [Automation triggers](https://docs.coderabbit.ai/automations/triggers.md)
>
> Set up schedules, channel message triggers, and webhook events.

> [card] [Automation destinations](https://docs.coderabbit.ai/automations/destinations.md)
>
> Deliver results to a channel, a ticket, an incident, or a GitHub repository.

> [card] [Manage and monitor automations](https://docs.coderabbit.ai/automations/manage.md)
>
> Follow runs, run an automation on demand, and pause or delete it.


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