# Merge Queue

- [Overview](https://docs.trunk.io/merge-queue/merge-queue.md): Merge queue that guarantees branch stability and accelerates development at enterprise scale
- [Getting Started](https://docs.trunk.io/merge-queue/getting-started.md): Set up Trunk Merge Queue for your repository by installing the GitHub App, creating a queue, and configuring branch protection.
- [Install and create your queue](https://docs.trunk.io/merge-queue/getting-started/install-and-create-your-queue.md): Install the Trunk GitHub App, connect your repository, and create your first merge queue.
- [Configure branch protection](https://docs.trunk.io/merge-queue/getting-started/configure-branch-protection.md): Set up GitHub branch protection so Trunk Merge Queue can admit, test, and merge pull requests through your protected branch.
- [Configure CI status checks](https://docs.trunk.io/merge-queue/getting-started/configure-ci-status-checks.md): Make sure your CI runs whenever Trunk Merge Queue tests a pull request.
- [Test your setup](https://docs.trunk.io/merge-queue/getting-started/test-your-setup.md): Verify your Trunk Merge Queue installation by submitting a test PR and confirming it merges automatically.
- [Migrate from GitHub Merge Queue](https://docs.trunk.io/merge-queue/migrating-from-github-merge-queue.md): Switch from GitHub's native merge queue to Trunk Merge Queue with minimal disruption to your workflow.
- [Optimizations](https://docs.trunk.io/merge-queue/optimizations.md): Advanced features that increase merge throughput, handle flaky tests, and prioritize critical PRs in Trunk Merge Queue.
- [Predictive testing](https://docs.trunk.io/merge-queue/optimizations/predictive-testing.md): Test PRs against the projected future state of your main branch to catch conflicts before they reach production.
- [Anti-flake protection](https://docs.trunk.io/merge-queue/optimizations/anti-flake-protection.md): Combine optimistic merging and pending failure depth to prevent flaky test failures from blocking the merge queue.
- [Parallel queues](https://docs.trunk.io/merge-queue/optimizations/parallel-queues.md): Create dynamic parallel queues to reduce queue time
- [Bazel](https://docs.trunk.io/merge-queue/optimizations/parallel-queues/bazel.md): Instructions for enabled dynamic parallel queues powered by your bazel graph
- [Nx](https://docs.trunk.io/merge-queue/optimizations/parallel-queues/nx.md): Instructions for enabled dynamic parallel queues powered by your Nx graph
- [Custom Build Systems](https://docs.trunk.io/merge-queue/optimizations/parallel-queues/api.md): Upload custom list of impacted targets
- [Batching](https://docs.trunk.io/merge-queue/optimizations/batching.md): Test multiple PRs together as a single unit to increase merge throughput and reduce CI costs.
- [Priority merging](https://docs.trunk.io/merge-queue/optimizations/priority-merging.md): Fast-track critical PRs like hotfixes and security patches to the front of the merge queue.
- [Optimistic merging](https://docs.trunk.io/merge-queue/optimizations/optimistic-merging.md): Merge PRs faster by using passing test results from later PRs in the queue to validate earlier ones.
- [Pending failure depth](https://docs.trunk.io/merge-queue/optimizations/pending-failure-depth.md): Keep failed PRs in the queue while successor PRs test, giving transient failures a chance to pass.
- [Direct merge to main](https://docs.trunk.io/merge-queue/optimizations/direct-merge-to-main.md): Skip redundant retesting and merge PRs directly when they are already tested against the current tip of main.
- [Using the Queue](https://docs.trunk.io/merge-queue/using-the-queue.md): Daily operations for working with Trunk Merge Queue.
- [Submit and cancel pull requests](https://docs.trunk.io/merge-queue/using-the-queue/reference.md): Covers the journey of a PR from submission through various states to completion
- [Monitor queue status](https://docs.trunk.io/merge-queue/using-the-queue/monitor-queue-status.md): View real-time queue activity, PR status, and test results in the Trunk Merge Queue dashboard.
- [Handle failed pull requests](https://docs.trunk.io/merge-queue/using-the-queue/handle-failed-pull-requests.md): Understand why PRs fail in the merge queue and how to fix and resubmit them.
- [Work with stacked pull requests](https://docs.trunk.io/merge-queue/using-the-queue/stacked-pull-requests.md): Merge a chain of dependent pull requests through Trunk Merge Queue, either as a single combined unit with /trunk stack or one at a time with /trunk merge.
- [Emergency pull requests](https://docs.trunk.io/merge-queue/using-the-queue/emergency-pull-requests.md): Bypass the merge queue entirely for true emergencies. Use with caution as this can invalidate in-progress queue tests.
- [Force merge](https://docs.trunk.io/merge-queue/using-the-queue/force-merge.md): Admins can push a pull request through Merge Queue even when GitHub branch protection rules aren't satisfied. The PR is still tested; only the final merge bypasses protection.
- [Integration for Slack](https://docs.trunk.io/merge-queue/integration-for-slack.md): Send merge queue updates to multiple Slack channels and receive personal DM notifications — all powered by the Trunk Slack app.
- [Webhooks](https://docs.trunk.io/merge-queue/webhooks.md): Merge Queue > Webhooks
- [Administration](https://docs.trunk.io/merge-queue/administration.md): Configuration, integrations, and analytics for queue administrators.
- [Settings and configurations](https://docs.trunk.io/merge-queue/administration/advanced-settings.md): Explanation of settings for states, timeouts, concurrency, and branch protection.
- [Terraform provider](https://docs.trunk.io/merge-queue/administration/terraform.md): Manage Trunk Merge Queue configuration as code using the trunk-io/trunk Terraform provider.
- [Metrics and monitoring](https://docs.trunk.io/merge-queue/administration/metrics.md)
- [Reference](https://docs.trunk.io/merge-queue/reference.md): Technical documentation and troubleshooting resources.
- [CLI reference](https://docs.trunk.io/merge-queue/reference/merge-queue-cli-reference.md): Trunk CLI commands for submitting, canceling, pausing, and resuming the merge queue.
- [API reference](https://docs.trunk.io/merge-queue/reference/merge.md): Public Trunk Merge Queue API. All requests should be authenticated.
- [FAQ](https://docs.trunk.io/merge-queue/reference/common-problems.md): Troubleshooting and FAQ
- [Troubleshooting](https://docs.trunk.io/merge-queue/reference/troubleshooting.md): Common Trunk Merge Queue issues and how to fix them, including permission errors, stuck PRs, and missing status checks.


---

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