Skip to main content

ChatGPT Automatic Code Review in Gitlab MR

Workflow preview

Workflow preview
100%
ChatGPT Automatic Code Review in Gitlab MR preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who this template is for This template is for every engineer who wants to automate their code reviews or just get a 2nd opinion on their PR. How it works This workflow will automatically review you...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.webhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by assert.

Original n8n.io source

1.1 Workflow description

Title
ChatGPT Automatic Code Review in Gitlab MR
Workflow name
ChatGPT Automatic Code Review in Gitlab MR

Who this template is for

This template is for every engineer who wants to automate their code reviews or just get a 2nd opinion on their PR.

How it works

This workflow will automatically review your changes in a Gitlab PR using the power of AI. It will trigger whenever you comment with +0 to a Gitlab PR, get the code changes, analyze them with GPT, and reply to the PR discussion.

Set up Steps

  • Set up webhook of note_events in Gitlab repository (see here on how to do it)
  • Configure ChatGPT credentials
  • Note "+0" in MergeRequest to trigger automatic review by ChatGPT

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Need Review

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Get Changes

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 8 - Skip File Changes

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Parse Last Diff Line

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Basic LLM Chain

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 11 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 12 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 13 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Post Discussions

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow ChatGPT Automatic Code Review in Gitlab MR
Complexity intermediate
Nodes 14
Categories Engineering, AI Summarization
Author assert
Published 07 Mar 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2167/2167.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does ChatGPT Automatic Code Review in Gitlab MR do?

Who this template is for This template is for every engineer who wants to automate their code reviews or just get a 2nd opinion on their PR. How it works This workflow will automatically review you...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.