# Overview

If you've hit the limits of GitHub's serial merge queue - main turning red, CI costs spiraling, chaos at scale - Trunk Merge Queue is the enterprise upgrade built for reliability at any scale. Handle your noisiest pipelines, cut CI costs up to 90%, and fire and forget.

***

### Benefits of using Trunk Merge Queue

Trunk Merge Queue solves three critical problems that break traditional workflows at scale.

#### #1: Stop main from turning red

**The problem:** Flaky tests fail unpredictably. Your team mutes tests, locks branches, and gets paged to investigate.

**How Trunk fixes it:** Failed PRs stay in queue while downstream PRs continue testing. If a later PR that includes the failed code passes, Trunk knows the failure was transient, both PRs merge together.

**Key capabilities:**

* Anti-flake protection with optimistic merging
* Pending failure depth holds failed PRs while successors test, enabling automatic flake recovery
* Automatic quarantine of flaky tests

→ Learn about [anti-flake protection](https://docs.trunk.io/merge-queue/optimizations/anti-flake-protection)

***

#### #2: Stop CI costs from spiraling

**The problem:** GitHub runs full CI for every PR. 50 PRs/day = 50 full runs. With growing teams, CI costs become seven figures.

**How Trunk fixes it:** Intelligent batching tests up to 100 PRs in a single CI run. When a batch fails, automatic bisection isolates the culprit without ejecting the entire batch or requiring manual debugging.

**Key capabilities:**

* Intelligent Batching
* Batch up to 100 PRs
* Auto-Bisection
* Configurable batch size & wait time

→ See how [batching](https://docs.trunk.io/merge-queue/optimizations/batching) works

***

#### #3: Stop waiting in a serial queue

**The problem:** Single-track queue means your 2-line fix waits 45 minutes behind a slow feature PR testing an unrelated part of the codebase.

**How Trunk fixes it:** Parallel queues create independent test lanes for non-overlapping changes. Frontend merges in Lane A while backend runs in Lane B. Native Bazel/Nx integration analyzes impacted targets automatically.

**Key capabilities:**

* Parallel Queues
* Bazel/Nx integration
* Impacted targets analysis
* Priority merging

→ Explore [parallel queues](https://docs.trunk.io/merge-queue/optimizations/parallel-queues)

***

### Try Trunk Merge Queue

**Start with free trial:**

1. Install Trunk GitHub App (5 minutes)
2. Create your first queue (2 minutes)
3. Submit a test PR

**Total setup time: < 10 minutes**

→ [Get started](https://docs.trunk.io/merge-queue/getting-started)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trunk.io/merge-queue/merge-queue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
