Developer & DevOps

Automated code review for GitLab merge requests with ChatGPT

14 nodes 290 185 Webhook
Download

Workflow Description

Automation that intercepts GitLab merge requests via webhook, sends the code changes to ChatGPT for analysis, and posts detailed review comments back to the repository, enabling developers to catch issues before merging.

How it works

  1. 1.Receive webhook notification when a merge request is created
  2. 2.Extract and retrieve the diff code from the GitLab branch
  3. 3.Send code to ChatGPT for comprehensive review and analysis
  4. 4.Process the AI response and structure feedback
  5. 5.Post review comments back to GitLab merge request

Use cases

  • Enforce code quality standards before code is merged
  • Reduce manual code review time and developer overhead
  • Identify common bugs, security issues, and anti-patterns automatically

Requirements

  • Active GitLab webhook configured for merge request events
  • Valid OpenAI API key with GPT access
  • Write permissions on GitLab repository

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

OpenAI LLM Chain

Details

Trigger Webhook
Nodes 14
Apps 2
Views 290
Downloads 185

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (14)

/

Sticky Note

Sticky Note

#1

Sticky Note2

Sticky Note

#2

Sticky Note3

Sticky Note

#3

Webhook

Webhook

#4

Code

Code

#5

Split Out1

Split Out

#6

OpenAI Chat Model1

OpenAI

#7

Get Changes1

HTTP Request

#8

Skip File Change1

If

#9

Parse Last Diff Line1

Code

#10

Post Discussions1

HTTP Request

#11

Need Review1

If

#12

Basic LLM Chain1

LLM Chain

#13

Sticky Note4

Sticky Note

#14