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

# Setup

> Connect PagerDuty to Ravenna using OAuth 2.0 from your integrations settings to enable automated on-call validation and routing workflows.

## Integration walkthrough

### In Ravenna

The Ravenna PagerDuty integration uses OAuth 2.0 authentication, which means you do not need to create a service or copy integration keys in PagerDuty. Instead, you will authorize Ravenna to access your PagerDuty account directly.

#### Step 1: Navigate to integrations

1. Log in to your Ravenna account.
2. Click your profile icon in the top right corner.
3. Select **Settings** from the dropdown menu.
4. In the left sidebar, click **Integrations**.
5. Scroll down to the **Incident Management** section.
6. Locate the **PagerDuty** integration card.

#### Step 2: Connect to PagerDuty

1. Click the **Connect** button on the PagerDuty integration card.
2. A dialog will appear. Click **Connect with PagerDuty** to begin the OAuth authorization flow.
3. You will be redirected to PagerDuty's authorization page.

### In PagerDuty

#### Step 3: Authorize Ravenna

1. On the PagerDuty authorization page, review the permissions that Ravenna is requesting:
   * **Read** access to schedules
   * **Read** access to on-call data
   * **Read** access to users
2. Ensure you are authorizing access for the correct PagerDuty account (check the account name at the top of the page).
3. Click **Allow** to grant Ravenna access to your PagerDuty account.
4. You will be automatically redirected back to Ravenna.

### In Ravenna

#### Step 4: Confirm connection

1. Once redirected back to Ravenna, you will see a success message indicating the integration is connected.
2. The PagerDuty integration card will now display a **Connected** status with a green indicator.
3. Your PagerDuty schedules are now available for use in Ravenna workflows.

#### Step 5: Use in workflows

1. Navigate to **Workflows** in the left sidebar.
2. Create a new workflow or edit an existing one.
3. Add an action and select **PagerDuty** from the list of integrations.
4. Select **Validate On-Call Membership** as the action type.
5. Select a **Schedule** from the dropdown menu (this will display all schedules from your PagerDuty account).
6. Configure the workflow to take action based on whether the user is on-call (e.g., route ticket, send notification, escalate).
7. Click **Save** to save your workflow.

Your workflow will now validate on-call status in real-time each time it runs, ensuring tickets are routed to the appropriate on-call engineer.

### Troubleshooting

<AccordionGroup>
  <Accordion title="OAuth authorization fails">
    **Cause**: Insufficient permissions or browser issues

    **Solution**:

    * Ensure you have admin access to your PagerDuty account
    * Try using a different browser or clearing your browser cache
    * Disable any browser extensions that might block OAuth redirects
    * Verify your PagerDuty account is active
  </Accordion>

  <Accordion title="Schedules not appearing in workflow dropdown">
    **Cause**: Integration not properly connected or no schedules exist in PagerDuty

    **Solution**:

    * Verify the integration shows as **Connected** in **Settings > Integrations**
    * Check that schedules exist in your PagerDuty account by navigating to **People** > **On-Call Schedules** in PagerDuty
    * Try disconnecting and reconnecting the integration
    * Refresh the Ravenna page after reconnecting
  </Accordion>

  <Accordion title="On-call validation returns incorrect results">
    **Cause**: User email mismatch or schedule configuration issue

    **Solution**:

    * Ensure user emails in Ravenna exactly match user emails in PagerDuty (comparison is case-insensitive)
    * Verify the correct schedule is selected in your workflow configuration
    * Check the schedule configuration in PagerDuty to ensure users are properly assigned to on-call shifts
    * Confirm the schedule is active and has current on-call assignments
  </Accordion>
</AccordionGroup>

## How to uninstall

If you need to disconnect the PagerDuty integration from Ravenna:

1. Navigate to **Settings** by clicking your profile icon in the top right corner.
2. Click **Integrations** in the left sidebar.
3. Scroll down to the **Incident Management** section.
4. Locate the **PagerDuty** integration card.
5. Click the **Disconnect** button next to the PagerDuty integration.
6. A confirmation dialog will appear. Click **Confirm** to proceed with disconnection.
7. The integration will be removed and the card will display a **Connect** button again.

<Warning>
  **Important**: Disconnecting the PagerDuty integration will immediately stop all workflows that use PagerDuty on-call validation actions. Before disconnecting, ensure you have updated or disabled any workflows that depend on this integration to avoid workflow errors.
</Warning>

To revoke Ravenna's access from the PagerDuty side:

1. Log in to PagerDuty.
2. Navigate to your **User Profile** by clicking your profile icon.
3. Select **My Profile** from the dropdown.
4. Click the **User Settings** tab.
5. Scroll down to the **Authorized Applications** section.
6. Locate **Ravenna** in the list of authorized applications.
7. Click **Revoke Access** next to Ravenna.
8. Confirm the revocation when prompted.
