> ## 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.

# Automation triggers

> Start CodeRabbit automations on a schedule, on new Slack or Discord channel messages, or on webhook events from GitHub, Linear, Jira, PagerDuty, Datadog, and other tools.

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

A trigger decides when an automation runs. You pick it in the **Trigger** card of the automation editor ("Choose what starts this automation") by selecting a tile.

## Trigger types

| Trigger | Editor tile | Starts a run when | **Run now** |
| - | - | - | - |
| [Schedule](#schedules) | **Scheduled** | The schedule comes due | Available while the automation is active |
| [Channel message](#channel-messages) | **Slack message**, **Discord message** | A new top-level message in the channel matches | Not available |
| [Webhook event](#webhook-events) | A provider tile, such as **Linear**, **Jira**, **GitHub**, **PagerDuty**, or **Custom** | The provider sends an event that matches the trigger's rules | Not available |
| One-time | None; created from Slack chat | The chosen date and time arrives, once | Not available |

An automation has one trigger. To run the same task on a schedule and on an event, create two automations.

## Schedules

A **Scheduled** trigger runs the automation at regular intervals. Set these fields:

| Field | What it sets |
| - | - |
| **Frequency** | **Minutes**, **Hours**, **Days**, **Weeks**, or **Months** |
| **Repeat every** | The interval in the chosen unit, such as every 2 hours or every 3 days |
| **Run at** | The time of day, for daily, weekly, and monthly schedules |
| **Weekdays** | The days of the week, for weekly schedules |
| **Day of month** | The day, for monthly schedules |
| **Timezone** | The timezone used for **Run at** and the days |

The shortest interval is 10 minutes.

A one-time automation runs once at a time you choose and is then archived. You create it by asking `@coderabbit` in Slack, for example "tomorrow at 10am, draft an RCA for this incident in this thread". See [One-time automations](https://docs.coderabbit.ai/slack-agent/automations.md#one-time-automations).

## Channel messages

A **Slack message** or **Discord message** trigger runs when a new top-level message is posted in a channel. Use it to react to repeated events, such as alerts from a monitoring bot, deployment notices, or questions in a help channel.

| Field | What it does |
| - | - |
| **Source channel** | The channel to watch. |
| **Text includes** | Optional phrases. A message matches when it contains any one of them, ignoring case. Add up to 25 phrases of up to 200 characters each. Without phrases, every new top-level message matches. |

The editor has no author field. To limit the trigger to messages from particular authors, such as your Datadog bot, ask for it when you create the automation in Slack or Discord chat. See [Slack channel message triggers](https://docs.coderabbit.ai/slack-agent/automations.md#slack-channel-message-triggers).

Channel message automations always reply in the thread of the message that started the run, and their destination is on the same platform as the source channel. **Run now** isn't available. In Discord, an automation belongs to the parent channel even when it's created in a thread. See [Slack channel message triggers](https://docs.coderabbit.ai/slack-agent/automations.md#slack-channel-message-triggers) and [Parent-channel scope](https://docs.coderabbit.ai/discord-agent/automations.md#parent-channel-scope).

> [!TIP]
>
> Every matching message starts a run that uses Agent minutes, so use **Text includes** or an author limit to keep routine chatter out, and see [Spend limits](https://docs.coderabbit.ai/automations/manage.md#spend-limits) to cap busy channels.

## Webhook events

A webhook trigger runs when another tool sends an event that matches the trigger's rules. Select the provider's tile in the **Trigger** card. Paused automations ignore webhook events.

### Supported providers

| Provider | Tile | Webhook setup |
| - | - | - |
| GitHub | **GitHub** | Managed through the CodeRabbit GitHub App |
| Jira | **Jira** | Managed |
| Linear | **Linear** | Managed |
| PagerDuty | **PagerDuty** | Managed, account-wide |
| Datadog | **Datadog** | You configure it in Datadog |
| GitLab | **GitLab** | You configure it in GitLab |
| Google Cloud | **GCP** | You configure it in Google Cloud |
| Intercom | **Intercom** | You configure it in Intercom |
| Pylon | **Pylon** | You configure it in Pylon |
| Sentry | **Sentry** | You configure it in Sentry |
| Zendesk | **Zendesk** | You configure it in Zendesk |
| Any other service | **Custom** | You configure it in the service |

Provider tiles list the provider's event types, so you can pick events instead of typing them. **Custom** accepts any event types you enter.

### Managed webhooks

For GitHub, Jira, Linear, and PagerDuty, CodeRabbit creates the webhook in the provider and keeps it in sync with the automation. After you save, the editor confirms it, for example **Jira webhook created**, and no setup is needed in the provider.

* **GitHub**: the trigger uses the repositories the CodeRabbit GitHub App can access, so you don't need a personal access token. Install the CodeRabbit GitHub App on the organization and repositories you want to use, then choose the **Repository** and **Event types**, such as `pull_request` or `issues`. For pull request events, **Run only when** narrows the trigger to pull requests that are merged, not merged, drafts, target a base branch, or have a head branch with a given prefix, or to a custom payload field.
* **Jira**: under **Jira projects**, keep **All projects** or select up to 50 projects. Project selection works with issue, comment, work log, and issue property events. With other event types, the editor shows "Project scoping isn't available for the selected event types." and the trigger covers all projects.
* **Linear**: choose a Linear authorization, or select **Connect another Linear workspace** to add one. CodeRabbit keeps your draft while you authorize and returns to the editor. Under **Linear teams**, keep **All public teams** or select teams.
* **PagerDuty**: the webhook subscription covers the whole PagerDuty account, not a single service or team.

Connecting a provider for managed webhooks takes a CodeRabbit admin. If the provider isn't connected yet, the editor shows "Ask a CodeRabbit admin to connect" the provider. Once it's connected and available to automations, anyone who can create automations can use it. The GitHub webhook admin connection can't be used as a destination. See [Connections and Base Scope](https://docs.coderabbit.ai/automations/destinations.md#connections-and-base-scope).

For GitHub, Jira, and Linear, the **Filter** row narrows the trigger to tickets with a label or status:

| Filter | Runs when |
| - | - |
| **Has label** | A ticket is created with the label, or the label is added later. |
| **Has status** | A ticket is created in the status, or moves to it later. Not available for GitHub. |

The **Create PR from Linear issue**, **Create PR from Jira issue**, and **Create PR from GitHub issue** templates use this filter, so labeling a ticket is enough to start an implementation.

### Other providers

For providers that CodeRabbit doesn't manage and for **Custom**, save the automation first. The editor then shows **Webhook endpoint created** with the webhook URL, the values to configure in the provider, such as a header or secret, and setup steps for that provider. Select **Reveal secrets** to see secret values. Configure the webhook in the provider, then [test the trigger](#test-a-trigger).

Reusing a webhook connection that another automation already set up requires permission to manage integrations. While another active automation uses the same connection, its shared secret can't be changed.

### Matching rules

A webhook trigger decides which events start a run with matching rules:

* **Event types**: the provider events to accept, such as `Issue.create` for Linear or `incident.triggered` for PagerDuty. Add more under **Advanced** > **Additional event types**.
* **Payload conditions**: checks on fields in the event's payload, using equals, contains, starts with, exists, or a regular expression. GitHub's **Run only when** filters and the ticket **Filter** row are payload conditions.

A trigger can have up to 25 rules, each with up to 20 conditions. An event that matches no rule doesn't start a run. If an automation already has custom payload rules, for example from the API, the editor shows its event types read-only and keeps the rules when you save.

## Deduplication

Providers sometimes deliver the same webhook event more than once. CodeRabbit deduplicates matching deliveries so a repeated event doesn't start a second run:

* **Window**: a matching delivery with the same content is ignored for 60 seconds after the first one.
* **GitHub, Linear, Jira, and PagerDuty**: the same event keeps the same run identity after the window too, so redelivering it later doesn't start another run. Changes to delivery headers alone don't make it a new event.
* **Linear retries**: CodeRabbit ignores Linear's delivery-only `webhookTimestamp` field. Changing only that timestamp doesn't create a new event; the event content must change.

A deduplicated delivery doesn't create a run, so it doesn't appear in the run history or in Activity. The webhook response shows what happened:

```json theme={null}
  {
    "ok": true,
    "matched": 1,
    "accepted": 0,
    "deduplicated": 1
  }
```

| Field | Description |
| - | - |
| `ok` | Whether CodeRabbit processed the request. |
| `matched` | Number of automation triggers whose rules matched the event. |
| `accepted` | Number of new runs started. `0` when the delivery was deduplicated. |
| `deduplicated` | Number of matching deliveries ignored as repeats. |

`accepted` and `deduplicated` are returned for automations that deliver to Slack or Discord. For automations without a Slack or Discord destination, the response contains only `ok` and `matched`.

## Test a trigger

| Trigger | How to test |
| - | - |
| Schedule | Save the automation as active, open it, and select **Run now**. |
| Channel message | Save the automation as active, then post a message that matches the trigger in the source channel, or try it first in a test channel. |
| Webhook event | Save the automation as active, then send a test event from the provider, or perform the action that sends the event, such as labeling a Linear issue. PagerDuty can send a `pagey.ping` test event. |

Follow the run on the automation's page. If no run appears for a webhook, check that the automation is active, that the event type and conditions match, and that the delivery isn't a repeat within the deduplication window. See [Manage and monitor automations](https://docs.coderabbit.ai/automations/manage.md#automation-details).

## What's next

> [card] [Automation destinations](https://docs.coderabbit.ai/automations/destinations.md)
>
> Choose where each run delivers its result.

> [card] [Manage and monitor automations](https://docs.coderabbit.ai/automations/manage.md)
>
> Follow runs and check why an automation did or didn't run.

> [card] [Automation guides](https://docs.coderabbit.ai/automations/guides.md)
>
> See complete setups for incident response, support triage, and ticket triage.


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