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

# Self-Heal

> Self-heal automatically regenerates demo videos when your application changes, so your demos stay accurate without manual effort.

Self-heal detects when your application has changed and regenerates the affected demo videos automatically. Instead of manually re-recording demos every time you ship, you enable self-heal on a video and let Demomatic keep it current.

When a self-heal runs, it uses the same prompt and settings as the original video—so the output matches what you originally configured.

## Self-heal modes

There are two ways to trigger self-heal on a video:

<CardGroup cols={2}>
  <Card title="On schedule" icon="clock">
    Regenerate the video on a recurring schedule—weekly or monthly. Demomatic automatically re-records and replaces the video at the configured frequency.
  </Card>

  <Card title="On GitHub PR" icon="github">
    Regenerate the video when a pull request is opened or merged in your connected GitHub repository. Use this to keep demos in sync with code changes before they ship.
  </Card>
</CardGroup>

## Frequency options

When using scheduled self-heal, you control how often videos regenerate. The available options are:

* **`weekly`** — regenerates once per week
* **`monthly`** — regenerates once per month

Choose `weekly` for fast-moving products or demos of frequently updated features, and `monthly` for more stable parts of your application.

## How to enable self-heal

<Steps>
  <Step title="Open a video">
    Navigate to the video in your library that you want to keep up to date.
  </Step>

  <Step title="Enable self-heal">
    Toggle **Self-heal** on. This enables the `self_heal_enabled` flag on the video.
  </Step>

  <Step title="Choose a mode">
    Select **On schedule**, **On GitHub PR**, or both.

    * For scheduled self-heal, choose **On schedule** and set a frequency (weekly or monthly).
    * For PR-based self-heal, choose **On GitHub PR** and make sure you have a GitHub repository connected.
  </Step>
</Steps>

## GitHub PR-based self-heal

When `self_heal_on_pr` is enabled, Demomatic monitors your connected GitHub repository for pull request activity. When a relevant PR is detected, Demomatic regenerates the video and posts a comment to the PR with a link to the updated demo.

This gives your team a way to review demo accuracy as part of the code review process.

<Info>
  PR-based self-heal requires a GitHub integration. See the [GitHub integration guide](/guides/github-integration) to connect your repository.
</Info>

## Use case

Self-heal is most valuable when you have demos embedded in your product, website, or sales materials that must stay accurate as your UI evolves. Instead of discovering outdated demos after the fact, you can configure them to regenerate automatically and always reflect the current state of your application.
