Optimize Top Website Content with Analytics and AI Knowledge Graphs - n8n Workflow

Use this comprehensive n8n workflow to pull top performing pages from Google Analytics, scrape content using Firecrawl, and generate AI-driven topical summaries and content gaps using InfraNodus. Perfect for content marketing SEO optimization.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content Strategists and SEO Specialists looking to find content gaps.

  • Digital Marketing teams needing structured insights from Google Analytics data.

  • Users who require automated web scraping and knowledge graph generation.

  • n8n users seeking advanced n8n workflow examples incorporating multiple APIs.

Overview

Understanding what your audience truly cares about is the key to effective content marketing. This powerful n8n workflow connects your performance data directly to advanced analytical tools. The solution automates the process of identifying your top-performing content via Google Analytics, scraping the actual text using the Firecrawl API, and then feeding that content into InfraNodus. InfraNodus creates a topical knowledge graph, revealing hidden connections and identifying gaps—key opportunities for new content creation. This specific n8n workflow acts as a content optimization engine, leveraging the power of several specialized tools within a single, seamless automation. If you are looking for advanced n8n templates, this flow demonstrates robust integration across disparate services.

How it Works

The entire process is initiated by an n8n trigger: the On form submission n8n node.


  1. Data Collection: The workflow begins by using the Google Analytics n8n node to fetch the top 30 most viewed pages (pagePath) from your specified GA4 property over the last 30 days.

  2. URL Normalization: A Code n8n node runs a JavaScript snippet to prepend the base URL to the relative page paths provided by Google Analytics, creating fully functional URLs (fullUrl) ready for scraping.

  3. Iteration: The Loop Over Items n8n node then iterates through each of these normalized URLs, processing them one by one.

  4. Content Extraction: For each item, the URL to Markdown with Firecrawl n8n node (an HTTP Request n8n node configured with the Firecrawl API) scrapes the content and converts it into clean Markdown text.

  5. Knowledge Graph Population: The extracted text is immediately sent via the InfraNodus Save to Graph n8n node (another HTTP Request n8n node) to populate a designated InfraNodus knowledge graph. This node saves the content snippets, building a complex network of concepts.

  6. AI Analysis: Once the Loop Over Items n8n node completes its batch processing, the workflow continues to the InfraNodus GraphRAG Summary n8n node. This step queries the newly created graph to generate an AI-driven summary, highlighting the main topics and potential content gaps based on the collective content.

  7. Final Output: The final insights are elegantly displayed to the user via a results Form n8n node, showcasing the summary and main topics derived from the analysis. This showcases the full capability of this advanced n8n workflow.

Installation Guide

To utilize this n8n template, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance via the 'Workflows' menu.

  2. Trigger Setup: The initial n8n trigger is a Form Submission. No further configuration is needed for the trigger itself, but you will interact with the form to launch the analysis.

  3. Google Analytics Credentials: Update the Google Analytics n8n node connection with your valid Google Analytics OAuth2 credentials and specify the correct GA4 property ID.

  4. Code Node Modification: In the Code n8n node, ensure the hardcoded prefix URL (https://support.noduslabs.com) is replaced with your specific website's base URL.

  5. Firecrawl API Key: Configure the URL to Markdown with Firecrawl n8n node with a Bearer Token credential using your Firecrawl API key.

  6. InfraNodus API Key: Configure both InfraNodus Save to Graph and InfraNodus GraphRAG Summary n8n nodes with your InfraNodus Bearer Token API Key. Ensure the graph name (topsupportpages) is consistent across both nodes.

Node Details

On form submission (n8n trigger): Initiates the entire n8n workflow manually via a web form interface.
Google Analytics (n8n node): Retrieves content performance data. Key Configuration: Limits results to 30 items, uses 'screenPageViews' metric, and 'pagePath' dimension over the 'last30days'.
Code (n8n node): Custom logic used to fix incomplete URLs from Google Analytics output by prepending the domain name, crucial for successful web scraping.
Loop Over Items (n8n node): Manages flow control by splitting the list of URLs into batches, ensuring each page is processed individually for scraping and saving.
URL to Markdown with Firecrawl (HTTP Request n8n node): Scrapes the content of the full URL. Function: Extracts clean text in Markdown format using the Firecrawl API.
InfraNodus Save to Graph (HTTP Request n8n node): Sends the scraped Markdown content to InfraNodus to incrementally build a knowledge graph based on the combined text of the top-performing pages. Key Configuration: Saves content using the name 'topsupportpages'.
InfraNodus GraphRAG Summary (HTTP Request n8n node): Runs after all content is processed. Function: Queries the combined graph for an AI-generated summary, identifying main topics and content gaps. Key Configuration: requestMode is set to summary and aiTopics is set to true.
Form (n8n node): The final n8n node that displays the analytical results (AI advice and graph summary) to the user in a readable HTML format.

Related n8n Workflows

Free

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

I'm Dmitry, the founder of InfraNodus — an AI text network analysis tool. I'm passionate about networks and data visualization and its ability to reveal what everyone else is missing and to highlight different perspectives. I'm sharing the n8n templates that make use of this unique capability of InfraNodus for multiple scenarios.

Featured*