AI Code Review with Linting and Red-Marked Sheets Output - n8n Workflow

Automate advanced code reviews using an n8n workflow, combining custom linting with Gemini AI feedback. Stores red-marked corrections in Google Sheets and alerts Slack.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Software Development Teams requiring consistent, automated code quality checks.
Tech Leads and QA engineers looking to integrate AI and linting into their review pipeline.
Users seeking advanced n8n templates for combining custom scripting with LLM services.
Anyone needing an n8n workflow that uses Google Sheets as a data entry and reporting interface.

Overview

This sophisticated n8n workflow addresses the challenge of scaling efficient and comprehensive code review. Instead of relying solely on slow manual processes, this automation template provides a two-layered review system:


  1. Static Analysis (Linting): A custom n8n node quickly checks for common mistakes (like using var or console.log) and structural integrity, calculating a preliminary score.

  2. AI-Powered Nuance: The code is then passed to a powerful AI Agent n8n node, which uses large language models (like Google Gemini) to provide contextual, human-like feedback based on predefined rules.

Crucially, this n8n workflow template instructs the AI to mark critical corrections using red-colored HTML tags, ensuring the review results written back to Google Sheets are immediately visually impactful. The entire process starts via a Google Sheets n8n trigger and concludes with a concise summary posted to Slack, centralizing feedback and maximizing code quality and review speed.

How it Works

This n8n workflow executes the following steps automatically:


  1. Trigger on Submission: The n8n trigger, configured as a Google Sheets Trigger (コード入力シート監視), monitors a specified sheet for new code submissions, initiating the review process.

  2. Lint Check: The submitted code first runs through a custom Function n8n node (Lint Check) which performs basic static analysis and assigns an initial lint score, logging any critical, major, or minor issues.

  3. Retrieve Rules: The workflow utilizes an n8n node to fetch coding standards or design documents from another sheet, providing context to the AI.

  4. AI Review: The AI Agent n8n node receives the code, the lint summary, and the extracted rules. It generates a detailed review, explicitly using HTML span tags (e.g., ) to visually highlight required corrections within the returned code snippet.

  5. Format and Score: A subsequent Function n8n node (Format Review Output) standardizes the AI output and calculates a final, combined overall score (0–10).

  6. Aggregate Stats: Another Function n8n node (Aggregate Review Stats) prepares a final summary count of issues (Critical/Major/Minor) and the overall score into a clean text string.

  7. Data Preparation: The Set n8n node (レビュー結果整形) prepares the final payload, compiling the original code, the reviewed code, and a timestamp.

  8. Output to Sheets: A Google Sheets n8n node (レビュー結果書き込み) writes the complete, reviewed data, including the red-marked corrections, to the designated 'Review Results' sheet.

  9. Notify Slack: The final Slack n8n node (Post Review Summary) sends a concise notification, including the summary statistics and overall score, to the team channel, confirming the n8n workflow completion.

Installation Guide

To install and utilize this powerful n8n workflow template:


  1. Import Workflow: Copy the provided JSON data and paste it into your n8n instance using the 'Import from JSON' option.

  2. Credentials Setup: You must configure the required credentials for the n8n nodes:

Google Sheets: Set up your Google Sheets credential with appropriate read/write permissions for the target spreadsheet.
AI Model: Connect your Google Gemini or OpenAI (if switching the LLM node) credential.
Slack: Set up your Slack credential for posting messages.

  1. Placeholder Replacement: Update the parameters in the following n8n nodes:

コード入力シート監視 (Google Sheets Trigger): Replace SPREADSHEETID> and sheet name placeholders for the input sheet.
レビュー結果書き込み (Google Sheets): Replace placeholders for the output results sheet.
Post Review Summary (Slack): Replace SLACKCHANNEL_ID> with your desired notification channel ID.

  1. Review Prompt: Customize the detailed review prompt within the AI Agent n8n node to match your project's specific coding guidelines.

  2. Activate: Save the n8n workflow and toggle the status to 'Active'. The n8n trigger will now poll the sheet for new code.

Node Details

Google Sheets Trigger (コード入力シート監視): This n8n trigger initiates the entire process whenever a new or modified row appears in the designated input sheet, signaling a request for code review.
Function (Lint Check): A core n8n node performing quick, rule-based static analysis. It generates basic lint errors and a preliminary score, which is then fed into the AI prompt for context.
AI Agent (AI Agent): The central processing n8n node. It integrates the Google Gemini Chat Model and uses the context provided by the lint results and external rules to perform a nuanced, categorized review, generating output that includes HTML tags for red-marking corrections.
Function (Format Review Output & Aggregate Review Stats): These custom n8n nodes handle post-processing of the AI's unstructured text, calculating final scores, and summarizing the issue counts (Critical, Major, Minor).
Set (レビュー結果整形): This n8n node structures the final item, ensuring fields like reviewedCode, originalCode, and timestamp are correctly mapped before writing to storage.
Google Sheets (レビュー結果書き込み): The final data storage n8n node. It utilizes the 'Append or Update' operation to log the original code alongside the visually red-marked, reviewed code into the results spreadsheet.


  • Slack (Post Review Summary): This n8n node sends a formatted summary, including the calculated score and issue counts, to a specified Slack channel, completing the notification process of this n8n workflow.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
higashiyama
higashiyama

Featured*