Templates / Automate GitLab merge requests using APIs with n8n

Automate GitLab merge requests using APIs with n8n

Ready for 3.0

by Aditya Gaur ✓ · 5,208 views · created 2025-02-07 · DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 10 nodes and runs on a schedule (every day). It uses only n8n's built-in nodes.

How it runs

Trigger: On a schedule (every day).

  1. API to Check existing merge request (HTTP Request): calls an HTTP API
  2. Is Exists (If): checks a condition and branches into true / false
  3. Create New Merge Request (HTTP Request): calls an HTTP API (POST)
  4. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  5. Add Custom Notes To Merge Request (HTTP Request): calls an HTTP API (POST)
  6. API to CLOSE existing Merge Request (HTTP Request): calls an HTTP API (PUT)
  7. 30 secs wait to approve merge request and pipeline to finish (Wait): waits 30 seconds
  8. setValueForMerge (Edit Fields (Set)): sets 2 fields: merge_when_pipeline_succeeds, should_remove_source_branch
  9. Merge When Pipeline Succeeds (HTTP Request): calls an HTTP API (PUT)

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (6)

From the author

Who is this template for? This template is designed for developers, DevOps engineers, and automation enthusiasts who want to streamline their GitLab merge request process using n8n, a low-code workflow automation tool. It eliminates manual intervention by…

Excerpt from Aditya Gaur's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.