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

# Self-Healing

Self-Healing is the **automated** counterpart to [Fix with DinoAI](/products/dino-ai/bolt-pipeline-agent/fix-with-dinoai). Instead of waiting for someone to click a button in Slack, Paradime detects the failure on schedules that have self-healing enabled and immediately spins up a DinoAI agent against the failed run — in the same Slack thread as the failure notification — so a fix is already in progress by the time a human looks.

<Frame>
  <img src="https://mintcdn.com/paradime-docs/_V48tdxcy1g_Y-dv/images/image-236.png?fit=max&auto=format&n=_V48tdxcy1g_Y-dv&q=85&s=8950c11e0f1b7e24f4a70043fd3606fb" alt="" width="1952" height="1522" data-path="images/image-236.png" />
</Frame>

<Info>
  You stay in control. Self-Healing always opens a **pull request.** Your team reviews and approves before anything reaches production.
</Info>

#### How it works

When a Bolt run fails on a schedule with `self_healing.enabled = true`:

1. Paradime posts the normal failure notification to the schedule's configured Slack channels.
2. In the **configured `slack_channel`**, Paradime posts a message into the failure thread: `🦖 Self-healing enabled — starting healing session...`
3. Paradime spins up a DinoAI agent session in that thread. The agent is invoked with the prompt: *"Review the run log and fix run\_id `<N>`"*.
4. The agent uses its tools (run logs, repository access, warehouse connection, Slack) to diagnose, implement, and open a PR — the same flow as Fix with DinoAI.
5. If notifications also fire to **other** Slack channels, those channels receive a courtesy pointer: `🦖 Self-healing started in #<primary-channel>`, so reviewers in those channels know where the work is happening.

```mermaid theme={"system"}
sequenceDiagram
    participant B as Bolt run (failed)
    participant S as Slack (#alerts)
    participant H as Slack (#agent-demo)<br/>self_healing.slack_channel
    participant A as DinoAI agent

    B->>S: Failure notification
    B->>H: Failure notification
    B->>H: "🦖 Self-healing enabled — starting healing session..."
    B->>A: trigger_dinoai_fix_for_bolt_run(run_id, agent_name)
    B->>S: "🦖 Self-healing started in #agent-demo"
    A->>A: Read logs, write fix, open PR
    A-->>H: Progress + PR link in-thread
```

#### Context the agent receives

Beyond the run logs, the agent's prompt is enriched with a **prior-attempts** context whenever this schedule has been self-healed before:

This avoids the agent reopening duplicate PRs when an earlier session has already proposed a fix.

<Frame>
  <img src="https://mintcdn.com/paradime-docs/_V48tdxcy1g_Y-dv/images/image-239.png?fit=max&auto=format&n=_V48tdxcy1g_Y-dv&q=85&s=1c8d7a43ba48369aa383124497ba735d" alt="" width="1952" height="1522" data-path="images/image-239.png" />
</Frame>

#### Self-Healing vs Fix with DinoAI

| Aspect                 | Fix with DinoAI                                       | Self-Healing                                               |
| ---------------------- | ----------------------------------------------------- | ---------------------------------------------------------- |
| Trigger                | Manual — someone clicks the button in Slack           | Automatic — fires as soon as the run fails                 |
| Where it's configured  | Nothing to configure; available on every failure post | Per-schedule, in the Bolt UI or schedules-as-code YAML     |
| Slack channel          | The channel that received the failure notification    | The channel set in `self_healing.slack_channel`            |
| Agent used             | Default Paradime Bolt-fix agent                       | A programmable agent named in `self_healing.agent_name`    |
| Prior-attempts context | No                                                    | Yes — recent sessions for the same schedule are summarised |

Use **Fix with DinoAI** for ad-hoc fixes and exploration. Turn on **Self-Healing** on the schedules where you want a PR to already be waiting when the team logs in.

#### Enabling Self-Healing on a schedule

Self-Healing is configured per schedule. See:

* Creating Schedules → Self-Healing — UI walkthrough
* Schedules as Code → Configuration Reference — YAML block (`self_healing.enabled`, `slack_channel`, `agent_name`)

<Frame>
  <img src="https://mintcdn.com/paradime-docs/vrtvqFryCVgm3kAH/images/image-274.png?fit=max&auto=format&n=vrtvqFryCVgm3kAH&q=85&s=7b5e18e71a1124f281742b57adfdbcbe" alt="" width="1520" height="607" data-path="images/image-274.png" />
</Frame>

The Slack channel you pick in `self_healing.slack_channel` **must also appear** in the schedule's `notifications.slack_channels`. The agent threads into the existing failure notification — so the notification has to exist for the agent to find its thread.

#### Related

* [Fix with DinoAI](/products/dino-ai/bolt-pipeline-agent/fix-with-dinoai) — Manual one-click fixes from a Slack failure thread
* [Pipeline Insights](/products/dino-ai/bolt-pipeline-agent/production-pipelines) — DinoAI's AI summaries of failed commands
* [Programmable Agents](/guides/programmable-agents/bolt-pipeline-healer) — Author a custom `agent_name` for self-healing


## Related topics

- [2. Self-Healing](/products/bolt/creating-schedules/2.-self-healing.md)
- [Bolt Pipeline Agent](/products/dino-ai/bolt-pipeline-agent/index.md)
- [Bolt Pipeline Healer](/guides/programmable-agents/bolt-pipeline-healer.md)
- [bolt-ci-healer](/guides/programmable-agents/bolt-ci-healer.md)
- [Pipeline Insights](/products/dino-ai/bolt-pipeline-agent/production-pipelines.md)
