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

# Alert Workflows

> Create Sentry alert rules and use their payloads to build automated incident response workflows in Rootly, including routing, paging, and incident creation.

Once Sentry is connected, you define alert rules in Sentry that determine when to forward alerts to Rootly, then build workflows in Rootly that react to those alerts — declaring incidents, paging responders, and kicking off your response process automatically.

## Step 1: Create Alert Rules in Sentry

You'll start in Sentry by defining the alert rules that determine when an event should be forwarded to Rootly. These rules let you specify conditions based on error frequency, type, tags, severity, or any combination — so only the alerts that matter reach Rootly. Every alert that passes these conditions will land in Rootly's alert feed with the full Sentry payload attached.

<Steps>
  <Step title="Navigate to Alerts and create a new rule">
    In Sentry, go to **Issues → Alerts**, then click **Create Alert**.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/navigate-and-create-alert.png" alt="Navigate to Alerts and Create Alert in Sentry" />
    </Frame>
  </Step>

  <Step title="Choose your alert type and set conditions">
    Select the type of alert you want to create — for example, an **Error Alert** — then click **Set Conditions**.

    <Note>
      Set your conditions under the **When** and **If** fields. For example: trigger when an issue is seen more than 10 times in 1 hour, or when a specific tag like `environment:production` is present. The more precisely you scope these, the less noise your Rootly workflows will see.
    </Note>
  </Step>

  <Step title="Add Rootly as the action">
    Under the **Then** section, select **Rootly** as the action. This tells Sentry to forward the alert payload to Rootly whenever your conditions are met.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/then-rootly.png" alt="Select Rootly as the action in Sentry alert rule" />
    </Frame>
  </Step>

  <Step title="Send a test notification">
    Use Sentry's **Send Test Notification** to fire a real test alert to Rootly. This sends a live payload so you can inspect exactly what fields are available before writing your workflow conditions.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/send-test-notif.png" alt="Send test notification in Sentry" />
    </Frame>
  </Step>
</Steps>

<Tip>
  The test alert will appear in **Rootly → Alerts**. Click on it to view the full payload — you'll use these fields when writing workflow conditions in the next step.
</Tip>

## Step 2: Build the Workflow in Rootly

With alerts now flowing into Rootly, you create a workflow that reacts to them. Rootly workflows let you inspect the incoming alert payload, apply conditions to filter which alerts should trigger a response, and chain together actions like creating an incident, paging on-call, or sending notifications. You only need one workflow per alert pattern — conditions handle the filtering.

<Steps>
  <Step title="Open Workflows and create a new workflow">
    In Rootly, go to **Workflows** and click **Create Workflow**.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/Create-workflow.png" alt="Create Workflow in Rootly" />
    </Frame>
  </Step>

  <Step title="Choose an Alert-based workflow type">
    Select the **Alert** workflow type. This workflow will trigger whenever Rootly receives an **alert** from any source — including Sentry. Conditions in a later step will narrow it down to Sentry alerts specifically.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/triggered-by-alerts.png" alt="Select Alert workflow type in Rootly" />
    </Frame>
  </Step>

  <Step title="Configure workflow details">
    Give your workflow a clear name like "Create Incident for Sentry Errors".

    <Note>
      There are additional optional settings you can configure here, such as:

      * **Workflow description** — helps your team understand what this workflow does
      * **Repeat configuration** — controls whether the workflow can fire multiple times for the same alert
    </Note>
  </Step>

  <Step title="Set the trigger">
    The trigger defines which alert event activates this workflow.

    <Note>
      For **Alert** type workflows, two triggers are available:

      1. **Alert Created** — fires when a new alert is received from Sentry
      2. **Alert Status Updated** — fires when an existing alert changes state (e.g., resolved or acknowledged)
    </Note>

    Select **Alert Created** to run the workflow whenever a new Sentry alert arrives. Use **Alert Status Updated** if you want to automatically close an incident when Sentry marks the issue resolved.
  </Step>

  <Step title="Add conditions to match Sentry alerts">
    Conditions filter which alerts trigger the workflow. Use one of the following to match alerts from Sentry:

    <Tabs>
      <Tab title="Match by Source">
        <Card>
          Run this workflow if `any of` the following conditions are true:

          * **Source** is `Sentry`
        </Card>
      </Tab>

      <Tab title="Match by Payload">
        <Card>
          Run this workflow if `any of` the following conditions are true:

          * **Payload**: `actor.name` is `Sentry`
        </Card>
      </Tab>
    </Tabs>

    <Note>
      The Sentry alert payload contains many fields you can use for more advanced conditions — environment, project, level, tags, and more. Open the test alert you sent earlier to browse all available fields.
    </Note>
  </Step>

  <Step title="Add actions">
    Add one or more actions that should occur when the workflow is triggered. Common actions include:

    * **Create Incident** — declares an incident with context pulled directly from the alert payload
    * **Page Rootly On-Call** — immediately pages the on-call responder for the affected service
    * **Send SMS or Email** — notifies stakeholders outside of Slack

    <Tip>
      You can chain multiple actions depending on your response process — for example: create the incident, then page on-call, then post a message to a Slack channel.
    </Tip>
  </Step>

  <Step title="Save and activate the workflow">
    Click **Create Workflow**. The workflow is now active and will fire automatically on the next matching Sentry alert.

    <Frame>
      <img src="https://ik.imagekit.io/scdd/create-sentry-workflow.png" alt="Save Sentry alert workflow in Rootly" />
    </Frame>
  </Step>
</Steps>

## Step 3: Verify

Return to Sentry and trigger the alert rule again — or send another test notification. Confirm that the workflow activates inside Rootly and that the expected incident or action is created. You can monitor workflow execution in **Rootly → Workflows → Activity**.

<Frame>
  <img src="https://ik.imagekit.io/scdd/sentry%20incident.png" alt="Incident created in Rootly from a Sentry alert" />
</Frame>

## How Alert Fields Are Mapped

Rootly extracts the following fields from each Sentry alert type and makes them available as conditions and variables inside your workflows:

<ParamField body="Issue alerts" type="event_alert">
  Issue title, issue ID, issue URL, error type, level, and project name. Supports automatic resolution — when Sentry sends a resolved event, Rootly resolves the corresponding alert.
</ParamField>

<ParamField body="Metric alerts" type="metric_alert">
  Alert title, alert ID, and web URL. Does not support automatic resolution — must be resolved manually or via a workflow action.
</ParamField>

<ParamField body="All types" type="labels">
  `level`, `type`, `project`, and `status` are extracted as labels on every alert where available. Use these as workflow conditions to filter by severity, environment, or state.
</ParamField>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Sentry alerts aren't appearing in Rootly" icon="circle-xmark">
    Confirm the Rootly app is installed in your Sentry organization and that the alert rule has Rootly set as an action. Verify the rule conditions are being met by triggering a test event.
  </Accordion>

  <Accordion title="Metric alerts aren't resolving automatically" icon="rotate">
    This is expected — metric alerts don't support automatic resolution. Resolve them manually or configure a workflow action to resolve them based on a follow-up Sentry event.
  </Accordion>

  <Accordion title="rootly_notification_target isn't paging anyone" icon="bell-slash">
    Check that the value follows `type:id` format exactly (e.g. `EscalationPolicy:abc-123`) and that the resource exists in Rootly. Setting the value to `none` disables paging. An invalid or missing resource is silently ignored.
  </Accordion>

  <Accordion title="rootly_urgency isn't being applied" icon="gauge">
    Confirm the value is a valid Rootly alert urgency ID belonging to your team. Invalid urgency IDs are silently ignored and no urgency will be assigned to the alert.
  </Accordion>
</AccordionGroup>
