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

# Compose plans

> Call one plan from another as a step, and use its result.

`release_summary` finds the latest release, calls `changes_since` for the commits since it, and summarizes them.

```yaml .graph/plans/release_summary.yaml theme={null}
version: 2
identifier: release_summary
name: Release summary
description: Summarizes the commits merged since the latest GitHub release.
steps:
- id: release
  tool_name: github__tool__gh_release
  input: {}
- id: changes
  tool_name: plan__changes_since
  input:
    base: '{{release.tag}}'
finish:
  solver:
    query_to_answer: Summarize the {{changes.count}} commits since {{release.tag}} in three one-line bullet points.
    data:
      commits: '{{changes.commits}}'
```

```yaml .graph/plans/changes_since.yaml theme={null}
version: 2
identifier: changes_since
name: Changes since
description: The commits merged since a git ref.
input_schema:
  type: object
  required:
  - base
  properties:
    base:
      type: string
      description: The ref to start after, such as a release tag
steps:
- id: commits
  tool_name: github__tool__git_log
  input:
    base: '{{input.base}}'
    head: HEAD
finish:
  output:
    count: '{{commits.count}}'
    commits: '{{commits.commits}}'
```

## Call the plan from a step

The `changes` step calls `changes_since` as `plan__changes_since`. Its `input` matches `changes_since`'s `input_schema`, and later steps read the result through `changes`, the same keys as `changes_since`'s `finish.output`: `{{changes.count}}` and `{{changes.commits}}`.

## Validate it

```bash theme={null}
graph plan validate release_summary
```

```text theme={null}
ok: 'release_summary' — 2 steps
```

## Run it

```bash theme={null}
graph plan run release_summary
```

The called plan's steps show indented under its step:

```text theme={null}
→ github__tool__gh_release {}
✓ github__tool__gh_release 787.1ms
→ plan__changes_since {"base":"v0.15.0"}
  → github__tool__git_log {"base":"v0.15.0","head":"HEAD"}
  ✓ github__tool__git_log 31.6ms
✓ plan__changes_since 32.2ms
✎ synthesizing answer…
- **Plan drafting overhaul**: a new agent-driven workbench…
- **Decision/routing infrastructure added**: new decision-model plumbing…
- **Execution & storage hardening**: plans now require explicit finish keys…
  1 call · 5k in / 424 out · $0.02
```

## Related guides

> **[Iterate with map and reduce](/plans/guides/map-and-reduce)**
>
> Call a plan once per item.

> **[Optimize an agent with plans](/agents/guides/optimize-with-plans)**
>
> Give an agent a plan to call.

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


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