# Fix failing workflows with Keel

Keel reads the failed run, tests a fix against its data, and drafts the change for you.

## You need

- **Keel awake**: An owner or admin adds an Anthropic or OpenAI key in **Settings › Organization › Keel**. Until then Keel says **Keel is asleep.** See [Set up Keel](https://docs.gorunner.io/build/set-up-keel).

## Fix a failed run

1. Open the failed run, from **Runs** or from the workflow.
2. Press **Fix with Keel** in the run’s bar. Keel opens beside the run and says **Fixing** and the step’s name.
3. Wait for the card. You can close Keel meanwhile: it keeps working, and says **Keel’s fix is ready** when it is done.
4. Read the card, then press **Apply**. The fix is saved to the draft.
5. In the **Next** box, press **Publish…**, then **Run again**. The failed run goes through on the fix.

The step on the canvas says what Keel proved: **tested against this run, worked**, **still fails**, or **not tested against this run**.

> **Note** Keel never runs a step that sends something, such as an email, on its own. It asks first with a **Run test** card.

**Can Keel explain the error without fixing it?**

Yes. Press **Explain this error** under the error. Keel says what went wrong and offers to test a fix.

**What if my role can’t apply or publish?**

An operator or viewer can ask Keel, but can’t apply. An operator can’t publish either. Keel names who can: an editor or admin of the workspace.

## Other ways in

- **In Keel**: Type `/fix` for the latest failed run, or `#` to pick one.
- **In Runs**: Under **Needs you**, **Failed, grouped by cause**: press **Fix with Keel** on a group.

## Let Keel watch a workflow

Turn on **Maintenance mode** in the workflow’s **Settings**. When runs keep failing the same way, Keel opens a maintenance conversation, tests what it safely can against the failed run, and drafts the fix.

- **It needs**: **The most Keel may do** set to **Full**, the default, in **Settings › Organization › Keel**. Below Full, Keel never starts on its own.
- **When it starts**: After 3 failures of the same kind within 30 minutes. One failure never starts it.
- **How often**: At most 3 fixes for one workflow a day.
- **What changes**: Only the draft. The card may say **Keel applied this to the draft by itself.** Production runs the published version until someone publishes.
- **Where to read it**: In the Keel conversations of the workflow’s creator, as **Maintenance:** and the workflow’s name, and as **Keel offered a fix** in the audit log.

## Related

- [Find out why a run failed](https://docs.gorunner.io/build/why-a-run-failed): The failed step, and what it received · 3 min
- [Run again, cancel or delete runs](https://docs.gorunner.io/build/rerun-and-cancel): One run, or many at once · 4 min
- [What Keel can do](https://docs.gorunner.io/build/keel): Commands, cards and the four levels · 4 min

Source: https://docs.gorunner.io/build/fix-failures-with-keel
