Multi-Agent SEO Content Creation System with RAG and Hyperlinking - n8n Workflow

Use this powerful n8n workflow to automate high-quality, long-form SEO blog content creation. It features multi-stage AI agents for research, writing, hyperlinking, and final editing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

• SEO managers and content teams needing high-volume, quality content production.
• E-commerce businesses (like the example 'The Bucket Hat') requiring articles with internal product links.
• Automation experts looking for advanced, multi-agent n8n templates for content generation.
• Users who need to integrate AI agents with external databases (Airtable) and publishing tools (Google Docs).

Overview

Generating high-quality, long-form SEO content requires detailed planning, competitor research, keyword analysis, and precise structuring. This advanced n8n workflow replaces manual content strategizing with a series of specialized AI agents. It uses an n8n trigger linked to Airtable to initiate the process, performs real-time SERP analysis via Tavily, determines optimal writing style and tone, refines the article title, and generates the full article (Introduction, Key Takeaways, Main Body, Conclusion) in structured HTML format. Crucially, it fetches and filters internal website URLs to automatically insert relevant product and collection hyperlinks, ensuring excellent internal SEO and conversion opportunities. The resulting article is saved to a Google Doc, ready for final human review, making this one of the most comprehensive n8n templates for content marketing.

How it Works

This n8n workflow is initiated by an n8n trigger (a Webhook) receiving a signal from Airtable when an article status changes.


  1. Data Initialization (Airtable & URLs): The workflow fetches the initial article keyword, title, and description from Airtable. Concurrently, it scrapes the site's sitemap via an HTTP Request n8n node, parses the XML, and consolidates all internal links.

  2. Internal Link Filtering: An AI agent (URLs Selection) uses the article's topic to filter the site's entire link inventory, selecting only the 8 to 13 most relevant product and collection URLs for hyperlinking.

  3. Content Strategy & Research (RAG): The main strategy agent (SERPs, Writing, KWs, Insights) uses the Anthropic Chat Model and the Tavily search tool (RAG) to perform real-time competitor analysis. It outputs a comprehensive JSON containing search intent, target audience, writing style, semantic subtopics, and crucial 'hidden insights'.

  4. Refinement and Planning: The initial working title is refined by the Refine the Title agent to be SEO-optimized. Subsequently, dedicated agents create HTML Key Takeaways and an engaging HTML Introduction.

  5. Outline Generation: The Outline Agent uses all accumulated strategic data (keywords, hidden insights, tone, takeaways) to construct a detailed, long-form outline.

  6. Prompt Engineering and Writing: A Main Body Prompt Writer agent generates a hyper-specific instruction prompt for the Content Writer Agent. The writer then produces the long-form main body content (1800-2400 words) in clean HTML, automatically inserting internal hyperlinks based on the filtered URL list. A separate agent writes the Conclusion.

  7. Assembly and Final Polish: All sections are assembled. A powerful Final Edit Agent performs a comprehensive quality check, expands sections, strengthens transitions, and ensures the final word count meets the 2900–3500 word requirement, resulting in a 9.5+/10 article quality.

  8. Publishing: The final output is written to a new Google Doc, complete with an AI-generated Meta Description and Image Prompt. The Google Doc URL is then updated back in Airtable.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance using the 'New' button and selecting 'Import workflow from JSON'.

  2. Airtable Setup: Copy the referenced 'KW Research Content Ideation' Airtable base (link provided in the sticky note within the workflow). Configure the initial Webhook n8n trigger and the Airtable Get Article Data n8n node with your Airtable API Token and Base/Table IDs.

  3. API Credentials: You must configure credentials for:

OpenAI/Anthropic: For the numerous AI agents (LLM operations).
Tavily Search API: For the real-time SERP research used by the strategy agent.
* Google Drive & Google Docs: For creating the final folder and document.

  1. Sitemap Configuration: Verify that the URL in the first HTTP Request n8n node (currently https://thebuckethat.nl/sitemap.xml) points to your website's primary sitemap.

  2. Activation: Once all credentials and configurations are set, activate the n8n workflow. The automation will run whenever your external system triggers the provided Webhook URL.

Node Details

This n8n workflow utilizes several specialized nodes:

Webhook (n8n trigger): The starting point, configured to listen for a POST request, typically from an Airtable automation, passing the record ID to start content generation.
Airtable (n8n node): Used multiple times to fetch initial keywords/titles and to update the record with generated strategic data (Search Intent, Tone, Keywords) and the final Google Doc URL.
HTTP Request & XML (n8n node): Used to fetch the website's sitemap. The XML n8n node parses the sitemap structure to extract all internal URLs, which is essential for internal hyperlinking.
Tavily search results (LangChain Tool): Provides real-time, external search results (RAG) to the strategic AI agent, ensuring the generated content is based on current SERP data.
SERPs, Writing, KWs, Insights (LangChain Agent): This critical AI agent uses the Anthropic model and Tavily to generate the core content strategy (intent, style, hidden insights, semantic analysis) that drives the rest of the n8n workflow.
Refine the Title (LangChain Agent): An AI agent using the strategic inputs to create a high-converting, SEO-optimized title.
Outline Agent, Introduction Agent, Key Takeaways AI Agent, Content Writer Agent (LangChain Agents): A sequence of specialized AI agents, mostly powered by OpenAI's gpt-4o, responsible for constructing the separate HTML components of the final long-form article.
Content Writer Agent: This agent is strictly configured to produce content in clean HTML, incorporate primary and secondary keywords, and include required internal hyperlinks from the filtered URL list.
Final Edit Agent: A powerful editing agent that refines structure, expands sections, and smooths transitions to ensure the 2900–3500 word count and high quality standard are met.
Google Drive / Google Docs (n8n nodes): These nodes handle the final output, creating a dedicated folder, creating the article document, inserting the content, and generating a shareable link.

Related n8n Workflows

Free

Nodes: 16 Nodes
Updated: December 26 2025
View all
Created by
Gloria
Gloria

Featured*