An AEO content gap analyzer built with n8n finds the buyer questions where AI assistants give a confident answer but never mention or cite you, then tells you what to write to fix it. Tracking your AI visibility shows you where you stand; this workflow turns the misses into a plan. Each week it asks a grounded AI your buyer questions, isolates the ones where you are absent while competitors are cited, and drafts a short content brief for each gap so you have a working title and an angle. It logs the whole backlog to Google Sheets and emails you the week’s opportunities. The build takes about 45 minutes, or a couple of minutes with the template at the end.
What it does
Each week the workflow sends a set of neutral buyer questions to Google Gemini with search grounding, so every answer comes back with the live web sources it used. For each question it checks two things: does the answer mention your brand, and do the cited sources include your domain. When the answer is no on both, that question is a gap, a topic where the AI has decided someone else is the authority.
For every gap, the workflow makes a second AI call that reads the question and the sources currently winning it, then writes a short content brief: a suggested article title and four points to cover. Each gap becomes a row in a Google Sheets backlog with the question, who is cited now, the suggested title, and the full brief. At the end you get one email listing the week’s content opportunities, ranked and ready to hand to a writer.
This is the action layer of AEO, answer engine optimization. It closes the loop opened by the rest of the set: the brand-mention tracker, the competitor visibility monitor, and the AI citation monitor tell you where you stand; this one tells you what to do about it. New to n8n? Start with how to set up n8n.
Why it beats the default
The default content plan is a guess. You brainstorm topics, write what feels important, and hope AI answers and search pick them up. You have no signal about which questions you are actually losing, and no idea who is beating you on them. Checking by hand means opening an assistant, asking a question, noticing you are missing, and forgetting about it by the next meeting.
This workflow replaces the guess with evidence. It only surfaces questions where you are genuinely absent, shows the sources that own them today, and hands you a brief so there is no blank page. Paid AEO platforms offer gap reports, but they cost a monthly subscription and rarely draft the fix for you. This runs on your prompts, writes to a sheet you own, and costs pennies a week. For more AI workflows you can import, see the best n8n AI agent templates and the full template library.
What you need
- An n8n instance (Cloud or self-hosted, version 1.0 or newer).
- A Google Gemini API key with grounding available (free tier includes a daily grounding allowance). Used as an HTTP Header Auth credential with header
x-goog-api-key. - A Google account for Sheets and a Gmail account for the report.
- A blank Google Sheet with a header row matching the field names below (or a Notion database if you prefer, see the tip).
- Your brand name, your domain, and a list of buyer questions.
Time: about 45 minutes from scratch, or under 5 minutes with the template.
Node-by-node list
Nine nodes: a schedule, a config node, a grounded AI call, a gap filter, a brief-writing AI call, a formatter, and a fork that logs and emails.
Weekly schedule (Mon 7am)
|
Prompts & config (Code)
|
Ask Gemini (grounded) (HTTP: answer + sources)
|
Find gaps (Code: keep only questions you are absent from)
|
Draft content brief (HTTP: AI writes a brief per gap)
|
Format brief (Code: build the backlog row)
| |
Log to Sheets Build digest
|
Send digest email (Gmail)
- Weekly schedule (
Schedule Trigger) fires every Monday at 7am. - Prompts & config (
Code) holds your brand, domain, and buyer questions. - Ask Gemini (grounded) (
HTTP Request) answers each question with sources. - Find gaps (
Code) keeps only the questions where you are absent. - Draft content brief (
HTTP Request) asks the AI to write a brief for each gap. - Format brief (
Code) turns each brief into a clean backlog row. - Log backlog to Sheets (
Google Sheets) appends the gaps. - Build digest (
Code) rolls the gaps into one report. - Send digest email (
Gmail) emails you the opportunities.
Step-by-step build
1. Add the weekly schedule
Add a Schedule Trigger, interval Weeks, every 1 week, day Monday, hour 7. A weekly cadence gives you a steady trickle of gaps to work through rather than an overwhelming list.
2. Set your brand, domain, and prompts
Add a Code node. It emits one item per question and carries your brand and domain so the gap filter can check both.
const BRAND = 'Acme Analytics';
const DOMAIN = 'acmeanalytics.com';
const PROMPTS = [
'What are the best analytics tools for a small ecommerce store?',
'How do I track marketing ROI for a SaaS startup?',
'What is a good tool for automated weekly sales reports?',
'How do small teams build a KPI dashboard without engineers?',
'Best alternatives to a spreadsheet for tracking business metrics?'
];
return PROMPTS.map(p => ({ json: { prompt: p, brand: BRAND, domain: DOMAIN } }));
3. Ask Gemini with grounding
Add an HTTP Request node, method POST, with a Header Auth credential storing your key under x-goog-api-key. Grounding is turned on with the google_search tool so the answer carries its sources:
URL: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
JSON body:
={{ JSON.stringify({
contents: [ { parts: [ { text: $('Prompts & config').item.json.prompt } ] } ],
tools: [ { google_search: {} } ]
}) }}
4. Find the gaps
Add a Code node. It reads every answer, checks whether your brand is in the text or your domain is in the sources, and keeps only the questions where both are missing.
const cfg = $('Prompts & config').all().map(i => i.json);
const ans = $('Ask Gemini (grounded)').all().map(i => i.json);
const brand = String(cfg[0].brand).toLowerCase();
const domain = String(cfg[0].domain).toLowerCase();
const out = [];
for (let i = 0; i < cfg.length; i++) {
const cand = ans[i]?.candidates?.[0] || {};
const text = (cand.content?.parts || []).map(p => p.text || '').join(' ');
const chunks = cand.groundingMetadata?.groundingChunks || [];
const sources = chunks.map(c => ({ uri: c.web?.uri || '', title: c.web?.title || '' }));
const inText = text.toLowerCase().includes(brand);
const inSources = sources.some(s => (s.uri + ' ' + s.title).toLowerCase().includes(domain));
if (inText || inSources) continue; // you are present, not a gap
const topSources = sources.slice(0, 5).map(s => s.title || s.uri).filter(Boolean);
out.push({ json: { prompt: cfg[i].prompt, brand: cfg[0].brand, top_sources: topSources.join(', '), answer_excerpt: text.slice(0, 400) } });
}
return out;
Note: If no gaps are found, this node returns nothing and the rest of the workflow simply does not run, so a quiet inbox means you are already showing up everywhere you tested.
5. Draft a content brief for each gap
Add a second HTTP Request node to Gemini (same Header Auth credential, no grounding this time). It writes a brief per gap, using the question and the sources currently winning it:
JSON body:
={{ JSON.stringify({ contents: [ { parts: [ { text:
'You are an AEO strategist. A buyer asked an AI: "' + $json.prompt + '". ' +
'Our brand was not mentioned or cited. Sources cited instead: ' + ($json.top_sources || 'none') + '. ' +
'Write a content brief for an article that could earn a citation for this query. ' +
'First line: a suggested article title. Then 4 short bullet points of what to cover. Keep it under 120 words.'
} ] } ] }) }}
6. Format, log, and email
Add a Code node that pairs each brief with its gap and builds a backlog row (date, question, who is cited now, suggested title, full brief). Then add a Google Sheets node (operation Append Row, mapping Map Automatically) with a header row of report_date, question, status, top_cited_sources, suggested_title, content_brief, and a Code plus Gmail pair for the digest. Save and activate.
Tip: Prefer a Notion backlog? Swap the Google Sheets node for a Notion node set to create a database page, and map the same fields to your database properties. The rest of the workflow is unchanged.
Common mistakes
- Skipping grounding on step 3. Without
tools: [{ google_search: {} }]there are no sources, so the domain check always fails and everything looks like a gap. - Grounding the brief call in step 5. The brief is pure generation. Leave grounding off there to keep it fast and cheap.
- Naming your brand in a prompt. It hides real gaps. Prompts must be neutral buyer questions.
- Treating briefs as final copy. They are a starting angle. The expertise you add on top is what actually earns the citation.
- Mismatched Sheet headers. Automatic mapping needs exact column names, or columns land blank.
Cost at realistic volume
One grounded call per question, plus one plain call per gap found, one Sheets append per gap, and one email per run.
| Service | Usage per weekly run (15 questions, ~5 gaps) | Cost |
|---|---|---|
| Gemini grounded search | 15 grounded calls | Free daily allowance, then ~$35 / 1,000 prompts |
| Gemini brief generation | ~5 plain calls | Fractions of a cent |
| Google Sheets | ~5 row appends | Free |
| Gmail | 1 email | Free |
| n8n | 1 execution / week | Free self-hosted; ~4 executions/month on Cloud |
A weekly content backlog built from real AI evidence for a few cents. The paid platforms that produce gap reports start around fifty dollars a month and rarely write the brief for you.
Get the AEO content gap analyzer template
The guide above is free to follow. If you would rather skip the build, the ready-to-import template drops all nine nodes and every script onto your canvas. Import it, add your Gemini, Google Sheets, and Gmail credentials, set your brand and questions, and your first backlog can run today. Want it installed and tuned to your market? Our done-for-you service sets it up end to end.
Instant download · Works on n8n Cloud and self-hosted
Frequently asked questions
What is an AEO content gap?
It is a buyer question where an AI assistant gives a confident answer but never mentions or cites you, while it does cite competitors or other sources. Each gap is a topic where the AI has decided someone else is the authority. Filling it is how you earn your way into future answers.
How is this different from tracking mentions or citations?
Those tools measure where you stand. This one turns the misses into a plan: it isolates the questions you lose, sees who wins them, and drafts a content brief for each so you know exactly what to publish. It is the do-something step after the measuring steps.
Why does it use grounded search?
Grounding makes Gemini answer from the live web and return the sources it used. That lets the workflow check both the answer text and the cited pages, so a gap means you are truly absent, not just unnamed. Without grounding there would be no source list to compare against.
Are the AI-written briefs good enough to publish from?
Treat them as a starting angle, not a finished article. The brief gives you a working title and the points the winning sources cover, which saves the blank-page step. A human should still add real expertise, data, and examples, which is also what earns the citation.
How many prompts should I run?
Start with ten to twenty questions that map to your core offers. That is enough to surface a handful of real gaps each week without a huge brief list. As you fill gaps, rotate in new questions so the analyzer keeps finding fresh opportunities rather than repeating the same ones.
Related guides
- Track brand mentions in ChatGPT and Gemini — does the AI say your name.
- Competitor AI-visibility monitor — how you rank against rivals.
- Monitor AI citations of your website — does the AI cite your site.
- Best n8n AI agent templates and how to set up n8n.
- Browse all n8n templates and more AI agent guides.