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

# Set up self-healing

> Enable self-healing on a Bolt schedule so a DinoAI agent diagnoses and opens a fix PR when a production run fails, in the failure's Slack thread.

Self-healing turns a failed run into an automatic fix attempt: a DinoAI agent diagnoses the failure in the schedule's Slack thread and opens a pull request with a fix. This guide enables it on a schedule.

<Note>
  **Prerequisites**

  * A [Bolt schedule](/guides/paradime-101/running-dbt-in-production-with-bolt/creating-bolt-schedules) you can edit.
  * A [Slack notification channel](/guides/paradime-101/running-dbt-in-production-with-bolt/setting-up-notifications) configured on the schedule (self-healing threads into the failure notification, so the channel must exist).
  * A programmable agent defined under `.dinoai/agents/<name>.yml` on the schedule's git branch.

  Estimated time: 10 minutes.
</Note>

## Steps

<Steps>
  <Step title="Enable self-healing on the schedule">
    In the schedule's **Self-healing** section, select an agent to enable it:

    1. Select a **Channel**, the Slack channel the agent runs in. It must already be a Slack notification channel on this schedule.
    2. Select an **Agent name**, the DinoAI programmable agent that diagnoses and fixes the run. The list comes from `.dinoai/agents/*.yml` on the schedule's git branch.
    3. Save the schedule.

    To turn self-healing off, clear the selected agent.

    <Info>
      You stay in control. The agent **always opens a PR**, it never merges to your default branch. Reviewers approve the fix before it reaches production.
    </Info>
  </Step>

  <Step title="Or configure self-healing as code">
    If you [manage schedules as code](/guides/orchestrate-data-pipelines/manage-schedules-as-code), add a `self_healing` block:

    ```yaml theme={"system"}
    self_healing:
      enabled: true
      slack_channel: '#agent-demo'
      agent_name: bolt-pipeline-healer
    ```

    <Warning>
      `self_healing.slack_channel` must also appear in `notifications.slack_channels` for the same schedule, or the validator rejects it. The agent threads into the failure notification, so that notification has to exist.
    </Warning>
  </Step>
</Steps>

<Check>
  When a run fails on a self-healing schedule, Paradime posts a self-healing message into the failure thread, the agent works in-thread, and it ends with a PR link. If self-healing never starts, check that the self-healing channel is also listed as a notification channel on the schedule.
</Check>

<Note>
  Authoring the DinoAI agent that does the healing (the recipe itself) lives in the Automate with AI agents section, so this guide does not duplicate it.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Set up alerts" href="/guides/orchestrate-data-pipelines/set-up-alerts" icon="bell">
    Shape the failure notifications self-healing threads into.
  </Card>

  <Card title="Debug a failed run" href="/guides/paradime-101/running-dbt-in-production-with-bolt/debugging-failed-runs" icon="search">
    Investigate by hand when a fix needs a human.
  </Card>

  <Card title="Self-healing reference" href="/products/bolt/creating-schedules/self-healing" icon="shield">
    Every self-healing setting.
  </Card>

  <Card title="DinoAI reference" href="/products/dino-ai/index" icon="bot">
    How the healing agent diagnoses and fixes runs.
  </Card>
</CardGroup>


## Related topics

- [Set up alerts](/guides/orchestrate-data-pipelines/set-up-alerts.md)
- [Bolt pipeline healer](/guides/programmable-agents/bolt-pipeline-healer.md)
- [Bolt CI healer](/guides/programmable-agents/bolt-ci-healer.md)
- [Send failures to your incident tools](/guides/orchestrate-data-pipelines/send-failures-to-incident-tools.md)
- [Schedule Settings](/products/bolt/creating-schedules/schedule-settings.md)
