SerpAPI + Google Docs: MECE outlines from Google
You search a keyword, open ten tabs, skim, copy headings into a doc, then realize half your notes are redundant. It’s slow. And honestly, it’s the kind of “busy” work that quietly wrecks publishing momentum.
This SerpAPI outline automation hits SEO specialists first, but content leads and small agency owners feel it too. You get a MECE outline (no overlap, no missing sections) from real top-ranking pages, so writers start with structure instead of a blank doc.
Below you’ll see how the workflow turns one keyword into a writer-ready outline, what it replaces in your current process, and how to adapt it to your briefs.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: SerpAPI + Google Docs: MECE outlines from Google
flowchart LR
subgraph sg0["Form Input Flow"]
direction LR
n0@{ icon: "mdi:robot", form: "rounded", label: "Generate Outline Draft", pos: "b", h: 48 }
n1["<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/>Fetch Search Results"]
n2@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split URL List", pos: "b", h: 48 }
n3["<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/markdown.dark.svg' width='40' height='40' /></div><br/>Convert to Markdown"]
n4["<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/>Retrieve Page HTML"]
n5@{ icon: "mdi:cog", form: "rounded", label: "Limit Articles", pos: "b", h: 48 }
n6["<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/form.svg' width='40' height='40' /></div><br/>Form Input Trigger"]
n7@{ icon: "mdi:swap-vertical", form: "rounded", label: "Parse Result Links", pos: "b", h: 48 }
n8["<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/html.dark.svg' width='40' height='40' /></div><br/>Extract Body HTML"]
n9@{ icon: "mdi:cog", form: "rounded", label: "Aggregate Articles", pos: "b", h: 48 }
n10@{ icon: "mdi:cog", form: "rounded", label: "Next Step Placeholder", pos: "b", h: 48 }
n5 --> n8
n3 --> n9
n0 --> n10
n4 --> n5
n2 --> n4
n1 --> n7
n6 --> n1
n8 --> n3
n7 --> n2
n9 --> n0
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 n6 trigger
class n0 ai
class n1,n4 api
classDef customIcon fill:none,stroke:none
class n1,n3,n4,n6,n8 customIcon
The Problem: SERP research turns into messy, unscalable notes
Building a solid outline from Google results sounds simple until you do it every week. You have to find the right pages, open them, dodge cookie popups, scroll past “fluff,” and then translate what you’re seeing into a clean structure. Most outlines end up as a pile of headings and half-quotes with no clear hierarchy. Then you pay for it later: writers ask basic questions, editors reshape the whole doc, and you still wonder if you missed a core subtopic that every top result covers.
It adds up fast. Here’s where it usually breaks down.
- Manual SERP review eats about 1–2 hours per keyword once you include reading, note-taking, and cleanup.
- When you copy headings from different articles, you get duplicates and contradictions, which makes briefs harder to write and follow.
- A single scrape failure or paywalled page can derail the whole session because you don’t have a fallback plan.
- Outlines become “opinion-based” instead of evidence-based, so internal stakeholders push back and revisions drag on.
The Solution: Turn one keyword into a MECE outline from top Google pages
This workflow starts with a keyword you submit through a simple form trigger. n8n sends that keyword to SerpAPI to pull the top Google results for a chosen country, then it collects the first five URLs (five on purpose, because a couple will fail to scrape in the real world). Each page is fetched, the main body HTML is extracted, and the content is converted into Markdown to strip out the junk like tags, menus, and styling. To keep outputs reliable, the workflow limits analysis to the first three successfully scraped articles so everything fits into the AI model’s context window. Then an OpenAI-powered agent analyzes recurring topics and headings and generates an SEO-focused MECE outline you can hand straight to a writer.
The workflow kicks off with a keyword and ends with an outline that reflects what Google is already rewarding. In the middle, it does the tedious parts: SERP collection, page scraping, cleaning, and consolidation. Finally, AI turns the “raw truth” of those pages into a structured outline you can reuse and refine.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you create 4 SEO briefs a week. Manually, you might review 5 ranking pages per keyword and spend maybe 15 minutes per page reading and extracting headings, plus another 30 minutes cleaning the outline. That’s about 6 hours a week. With this workflow, you submit the keyword in under a minute, then let scraping and AI processing run in the background (often around 10–20 minutes total). You still review and tweak, but you’re starting from structure instead of chaos.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- SerpAPI for Google results by country.
- OpenAI to analyze pages and draft outlines.
- OpenAI API key (get it from your OpenAI dashboard).
Skill level: Beginner. You’ll paste in API keys, set a country, and run a test keyword.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Keyword submission triggers the run. You enter a keyword in the built-in form trigger, which gives you a consistent way to start the process without editing the workflow.
Google results are collected automatically. n8n calls SerpAPI using an HTTP request, then parses the response to pull the top result links for your selected country.
Ranking pages are scraped and cleaned. The workflow splits the URL list, fetches each page’s HTML, extracts the main body, then converts it to Markdown so the text is usable for analysis.
AI turns the evidence into structure. The cleaned articles are aggregated (and limited to fit the context window), then an OpenAI chat model generates a MECE outline based on the most common topics and headings.
You can easily modify the country and the number of URLs to match your market and risk tolerance. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Set up the form that collects the keyword input used to fetch search results.
- Add the Form Input Trigger node to your workflow.
- Set Form Title to
SEO optimized outline generator. - Set Form Description to
This workflow generates an SEO optimized outline based on what's already ranking. - In Form Fields, add a required field labeled
Keywordwith placeholderYour keyword here.
Step 2: Connect SERP API Search
Configure the search request and extract the top URLs for scraping.
- Add the Fetch Search Results node and connect it to Form Input Trigger.
- Credential Required: Connect your serpApi credentials.
- Set URL to
https://serpapi.com/search. - Enable Send Query and set query parameter q to
{{ $json.Keyword }} -inurl:reddit.com -inurl:quora.com. - Set query parameter location to
United States. - Add the Parse Result Links node and set JSON Output to
{ "Keyword": "{{ $('Form Input Trigger').item.json.Keyword }}", "URLs": [ "{{ $json.organic_results[0].link }}", "{{ $json.organic_results[1].link }}", "{{ $json.organic_results[2].link }}", "{{ $json.organic_results[3].link }}", "{{ $json.organic_results[4].link }}" ] }.
⚠️ Common Pitfall: If SERP API returns fewer than five results, the URL list can include empty values. Consider adjusting the search query or adding validation if needed.
Step 3: Scrape and Prepare Article Content
Split the URL list, fetch each page, extract body HTML, and convert it to Markdown.
- Add Split URL List and set Field to Split Out to
URLs. - Add Retrieve Page HTML and set URL to
{{ $json.URLs }}. - In Retrieve Page HTML, enable Send Headers and set headers: User-Agent to
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/0.0.0.0 Safari/537.36, Accept totext/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8, Accept-Encoding togzip, deflate, br, and Accept-Language toen-US,en;q=0.5. - Add Limit Articles and set Max Items to
3. - Add Extract Body HTML with Operation set to
extractHtmlContent, and extract keyhtmlusing CSS selectorbodywith Skip Selectorsimg, meta, a. - Add Convert to Markdown and set HTML to
{{ $json.html }}and Destination Key tomarkdown.
⚠️ Common Pitfall: Some websites block scraping. If you see empty HTML, try adjusting headers or choosing different URLs.
Step 4: Aggregate and Generate the Outline
Aggregate the scraped articles and send them to the AI model to generate the SEO outline.
- Add Aggregate Articles and set Fields to Aggregate to include
markdown. - Add Generate Outline Draft and connect it to Aggregate Articles.
- Credential Required: Connect your openAiApi credentials to Generate Outline Draft.
- Set the Model to
gpt-4oand Temperature to0.7. - In Messages, keep the content that references
{{ $('Parse Result Links').item.json.Keyword }}and the three markdown article blocks to ensure the outline is built from the scraped sources. - Connect Generate Outline Draft to Next Step Placeholder for future expansion.
Step 5: Test and Activate Your Workflow
Validate the end-to-end flow and enable it for production use.
- Click Execute Workflow and submit a test keyword in Form Input Trigger.
- Verify that Fetch Search Results returns SERP data and Parse Result Links outputs a populated
URLsarray. - Confirm that Convert to Markdown outputs
markdowncontent for three articles and Aggregate Articles collects them into an array. - Check Generate Outline Draft for a structured outline response.
- Once successful, toggle the workflow to Active to run it for real submissions.
Common Gotchas
- SerpAPI credentials can expire or run out of quota. If results suddenly come back empty, check your SerpAPI dashboard usage and the API key saved in n8n 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.
Frequently Asked Questions
About 30 minutes if you already have API keys.
No. You’ll connect SerpAPI and OpenAI, then adjust a few fields like country and result count.
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 outline depending on length.
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 it’s a common tweak. Change the country parameter in the “Fetch Search Results” HTTP request, then adjust how many URLs you keep in “Parse Result Links” and “Limit Articles.” People also customize the “Generate Outline Draft” prompt to enforce a house style (H2/H3 rules, word counts, required sections). If you want the outline to go straight into a doc, you can replace the “Next Step Placeholder” node with a Google Docs step.
Most of the time it’s an invalid API key or you’ve hit the free-tier quota. Check the SerpAPI dashboard for usage, then confirm the key in n8n matches what SerpAPI shows. If the request works but links look odd, it can also be the selected country or search parameters returning a different SERP layout than you expect.
On n8n Cloud, it depends on your monthly execution limit, and on self-hosting it’s mostly your server capacity. Practically, most teams run dozens of keywords a week without issues as long as SerpAPI quota and OpenAI costs are planned.
Often, yes. This workflow needs branching, looping through multiple URLs, cleaning HTML, and then aggregating results before sending anything to the AI model, and n8n is simply more comfortable doing that without turning into a fragile chain of zaps. You also get the option to self-host, which can matter when you’re doing lots of runs. Zapier and Make can still work if you keep it simpler (for example, only analyzing one page), but you’ll usually pay more as volume grows. If you’re unsure what’s “simple” in your case, Talk to an automation expert and get a quick recommendation.
Once this is running, your “outline day” stops being a deep work killer. The workflow does the collecting and cleaning so you can focus on what actually moves rankings: better angles, better briefs, better writing.
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.