Developer & DevOps

Automated ChatGPT code review in GitLab

14 nodes 205 149 Webhook
Download

Workflow Description

Automate code reviews in GitLab using ChatGPT. Triggered on merge requests, it analyzes code changes and posts intelligent comments directly to the pull request for immediate feedback.

How it works

  1. 1.Receive webhook trigger from GitLab on merge request creation or update
  2. 2.Extract changed file contents and analyze code differences
  3. 3.Process code through LLM Chain and ChatGPT model for quality and security assessment
  4. 4.Evaluate results and categorize issues by severity level
  5. 5.Post detailed review comments and suggestions to the merge request
  6. 6.Log findings and generate audit reports for team reference

Use cases

  • Automate code quality checks and enforce best practices without manual review
  • Detect bugs and security vulnerabilities before code merges to production
  • Provide instant feedback to developers about code style and standards compliance

Requirements

  • Active OpenAI account with valid API key configured
  • GitLab project with webhook and API access enabled
  • Sufficient permissions to add comments on merge requests

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 205
Downloads 149

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