Dynamic Product Comparison Page Generator - n8n Workflow

Automate the creation of SEO-optimized product comparison ("vs") pages using this advanced n8n workflow. Combines Google Sheets data, OpenAI content generation, and direct CMS publishing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

This n8n workflow template is ideal for:
Programmatic SEO (pSEO) specialists looking to scale content production.
Marketing teams who need to generate hundreds of comparison pages rapidly.
Content engineers seeking an efficient way to integrate structured data (Google Sheets) with large language models (OpenAI).
Developers who want to leverage the power of n8n to automate complex, parallel content generation tasks.

Overview

Generating effective product comparison pages (like "Product A vs Product B") is crucial for mid-to-bottom-of-funnel SEO, but manual creation is slow and costly. This powerful n8n workflow solves this by fully automating the process.

It takes a simple list of products from a Google Sheet, uses a custom n8n node (the Code node) to generate every possible pairing, and then orchestrates five parallel AI processes using OpenAI/LangChain to write high-quality, section-specific content (Intro, Comparison Table, FAQs, etc.). The final output is assembled into clean HTML and published directly to a headless CMS (like Dorik) via an HTTP Request. This robust n8n workflow drastically reduces time-to-market for programmatic content campaigns.

How it Works

This complex n8n workflow operates in five main phases:


  1. Trigger and Pairing: The process starts with a manual n8n trigger. It fetches a master list of products from the [[DATA]] Products Google Sheet. A subsequent Code n8n node automatically generates all unique “A vs B” product pairings, creating corresponding page names and slugs programmatically.

  2. Data Extraction: The workflow then fetches detailed, structured data (Overview, Features, Pricing, User Ratings) for all products from various supporting Google Sheets tabs.

  3. Parallel AI Generation: For each generated comparison pair, the n8n workflow initiates five concurrent branches. Each branch utilizes an AI Agent and OpenAI Chat Model n8n node (using GPT-4o-mini or GPT-4.1) to generate a specific content section (e.g., Intro, Comparison Table, eSIM Activation, User Ratings, FAQs). Simple Memory n8n nodes are used to maintain context if necessary, though the primary context is passed via the detailed prompts.

  4. Assembly and Persistence: The generated AI content is written back to a central master Google Sheet using several dedicated Google Sheets n8n nodes, updating the comparison row with the generated text.

  5. Final Publishing: After all content is generated and persisted, a final Merge n8n node gathers all the data streams. A final Code n8n node transforms the collected JSON data into a single, structured HTML payload. This HTML is then sent via an HTTP Request n8n node (targeting the Dorik CMS API) for automatic publishing, creating a live comparison page instantly.

Installation Guide

To set up and utilize this programmatic content generation n8n template:


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

  2. Google Sheets Credentials: You will require two sets of Google Sheets credentials. One set is used for reading the raw product data, and the second is used for writing the finalized AI content back to the master sheet. Update all Google Sheets n8n node credentials accordingly (gPEEiziU0kLV5lvj and Nos9qO5bcL3vdPcg placeholders).

  3. OpenAI Credentials: Configure your OpenAI API Key credentials for the OpenAI Chat Model n8n nodes. This workflow uses several models (like gpt-4o-mini).

  4. CMS Credentials (Dorik/HTTP Request): Update the Dorik CMS n8n node. You will need to change the API URL and configure the X-Dorik-Key within the HTTP Header Auth credentials to connect to your specific content collection.

  5. Initial Data Setup: Ensure your source Google Sheets are populated with the required data structure as indicated in the workflow notes (Products list, Features, Pricing, etc.).

  6. Run: Execute the n8n workflow using the 'Test Workflow' button or by setting up a Schedule trigger if desired.

Node Details

This n8n workflow relies heavily on data manipulation and AI interaction:

When clicking ‘Test workflow’ (n8n trigger): This manual trigger initiates the entire programmatic process.
Products (Google Sheets n8n node): Reads the master list of product names. It acts as the starting dataset for the pairing logic.
Code1 (Code n8n node): Essential for Programmatic SEO. It takes the list of products and dynamically generates all unique 'vs' comparison pairs (e.g., ProductA vs ProductB), assigning a unique name and SEO slug to each pair.
Product Overview, Features, Pricing, User Ratings (Google Sheets n8n nodes): These nodes fetch the necessary structured product data from various tabs to serve as context for the AI generation steps.
AI Agent / OpenAI Chat Model n8n nodes (Multiple Instances): These are the core generative nodes. They utilize the LangChain interface within n8n to send highly structured prompts (e.g., AI Agent for the Intro, AI Agent1 for the Comparison Table) to specialized models like gpt-4o-mini, ensuring the output is optimized for specific comparison sections.
Simple Memory n8n nodes: Used in conjunction with the AI agents, providing contextual memory for the current item being processed in the n8n workflow.
Google Sheets n8n nodes (e.g., Google Sheets6, 7, 8): These nodes write the finalized, AI-generated content (Intro, Comparison Table, Activation Guide) back into the main output Google Sheet.
Merge2 (Merge n8n node): Collects the output items from all previous parallel execution branches, ensuring all generated content is available on a single item stream.
Code (Code n8n node): The final transformation step. It takes the individual generated fields and constructs a complete HTML page structure ready for CMS insertion.
Dorik CMS (HTTP Request n8n node): Publishes the final HTML content to the Dorik CMS API endpoint. This demonstrates how this n8n template integrates directly into a production publishing pipeline.

Related n8n Workflows

Free

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

I love marketing automations

Featured*