AI-Powered SEO Keyword Cannibalization Detector - n8n Workflow

Use this advanced n8n workflow to automatically detect keyword cannibalization across multiple client websites using Google Search Console data and GPT-4o analysis, generating actionable SEO reports.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

SEO Agencies managing multiple client websites.
Technical SEO Specialists needing scalable cannibalization checks.
Content Managers looking to optimize keyword targeting and site structure.
Anyone seeking powerful AI integration within their n8n automation suite.

Overview

Detecting keyword cannibalization is a critical but often time-consuming SEO task, especially when managing multiple domains. This advanced n8n workflow solves this by fully automating the entire process, from data extraction to AI-powered risk assessment and final reporting.

This unique n8n solution utilizes the Google Sheets Trigger as the starting point, ensuring that whenever a target keyword list or client URL is updated, the system runs immediately. It fetches performance data from Google Search Console (GSC) for up to four different clients simultaneously, transforms the raw data using custom JavaScript, and then passes the results to a sophisticated AI agent powered by GPT-4o. The AI analyzes competing URLs for the same keyword and determines a clear risk level (High, Moderate, Low, or None), providing actionable remediation steps. The resulting report is written back into Google Sheets, making this n8n template a complete, hands-off monitoring system for scalable SEO operations.

How it Works

The operation begins with the Monitor Keywords Sheet for Changes n8n trigger, which constantly checks a designated Google Sheet for updates. Upon detection, the n8n workflow proceeds to fetch client website URLs and the target keywords list from separate sheets.


  1. Client Routing & Data Fetching: Conditional If nodes (Route to Client 1, etc.) dynamically direct the flow based on the client URL to the correct GSC API calls. Dedicated HTTP Request n8n node structures fetch 30 days of search performance data (query, page, position, clicks, impressions, CTR) for each client using the Google OAuth2 credential.

  2. Data Structuring: Custom Code n8n node steps then process the raw GSC data, transforming the flat array into a structured format where each keyword entry contains an array of all ranking URLs and their metrics.

  3. Consolidation & Matching: The Merge All Client GSC Data node unifies all GSC data with the initial target keyword list. A subsequent Code n8n node matches the target keywords against the actual GSC performance data, flagging keywords that are ranking (foundingsc) or missing (notfoundin_gsc).

  4. AI Analysis: Only keywords found in GSC are passed through the filter to the Analyze Keyword Cannibalization Risk n8n node. This AI Agent, using the OpenAI GPT-4o Model, executes a prompt that checks for the presence of multiple pages from the same domain ranking for the same keyword, assigning a specific risk level (High, Moderate, Low, No).

  5. Reporting: The AI output is cleaned and structured by the Parse AI Analysis to Structured JSON n8n node, and finally, the comprehensive report (including risk level, reasoning, and remediation steps) is appended or updated in the designated reporting Google Sheet using the Save Cannibalization Analysis Results n8n node.

Installation Guide


  1. Import: Download the n8n workflow JSON provided and import it into your n8n instance.

  2. Google Sheets Credential: Set up or update your Google Sheets credential. Ensure this credential has access to the client list, target keyword sheet, and the final reporting sheet.

  3. Google Search Console Credential: Configure a Google OAuth2 API credential. This is used by the HTTP Request n8n node steps to fetch GSC data. Ensure the associated Google account has access to all specified client properties in GSC.

  4. OpenAI Credential: Set up your OpenAI credential, which is required for the GPT-4o AI Agent n8n node.

  5. Configure Sheets: Update the Document IDs and Sheet Names in the Google Sheets nodes (Trigger, Fetch URLs, Fetch Keywords, Save Results) to point to your specific input and output spreadsheets.

  6. Update Routing: Modify the If n8n node conditions (Route to Client 1 through Route to Client 4) to match your actual client domain URLs.

  7. Activate: Once credentials and sheet connections are confirmed, activate the n8n workflow. The n8n trigger will begin monitoring for changes.

Node Details

Trigger and Initial Fetch

Monitor Keywords Sheet for Changes (Google Sheets Trigger): The starting n8n node, polling a specific Google Sheet every minute for modifications to trigger the n8n workflow execution.
Fetch Client Website URLs (Google Sheets): Reads the list of client domains from a designated URL sheet.
Fetch Target Keywords from Sheet (Google Sheets): Gathers the reference list of keywords to analyze.

Data Extraction and Grouping

Fetch GSC Data (HTTP Request): Performs a POST request to the Google Search Console API. Key configuration includes using the googleOAuth2Api credential and dynamic dates ($now.minus(30, 'days')) to retrieve 30 days of query and page dimensions.
Group GSC Data by Keyword (Code): A custom JavaScript n8n node. Function: Restructures the GSC API response by grouping all ranking URLs (including position, clicks, impressions, and CTR) under their primary keyword.

Core Logic and AI

Merge All Client GSC Data (Merge): Combines five input streams (four client GSC datasets and the target keyword list).
Match Keywords from Sheet with GSC Data (Code): Cross-references the input list against ranking data, outputting a status field (foundingsc).
Filter Keywords Found in GSC (If): Ensures the AI agent only processes items that have actual ranking data.
Analyze Keyword Cannibalization Risk (AI Agent): This critical n8n node uses a detailed prompt and the connected OpenAI GPT-4o Model to categorize keyword cannibalization risk based on the number of competing pages from the same domain.
Parse AI Analysis to Structured JSON (Output Parser): Converts the natural language output of the AI agent into a machine-readable JSON object with fields like 'Risk Level' and 'Remediation steps'.

Final Action


  • Save Cannibalization Analysis Results (Google Sheets): The final n8n node, configured to appendOrUpdate rows, writing the complete AI-generated report data back into the results spreadsheet.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Featured*