Automated SEO Content Generation for Website Sitemaps - n8n Workflow

Use this comprehensive n8n workflow to automatically scrape website sitemaps, extract page content, and generate bulk SEO titles, meta descriptions, and FAQs using OpenAI, storing results in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • SEO specialists needing to quickly generate meta tags and FAQs for large websites.

  • Content agencies looking for scalable, automated content optimization solutions.

  • Webmasters who need a repeatable n8n trigger for daily or weekly SEO tasks.

  • Users looking for advanced n8n templates integrating scraping and AI services.

Overview

Generating high-quality, unique SEO data (like meta descriptions and FAQ content) for hundreds or thousands of pages can be a massive undertaking. This n8n workflow solves this by fully automating the process. It acts as an efficient SEO assistant, starting by fetching a site's sitemap.xml, iterating through every URL, scraping the page content, and passing that content to an OpenAI model. The output—the new titles, descriptions, and structured FAQs—is then seamlessly logged into Google Sheets for review and implementation. This complex automation showcases the powerful potential of a well-designed n8n node sequence for crucial marketing operations.

How it Works

This comprehensive n8n workflow begins with one of two possible starting points: the MANUAL n8n trigger for immediate execution, or the Schedule Trigger for recurring, automated runs.


  1. Initialization: The flow first executes UA Rotativo (Code) to prepare rotating User Agents and sets key configuration variables via the OPTIONS n8n node.

  2. Sitemap Acquisition: The Maping Sitemap2 HTTP Request n8n node attempts to fetch the target website’s sitemap XML. If this fails, the flow errors out.

  3. URL Extraction: The fetched XML is parsed by the XML n8n node, and the resulting list of URLs is broken down by Split Out1. The Limit n8n node controls the maximum number of URLs processed per run, which is crucial for managing budget and scope.

  4. Scraping Loop: The Loop page n8n node initiates a batch loop over the limited URLs. Inside the loop, the HTTP Req page n8n node scrapes the content of the individual page. If scraping succeeds, the content is cleaned and optimized by the Clear Code n8n node.

  5. AI Content Generation: The core processing happens in the meta descr and title gen OpenAI n8n node. This specialized n8n node takes the cleaned page content and generates the desired SEO outputs (meta descriptions, titles, and FAQs) using a powerful language model.

  6. Data Structuring: Once generation is complete, the structured AI results are processed by the FAQ Results Code n8n node, formatting the output into clean rows.

  7. Database Insertion: The Add items DB splits the results into batches for efficient insertion into Google Sheets using the Append row in db Google Sheets n8n node.

  8. Notification: Finally, a summary email is generated using the Text email OpenAI n8n node and sent via the Send a message Gmail n8n node, confirming the successful completion of the n8n workflow.

Installation Guide

To deploy this powerful automation using these n8n templates, follow these steps:


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

  2. Google Sheets Credentials: Locate the 'Append row in db' Google Sheets n8n node. You must set up a Google Sheets credential and specify the Spreadsheet ID and Sheet Name where the SEO results will be logged.

  3. OpenAI Credentials: Configure the meta descr and title gen and Text email n8n nodes with your OpenAI (or compatible service) credentials. Ensure the connection is valid for API calls.

  4. Gmail Credentials: Set up the required Gmail credential for the 'Send a message' n8n node to ensure email notifications function correctly.

  5. Configuration Node: Edit the OPTIONS n8n node (Set node) and the UA Rotativo (Code node) to input your target website's sitemap URL, desired limits, and any specific proxy or user agent requirements.

  6. Test Run: Run the n8n workflow manually using the MANUAL n8n trigger to verify all credentials and configurations are working before enabling the scheduled execution.

Node Details

Schedule Trigger / MANUAL: These are the initial n8n trigger nodes that start the flow, allowing for scheduled or instant execution of this n8n workflow.
OPTIONS (Set n8n node): Stores critical user-defined variables, such as the target sitemap URL, API keys (if needed outside of credentials), and other global parameters used throughout the n8n workflow.
Maping Sitemap2 (HTTP Request n8n node): Essential for the web scraping part of this n8n workflow. It fetches the sitemap XML file using dynamic user agents set by the preceding Code n8n node.
XML (n8n node): Parses the raw XML data obtained from the sitemap request, transforming the URL list into a usable JSON array for the subsequent nodes.
Limit (n8n node): Controls the number of URLs passed to the generation loop, preventing accidental overspending on API calls or overwhelming the system during testing. A key control element of this n8n template.
HTTP Req page (HTTP Request n8n node): Scrapes the actual content of each individual page URL identified in the sitemap. This content forms the basis for the AI generation.
meta descr and title gen (OpenAI LangChain n8n node): The core AI processing n8n node. It accepts the scraped page text and uses sophisticated prompts to generate high-quality, structured SEO data (titles, meta descriptions, FAQs).
FAQ Results (Code n8n node): Post-processes and structures the raw output from the AI, ensuring the data is correctly mapped to column headers needed for Google Sheets.
Append row in db (Google Sheets n8n node): The final storage location. This n8n node connects to Google Sheets to efficiently insert the newly generated SEO data rows into a designated spreadsheet.
Send a message (Gmail n8n node): Provides an essential notification service, sending an email confirmation that the n8n workflow has finished running and summarizing the outcome.

Related n8n Workflows

Paid

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by
Oriol Seguí
Oriol Seguí

Completion of a higher degree on the way to university (computer engineering)

Featured*