Automated AI Code Reviewer for GitHub Commits using Groq and Gmail - n8n Workflow

Use this powerful n8n workflow to automatically trigger AI code reviews on GitHub push events using Groq's LLM, parse diffs with an n8n node, and send detailed HTML reports via Gmail.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • DevOps Engineers and Developers: Seeking immediate, automated feedback on commits.

  • Team Leads: Who need a quick summary of changes and potential issues without manual inspection.

  • Automation Specialists: Interested in utilizing the AI Agent n8n node and Groq LLM for technical content analysis within an n8n workflow.

  • Users exploring n8n templates: Looking for advanced examples of Git automation and custom scripting.

Overview

Manual code review can be time-consuming, especially for minor commits. This automation solves that by transforming a standard GitHub push into a comprehensive, AI-reviewed report. This robust n8n workflow leverages the Github Trigger to initiate the process, extracts code changes, and utilizes an AI Agent configured with Groq (an effective alternative to OpenAI) to analyze the code diffs for functional, style, and security issues. The final output is a highly readable, color-coded HTML report delivered directly via Gmail. This type of advanced n8n workflow showcases the power of combining platform-specific n8n node types with advanced large language models for critical development tasks.

How it Works

This automated n8n workflow follows a seven-step process:


  1. Trigger: The Github Trigger n8n node initiates the workflow upon a push event to a configured GitHub repository.

  2. Data Parsing: The Parser (Set n8n node) extracts essential metadata like repository name, owner, and the specific commit ID from the GitHub payload.

  3. Fetch Details: An HTTP Request n8n node calls the GitHub API using the commit ID to retrieve the full commit object, including the necessary file diffs (patch).

  4. HTML Formatting (Pre-AI): A Code n8n node processes the raw data. It runs custom JavaScript to generate a rich HTML snippet containing commit information and color-coded file patches (diffs). This formatted input is crucial for the AI.

  5. AI Analysis Setup: The Groq Chat Model n8n node is configured as the LLM provider, and a Simple Memory n8n node provides conversational context (though often minimal for single-shot review). The AI Agent n8n node is then activated, using a highly specific system prompt defining it as a professional code reviewer and enforcing a strict HTML output format based on review results.

  6. Output Compilation: A second Code n8n node (Output Parser) combines the initial formatted HTML (commit details and diffs) with the AI-generated review summary HTML block, creating the final email body.

  7. Notification: The Gmail n8n node uses the compiled HTML to send a final, comprehensive code review email to the designated recipient, concluding this powerful n8n workflow.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import Workflow: Copy the provided JSON data and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. GitHub Credentials: Set up or link your GitHub credentials for both the Github Trigger n8n node and the HTTP Request n8n node (which uses githubOAuth2Api).

  3. Configure Trigger: In the Github Trigger n8n node, select the target repository and ensure the webhook is active and listening for push events.

  4. Groq Credentials: Add your Groq API key to the Groq Chat Model n8n node credentials. Note that you can easily swap this component for an OpenAI Chat Model n8n node if preferred.

  5. Gmail Credentials: Set up or link your Gmail OAuth2 credentials to the Gmail n8n node.

  6. Customize Recipient: Update the 'Send To' field in the Gmail n8n node to your desired review notification address.

  7. Activate: Save and activate the n8n workflow. It is now ready to respond to repository pushes.

Node Details

Github Trigger (n8n trigger): The starting point of the n8n workflow. It is configured to listen specifically for push events on a selected GitHub repository, ensuring the automation runs only when code changes are committed.
HTTP Request (n8n node): Fetches the detailed commit information from the GitHub API using the commit ID extracted by the Parser. Key configuration uses predefined GitHub credentials for authentication.
Code (n8n node - Formatter): Contains complex JavaScript logic (formatPatch and renderResponse functions) to transform the raw commit diff into a visually appealing, color-coded HTML structure. This output is essential context for the downstream AI Agent.
Groq Chat Model (n8n node): Serves as the high-speed LLM provider for the AI component, utilizing models like llama-3.1-8b-instant for rapid analysis within the n8n workflow.
AI Agent (n8n node): The core intelligence of the n8n workflow. It receives the formatted HTML and uses a system prompt to execute a professional code review, checking for functional errors, style, security, and returning a result formatted in a specific HTML summary block.
Output Parser (Code n8n node): Combines the commit details HTML and the AI review summary HTML into a single payload, ensuring the final email is complete.


  • Gmail (n8n node): The final action, sending the complete, detailed, HTML-formatted code review report to the specified email address.

Related n8n Workflows

Paid

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by
Alex Huy
Alex Huy

Featured*