Google Sheets + OpenAI: publish X vs Y pages fast
Writing “X vs Y” comparison pages sounds easy until you’re on your fifth one of the week, copying the same sections, fixing formatting, and still second-guessing the recommendations.
This Sheets OpenAI automation hits content leads first, but growth marketers and small SaaS founders feel it too. You will turn a simple spreadsheet row into a consistent, publishable draft in one run.
This guide shows what the workflow generates, where the content lands, and how to adapt it to your niche without turning it into a “prompt engineering” project.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: Google Sheets + OpenAI: publish X vs Y pages fast
flowchart LR
subgraph sg0["When clicking ‘Test workflow’ Flow"]
direction LR
n0@{ icon: "mdi:robot", form: "rounded", label: "AI Agent", pos: "b", h: 48 }
n1@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n2@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory", pos: "b", h: 48 }
n3@{ icon: "mdi:database", form: "rounded", label: "Google Sheets6", pos: "b", h: 48 }
n4@{ icon: "mdi:robot", form: "rounded", label: "AI Agent1", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge"]
n6@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model1", pos: "b", h: 48 }
n7@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory1", pos: "b", h: 48 }
n8@{ icon: "mdi:database", form: "rounded", label: "Google Sheets7", pos: "b", h: 48 }
n9@{ icon: "mdi:robot", form: "rounded", label: "AI Agent2", pos: "b", h: 48 }
n10@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model2", pos: "b", h: 48 }
n11@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory2", pos: "b", h: 48 }
n12@{ icon: "mdi:database", form: "rounded", label: "Google Sheets8", pos: "b", h: 48 }
n13@{ icon: "mdi:database", form: "rounded", label: "Features", pos: "b", h: 48 }
n14@{ icon: "mdi:database", form: "rounded", label: "Pricing", pos: "b", h: 48 }
n15@{ icon: "mdi:database", form: "rounded", label: "Products", pos: "b", h: 48 }
n16@{ icon: "mdi:database", form: "rounded", label: "Product Overview", pos: "b", h: 48 }
n17@{ icon: "mdi:database", form: "rounded", label: "User Ratings", pos: "b", h: 48 }
n18@{ icon: "mdi:robot", form: "rounded", label: "User Ratings Maker", pos: "b", h: 48 }
n19@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model3", pos: "b", h: 48 }
n20@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory3", pos: "b", h: 48 }
n21@{ icon: "mdi:database", form: "rounded", label: "Google Sheets", pos: "b", h: 48 }
n22@{ icon: "mdi:robot", form: "rounded", label: "AI Agent3", pos: "b", h: 48 }
n23@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model4", pos: "b", h: 48 }
n24@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory4", pos: "b", h: 48 }
n25@{ icon: "mdi:database", form: "rounded", label: "Google Sheets1", pos: "b", h: 48 }
n26["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Dorik CMS"]
n27["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code"]
n28["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge2"]
n29["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code1"]
n30@{ icon: "mdi:database", form: "rounded", label: "Names and slugs", pos: "b", h: 48 }
n31@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Test workflow’", pos: "b", h: 48 }
n27 --> n26
n29 --> n16
n29 --> n30
n5 --> n4
n28 --> n27
n14 --> n5
n0 --> n3
n13 --> n5
n15 --> n9
n15 --> n22
n15 --> n29
n15 --> n13
n15 --> n14
n15 --> n17
n4 --> n8
n9 --> n12
n22 --> n25
n17 --> n18
n21 --> n28
n2 -.-> n0
n25 --> n28
n3 --> n28
n8 --> n28
n12 --> n28
n7 -.-> n4
n11 -.-> n9
n20 -.-> n18
n24 -.-> n22
n30 --> n28
n16 --> n0
n16 --> n5
n1 -.-> n0
n6 -.-> n4
n10 -.-> n9
n19 -.-> n18
n23 -.-> n22
n18 --> n21
n31 --> n15
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n31 trigger
class n0,n4,n9,n18,n22 ai
class n1,n6,n10,n19,n23 aiModel
class n2,n7,n11,n20,n24 ai
class n3,n8,n12,n13,n14,n15,n16,n17,n21,n25,n30 database
class n26 api
class n27,n29 code
classDef customIcon fill:none,stroke:none
class n5,n26,n27,n28,n29 customIcon
Why This Matters: “X vs Y” Content Is a Grind to Scale
Comparison pages work because they meet buyers at the exact moment they’re trying to decide. The problem is producing them at a steady pace without letting quality slide. Manually, you end up rewriting the same framework (intro, table, use cases, FAQs), while also trying to keep claims accurate and tone consistent. Add one more twist: you’ll often pull details from scattered notes, old docs, or pricing pages, which makes mistakes more likely. The result is slower publishing, more editing cycles, and content that feels inconsistent across the site.
It adds up fast. Here’s where it usually breaks down.
- Writers spend about 2 hours per page just assembling the structure and repeating “standard” sections.
- Tables and FAQs drift over time, so your pages stop feeling like a cohesive library.
- Teams lose momentum because reviews turn into formatting clean-up, not actual editorial feedback.
- Publishing is the bottleneck, especially when each page needs manual copy-paste into a CMS.
What You’ll Build: A Spreadsheet-to-Comparison-Page Generator
This workflow turns a simple input like “Notion vs Evernote” into a full comparison page draft, with the same sections every time. You can trigger it manually or have it run based on rows in Google Sheets, so content production becomes a queue instead of a scramble. In the middle, it pulls your structured source data (features, pricing, ratings, overview notes) from Sheets, merges it, and uses OpenAI to write each section with dedicated prompts. It then appends each generated section back into Google Sheets for review, assembles the sections into HTML, and can send a publish request to your CMS via HTTP. If you need localization, Google Translate is available in the workflow to create localized versions without rebuilding the process.
The workflow starts with a list of product pairs in Google Sheets. AI writes the intro, the feature-by-feature comparison, ratings summary, activation/recommendation section, and an FAQ tailored to buyer concerns. Finally, n8n assembles everything into a clean page draft and pushes it to your publishing destination (or keeps it staged in Sheets until you approve it).
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you want to publish 10 comparison pages this week. Manually, if each page takes about 3 hours between research, drafting, formatting tables, and writing FAQs, that’s roughly 30 hours. With this workflow, you can queue 10 “X vs Y” rows in Google Sheets, spend about 20 minutes per page reviewing the generated sections, then publish in a batch. That’s about 3 hours of review time instead of a full work week of writing.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets for product pairs and source data.
- OpenAI to generate page sections and FAQs.
- OpenAI API key (get it from your OpenAI dashboard)
Skill level: Beginner. You’ll connect accounts, map a few fields, and run a test row end-to-end.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A product pair kicks things off. You run the workflow manually (or configure it to read a new/updated row), and the “X” and “Y” names become the source of truth for everything downstream.
Your comparison data gets gathered. n8n pulls your features, pricing records, overview notes, and rating summaries from Google Sheets, then merges them into one structured payload so the writing prompt stays grounded.
OpenAI writes section-by-section. Separate AI steps generate an intro, the comparison table narrative, a “who should choose what” recommendation section, a ratings summary, and a buyer-focused FAQ. Each section is saved back into Google Sheets so you can review without digging through execution logs.
Publishing becomes optional, not scary. The workflow assembles everything into HTML and can send it to your CMS using an HTTP request. If you prefer a manual checkpoint, keep the draft staged in Sheets and publish only the rows you approve.
You can easily modify Google Sheets inputs to include niche-specific fields (like “security” or “integrations”), then adjust the prompts to use those fields in the final copy. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow manually so you can verify data outputs before publishing comparison pages.
- Add the Manual Run Trigger node as your start point (this workflow already uses it).
- Click Execute Workflow later during testing to trigger Retrieve Product List.
Step 2: Connect Google Sheets Data Sources
This workflow pulls product, overview, features, pricing, and ratings data from multiple sheets and appends generated content back to sheets.
- Open Retrieve Product List and set the Document ID to
[YOUR_ID]and the Sheet Name to[[DATA]] Products. - Open Load Overview Records and set the Sheet Name to
[[DATA]] Product Overview. - Open Fetch Feature Records and set the Sheet Name to
[[DATA]] Features Data. - Open Retrieve Pricing Records and set the Sheet Name to
[[DATA]] Product Pricing. - Open Fetch Rating Summary and set the Sheet Name to
[[DATA]] Product User Reviews. - For all Google Sheets nodes that append content (Append Intro Sheet, Append Comparison Sheet, Append Activation Sheet, Append Ratings Sheet, Append FAQ Sheet, Store Names Slugs), verify the Operation is
appendand the target sheet isTest data 1or the correct destination in your document.
Credential Required: Connect your googleSheetsOAuth2Api credentials to Retrieve Product List, Load Overview Records, Fetch Feature Records, Retrieve Pricing Records, Fetch Rating Summary, Append Intro Sheet, Append Comparison Sheet, Append Activation Sheet, Append Ratings Sheet, Append FAQ Sheet, and Store Names Slugs.
Step 3: Generate Pair Slugs and Parallel Data Fetching
The workflow builds comparison pairs and immediately fans out to collect overview and storage data in parallel.
- In Generate Pair Slugs, keep the JavaScript that creates product pairs and slugs from
All Products(this powers page titles and URLs). - Retrieve Product List outputs to Activation Copywriter, FAQ Copywriter, Generate Pair Slugs, Fetch Feature Records, Retrieve Pricing Records, and Fetch Rating Summary in parallel.
- Generate Pair Slugs outputs to both Load Overview Records and Store Names Slugs in parallel.
- Verify Store Names Slugs maps slug to
{{$json.slug}}and Product Vs. Dynamic to{{$json.name}}.
All Products has blanks, Generate Pair Slugs will create empty pairs. Clean your product list before running the workflow.Step 4: Set Up Intro and Comparison Table Generation
Intro text and comparison tables are generated by AI using overview, feature, and pricing data.
- Connect Intro Chat Model (model
gpt-4o-mini) to Intro Copywriter as the language model. - Ensure Intro Memory Buffer uses Session Key
=intro-{{ $json.Provider }}to keep context per provider. - In Intro Copywriter, keep the prompt expression
{{$json.Overview}}and reference to{{$('Generate Pair Slugs').item.json.name}}. - Connect Comparison Chat Model to Comparison Table Writer and keep the prompt pulling
{{$json.Features}}and{{$json.Pricing}}with the page title from{{$('Generate Pair Slugs').item.json.name}}. - Verify Combine Source Data is set to Mode
combineand Number Inputs3to combine overview, features, and pricing.
Credential Required: Connect your openAiApi credentials to Intro Chat Model and Comparison Chat Model.
Step 5: Build Activation, Ratings, and FAQ Sections
Three AI branches generate activation guidance, user rating tables, and FAQs in parallel from product data and reviews.
- Retrieve Product List outputs to Activation Copywriter and FAQ Copywriter in parallel.
- Ensure Activation Copywriter uses
{{$json['Product Vs. Dynamic']}}and writes only activation text. - Connect Activation Chat Model (model
gpt-4.1) and keep Activation Memory Buffer Session Key. - Fetch Rating Summary runs in parallel and feeds Ratings Table Builder, which uses
{{$json['User Rating Summary']}}. - Connect Ratings Chat Model and keep Ratings Memory Buffer Session Key
. - Ensure FAQ Copywriter keeps the prompt with
{{$json['Product Vs. Dynamic']}}and the Truely bias note. - Connect FAQ Chat Model and keep FAQ Memory Buffer Session Key
.
Credential Required: Connect your openAiApi credentials to Activation Chat Model, Ratings Chat Model, and FAQ Chat Model.
Step 6: Append Generated Sections to Sheets and Aggregate
Each AI output is appended to a central sheet and merged into a single record for HTML assembly.
- Confirm Append Intro Sheet maps Intro to
{{$json.output}}. - Confirm Append Comparison Sheet maps Comparison Table to
{{$json.output}}. - Confirm Append Activation Sheet maps eSIM Activation to
{{$json.output}}. - Confirm Append Ratings Sheet maps User Ratings to
{{$json.output}}. - Confirm Append FAQ Sheet writes the FAQ content (note: field mapping currently uses User Ratings; update if you want a dedicated FAQs column).
- Verify Aggregate Sections is set to Mode
combinewith Number Inputs6so all sections and slug data are merged.
Step 7: Assemble HTML and Publish to CMS
The final HTML content is built and sent to your CMS via an authenticated HTTP request.
- In Assemble HTML, keep the JavaScript that creates
name,slug, andhtmlContentand safely inserts section content from fields likeIntroandComparison Table. - In CMS Publish Request, set the URL to
https://api.cmsfly.com/api/v1/collections/6855985e93afef001268bfbb/items. - Confirm the body parameters map name to
{{$json.name}}, slug to{{$json.slug}}, and htmlContent to{{$json.htmlContent}}. - Set the header parameter X-Dorik-Key to your API key value (replace
[CONFIGURE_YOUR_API_KEY]).
Credential Required: Connect your httpHeaderAuth credentials to CMS Publish Request.
Step 8: Test and Activate Your Workflow
Run a full test to verify data retrieval, AI output, sheet updates, and CMS publishing before turning it on in production.
- Click Execute Workflow on Manual Run Trigger and watch the parallel branches from Retrieve Product List complete.
- Verify that each append node creates a new row with AI outputs in the target sheet.
- Confirm Assemble HTML outputs a JSON object containing
name,slug, andhtmlContent. - Check CMS Publish Request for a successful 200/201 response and verify the page appears in your CMS.
- When satisfied, switch the workflow Active toggle on to use it for production runs.
Troubleshooting Tips
- Google Sheets credentials can expire or need specific permissions. If things break, check the connected Google account and sheet sharing settings in n8n credentials first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Quick Answers
About 15 minutes if your Google Sheets and OpenAI accounts are ready.
No. You’ll connect accounts and map fields from Google Sheets into the workflow.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs, which are usually a few cents per page depending on how long your sections are.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you probably should. Most teams start by changing the prompts in the Intro Copywriter, Comparison Table Writer, and FAQ Copywriter steps to match their tone and SEO angles. You can also add extra columns in Google Sheets (like “target persona” or “industry”) and pass them into those prompts so each page feels less generic. If you publish to a different CMS, swap the CMS Publish Request step to hit your own endpoint, then keep the rest of the workflow the same.
Usually it’s permissions. Confirm the Google account in n8n still has access to the exact spreadsheet, and that the sheet tabs referenced in the workflow haven’t been renamed. If you recently tightened Google Workspace security, you may need to re-authenticate the credential. It’s also worth checking if you hit Google API quotas when you try to generate big batches at once.
On n8n Cloud you can comfortably run dozens of pages in a batch; the practical limit is your monthly executions and how hard you push the OpenAI and Google Sheets APIs.
Often, yes. This workflow isn’t just “send prompt, get text”; it pulls multiple datasets from Sheets, merges them, runs several AI generations, then assembles HTML and optionally publishes via HTTP. n8n handles that kind of branching and multi-step assembly cleanly, and you can self-host if you don’t want to pay per task. Zapier and Make can still do it, but the scenario gets long quickly, and maintenance becomes its own job. If you’re deciding based on budget, volume, or how custom your CMS publishing is, Talk to an automation expert and we’ll help you pick the simplest option.
Once this is in place, your comparison pages stop being a writing marathon and turn into a repeatable publishing system. Set it up, review the drafts, and move on to the work that actually grows the business.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.