Automate GitLab merge requests using APIs with n8n
Ready for 3.0Ready 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).
- API to Check existing merge request (HTTP Request): calls an HTTP API
- Is Exists (If): checks a condition and branches into true / false
- Create New Merge Request (HTTP Request): calls an HTTP API (POST)
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Add Custom Notes To Merge Request (HTTP Request): calls an HTTP API (POST)
- API to CLOSE existing Merge Request (HTTP Request): calls an HTTP API (PUT)
- 30 secs wait to approve merge request and pipeline to finish (Wait): waits 30 seconds
- setValueForMerge (Edit Fields (Set)): sets 2 fields: merge_when_pipeline_succeeds, should_remove_source_branch
- 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)
- HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Wait
n8n-nodes-base.wait - Edit Fields (Set)
n8n-nodes-base.set - Schedule Trigger
n8n-nodes-base.scheduleTrigger
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…