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

# Debug a plan

> Pause a failing plan at a breakpoint, find the bad input, and fix the step.

`unreleased_changes` fails at its `commits` step.

```yaml .graph/plans/unreleased_changes.yaml theme={null}
version: 2
identifier: unreleased_changes
name: Unreleased changes
description: The commits since the latest release.
steps:
- id: release
  tool_name: github__tool__gh_release
  input: {}
- id: commits
  tool_name: github__tool__git_log
  input:
    base: '{{release.url}}'
    head: HEAD
finish:
  output:
    since: '{{release.tag}}'
    commits: '{{commits.commits}}'
```

**1. Open the plan in the workbench**

```bash theme={null}
graph workbench plan \
  unreleased_changes
```

**2. Set a breakpoint**

Press <kbd>Tab</kbd> to focus the steps, select `commits` with <kbd>j</kbd> and <kbd>k</kbd>, and press <kbd>b</kbd>.

**3. Start a debug run**

Press <kbd>g</kbd>. The run calls `release` and pauses before `commits`, showing the input it's about to send:

![The workbench paused at a breakpoint on commits, with release marked done and the debug pane showing the rendered input: base is https://github.com/tylerdavis/graph/releases/tag/v0.15.0 and head is HEAD.](https://mintcdn.com/graph/s-Ce0Orb66xMgIkN/images/workbench/debug-breakpoint.svg?fit=max\&auto=format\&n=s-Ce0Orb66xMgIkN\&q=85\&s=2a4094d6c2428fcd9d96793c6e49378c)

`base` is the release page's URL, which git can't read as a revision. It should be the release's `tag`.

**4. Fix the step**

Press <kbd>a</kbd> to stop the run. With `commits` selected, press <kbd>e</kbd>, change `base` to `{{release.tag}}`, and press <kbd>Ctrl</kbd>+<kbd>S</kbd> to apply it.

**5. Run it again**

Press <kbd>r</kbd>. The run finishes, and <kbd>3</kbd> opens the run tab with each step's result.

**6. Save**

Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to write the fix to `./.graph/plans/unreleased_changes.yaml`.

## Related guides

> **[Handle failures](/plans/guides/handle-failures)**
>
> Tell why a run failed and choose how to respond.

> **[Run a plan](/plans/guides/run-a-plan)**
>
> Run a plan with inputs and use its result.

> **[Draft a plan in the workbench](/plans/guides/draft-in-workbench)**
>
> Turn a goal into a working, saved plan.

> **[Plan file](/plans/reference/plan-file)**
>
> Every field a plan file takes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.