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

# Merges

> When a PR merges, Flowmaps updates the flows it changed, moves the rest to the new commit, reuses the PR's preview and records each change.

When a pull request merges into a repo's default branch, Flowmaps brings the repo's flows up to the merge commit. Flows the change touched get a new version; the rest keep their steps and have their line numbers moved. Each new version is recorded in the flow's history, credited to the pull request, and the pull request appears on **Changes** with what landed. Direct pushes to the default branch are handled the same way.

## What a merge does to each flow

* **Touched and changed.** A flow whose cited code the merge changed is updated at the merge commit: its changed steps, endings and calls are worked out again, and the rest are kept. It gets a history entry with the pull request.
* **Touched, same behaviour.** A flow whose code changed but which still does the same thing gets a new version at the merge commit with a "No behaviour change" entry.
* **Untouched.** A flow whose code the merge didn't reach is carried to the merge commit: every cited range moves through the diff, so its line numbers stay right. This uses no credits and adds no history entry.
* **Removed.** When the merge removes an endpoint, its flow keeps its last version and is marked **endpoint removed** in the Flows list, with an "Endpoint removed" history entry.

Endpoints a pull request adds appear on the repo's endpoint list after the merge, ready to map. If they were mapped from the pull request's check with **Map touched**, they're mapped already.

Merges in one repo are handled one at a time, in the order they landed. When several merges arrive close together, one update can take in several of them; its history entry says "Includes earlier merges" and names each pull request.

## Previews carried into the merge

If the pull request had a [preview](https://docs.flowmaps.ai/pull-requests/previews.md), the merge builds on it instead of starting again:

* **Same code.** When the merged code is the same as the code the preview read, the merge takes the preview's flows as they are, with no further credits.
* **Main moved on.** When other changes landed first, the merge starts from the preview's flows and updates them only for what differs between the preview and the merge commit.
* **A preview still running.** Flows the preview had finished are taken; a flow it's still working on is finished and then taken; flows it hadn't started are done by the merge. What the preview worked out isn't worked out again.

For a stack of pull requests, the merge reuses the stack's previews the same way. See [Stacked PRs](https://docs.flowmaps.ai/pull-requests/stacked-prs.md#merging-a-stack).

## The Changes page

**Changes** in the sidebar lists the pull requests and direct pushes that change how your flows behave, across the repos you can read. Open ones show their preview; merged ones show what landed.

![The Changes page, a table of pull requests and pushes with their state, title, flows changed and when they were updated](https://mintcdn.com/flowmaps/Laxd03p6_qALyN3o/images/changes-light.png?fit=max\&auto=format\&n=Laxd03p6_qALyN3o\&q=85\&s=81fcc14989f2f203226b634a424f1642)

Changes: pull requests and direct pushes, with the flows each one previewed or changed.

* **Status**: All, Open, Merged or Closed, with counts.
* **Repo**: one repo, or all.
* **Behaviour changes only**: hide pull requests that changed no flow's behaviour.

Each row shows its **State** (open, draft, merged, closed, or **Pushed** for a direct push), the **Change** (title, repo, number and author, linked out to GitHub), the **Flows** it previewed or changed, and when it was **Updated**. Choose a row to open its page.

A merged pull request's page lists the flows the merge changed, each with **Open the saved flow** and whether that version is still current ("Saved as the current version") or has changed since. A merged pull request that never had a preview still shows what landed. A direct push opens a page of its own with its commits.

If Changes is empty and your GitHub account isn't linked, it offers **Link your GitHub account**: pull requests show only for repos you can read on GitHub.

## When a merge can't update a flow

* **Out of credits.** A flow the merge couldn't update shows **Out of date**, and says "This flow didn't update for the last merge: out of credits". The merge waits, and the flow updates by itself once credits reset or you add credits.
* **A cancelled merge.** Cancelling a merge's run from the repo's progress page skips that merge. The flows it hadn't updated get its changes with the next merge that touches them, or a re-map. What it used so far is still charged.
* **Plan limits.** A repo past your plan's repo count keeps its flows, but its merges wait until you upgrade. On the Free plan, merges pause after 30 days with no visit to the account. See [Keeping flows current](https://docs.flowmaps.ai/mapping/keeping-flows-current.md).

## Next steps

> [card] [Flow history](https://docs.flowmaps.ai/flows/history.md)
>
> Every version of a flow, by pull request.

> [card] [PR previews](https://docs.flowmaps.ai/pull-requests/previews.md)
>
> See a pull request's changes before it merges.


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