Build an AI visibility monitor in n8n
Track how AI assistants mention your brand with n8n: scheduled prompts, multiple models, mention detection, a results table and a Slack digest.
An n8n AI visibility monitor sends the same set of buyer prompts to several AI models on a schedule, detects whether your brand and competitors are mentioned, stores every answer and posts a weekly summary to Slack. It's a cheap, transparent alternative or complement to paid tracking tools.
- Use real buyer prompts, stored in a data table or sheet.
- Query several engines via n8n nodes or HTTP Request.
- Store raw answers and score mentions, position and citations.
- Report trends weekly; single answers vary.
Checked 4 November 2026 (CET) against n8n documentation and the n8n pricing page. n8n ships updates often and node options, plan limits and prices change, so confirm in your own instance and on the pricing page. "Our view" marks MentionX opinion. Ledgerline is a fictional company used for illustration.
01Why build your own monitor?
Paid AI visibility tools are useful, but they're a black box: you don't always see the prompts or how mentions are scored. A homemade monitor in n8n is:
- Transparent. You choose prompts and scoring rules.
- Cheap at small scale. The costs are executions plus API calls (lesson 19 estimates both).
- Connected. Results can sit next to GA4 and CRM data.
The trade-off is maintenance. Detection rules, prompts and models change, and someone has to own it. The Tools track's tracker guide covers the API-only version; this lesson builds it in n8n.
02How should you query each engine?
| Engine | n8n route | Notes |
|---|---|---|
| OpenAI models | OpenAI node or OpenAI chat model in a chain | API answers may differ from the ChatGPT app |
| Anthropic Claude | Anthropic chat model in a Basic LLM Chain | Web search in the API is a separate tool setting; check Anthropic docs |
| Perplexity | Perplexity node, Agent resource (n8n 2.14.0 or later) | Calls the Agent API and returns an answer with citations. Sonar model names ended 27 September 2026. |
| Google Gemini | Google Gemini chat model | Not the same as AI Overviews in Search |
| Others | HTTP Request with the provider's API | Check terms of service |
Perplexity ended support for its Sonar API models on 27 September 2026. The current n8n Perplexity node (2.14.0 or later) has Agent, Search and Embeddings resources. Use Agent for an answer with citations, or Search for ranked results. See Perplexity Agent API and Search API and Automate Perplexity research with n8n.
Use the same prompt text for each engine, and record which model or effort level answered if the API returns it.
03Detecting mentions
Start simple: case-insensitive matching on your brand name and known variants, then each competitor's names. Find the first index of each and rank them to get position. A Code node handles this in a few lines.
Watch for:
- Ambiguous names. If your brand is a common word, require a nearby category word.
- Product names. Add product and former company names as variants.
- Negative mentions. A mention isn't always good. Add an Information Extractor step to classify sentiment of the sentence mentioning you, if needed.
04Reporting
A useful weekly Slack digest has:
- Mention rate overall and by engine, this week versus a four-week average.
- Mention rate versus each competitor.
- Prompts where you lost or gained a mention.
- Top cited domains from Perplexity answers.
For a monthly management view, use the monthly AI visibility report template and the share of voice method. The Claude track's brand visibility lesson and the ChatGPT track's referral tracking lesson cover each engine in more depth.
Our view: compare trends over at least four weeks before reacting. AI answers vary between runs, and a single week's drop is often noise.
05The prompt set
Store prompts in a data table or sheet with these columns:
| Column | Example |
|---|---|
| prompt_id | P07 |
| prompt | What are the best accounts-payable tools for mid-size companies? |
| intent | category, comparison, problem, brand |
| market | UK |
| active | true |
Aim for 20 to 50 prompts that match real buyer questions, not branded vanity prompts. The manual and automated tracking lesson explains how to choose them.
06The results table
| Column | Notes |
|---|---|
| run_date | ISO date |
| prompt_id | Links to the prompt set |
| engine | Which model or API |
| answer | Full text, or a link if long |
| brand_mentioned | true/false |
| brand_position | Order of first mention among named brands, or empty |
| competitors | Which of A-D were mentioned |
| cited_urls | Any URLs the answer cites |
Keep raw answers. You'll want to re-score them when your detection rules improve.
07What API results do and don't tell you
API answers are not identical to what users see in ChatGPT, Claude or Perplexity apps, which may use different models, search settings, personalisation and location. Treat the results as a consistent trend measure, not a copy of any one user's experience. Combine with referral data from GA4 (AI referral channel group) for a fuller picture.
08A mention detection snippet explained
In a Code node, the logic is simple: lowercase the answer, check each brand's name list for a whole-word match, and record the earliest position. Sort brands by position to get the order. Store true or false per brand plus Ledgerline's rank. Keep the brand lists in a data table so you can add variants without editing code.
09Interpreting results carefully
| Pattern | What it might mean | What to do |
|---|---|---|
| Mentioned in Perplexity, not others | Cited sources mention you; model memory doesn't | Keep earning coverage on cited sites |
| Mentioned on brand prompts only | Known by name, not as a category option | Category and comparison content |
| Competitor dominates comparisons | Their comparison and review presence is stronger | Review profiles, comparison pages |
| Sudden drop on one engine | Model or search change | Wait two to four weeks before reacting |
Combine with GA4 AI referral traffic. Mentions without clicks still matter for awareness, but referrals show whether answers send people to you.
10The detection Code node
A short Code node (Run Once for Each Item) that marks mentions and position:
const answer = ($json.answer || '').toLowerCase();
const brands = {
Ledgerline: ['ledgerline'],
'Competitor A': ['competitor a'],
'Competitor B': ['competitor b'],
};
const found = [];
for (const [name, variants] of Object.entries(brands)) {
let first = -1;
for (const v of variants) {
const m = answer.match(new RegExp('\\b' + v + '\\b'));
if (m && (first === -1 || m.index < first)) first = m.index;
}
if (first !== -1) found.push({ name, first });
}
found.sort((a, b) => a.first - b.first);
const rank = found.findIndex(f => f.name === 'Ledgerline');
return { json: { ...$json, brands_found: found.map(f => f.name),
brand_mentioned: rank !== -1, brand_position: rank === -1 ? null : rank + 1 } };Replace the brand lists with real names in your own instance. Keep them in a data table for easy editing once the logic works.
11Cost math
A weekly run of 30 prompts across three engines, run twice for stability, is 180 model calls a week but only about 4 or 5 executions a month if the loop runs inside one execution. The model calls are the main cost; price them with each provider's current per-token rates and your average answer length.
12Worked example: Ledgerline's weekly AI visibility digest
Ledgerline is a fictional accounts-payable software company. Details are illustrative.
Ledgerline tracked 30 prompts across three engines weekly. The first manual run showed Ledgerline "mentioned" in an answer about ledger software in general, a false positive from substring matching. They switched to whole-word matching plus a category check.
After six weeks, the digest showed Competitor B mentioned far more often on comparison prompts, and Perplexity citations pointed to two review sites. The content team prioritised a comparison page and review-site profiles. The monitor kept running to see whether mention rates changed.
Walkthrough
- Schedule Trigger: weekly, Monday 07:00, workflow timezone set.
- Data table Get rows where active = true (or Google Sheets Get Row(s)).
- Loop Over Items with batch size 5, plus a Wait node to respect rate limits.
- Inside the loop, call each engine: OpenAI node (Message a Model), Anthropic chat via Basic LLM Chain, and Perplexity node on the Agent resource, which returns an answer and citations.
- Code node or Information Extractor to detect mentions: exact name matching for Ledgerline and Competitors A-D, plus position by first index.
- Data table Insert results.
- After the loop, Summarize node: mention rate by engine, by intent, and versus each competitor.
- Slack message to #marketing with the summary and a link to the full table.
- Set an error workflow (lesson 16).
13Try it yourself
Choose 20 real buyer prompts and run the workflow manually once. Read 10 answers yourself and check the detection was correct. Fix false positives (such as a common word in your brand name) before scheduling it.
14Quick quiz
1. Why keep raw answers?
Answer: So you can re-score them when detection rules improve.
2. Do API answers match what users see?
Answer: Not exactly. Treat them as a consistent trend measure.
3. Which node helps respect rate limits in a loop?
Answer: Loop Over Items with a Wait node, or retry settings.
15What should you check before the next lesson?
- Prompts are real buyer questions.
- Detection was checked by reading answers.
- Reports show trends, not single runs.
Next: Competitor and market monitoring. Or return to the n8n for Marketers track.
16Common questions
How many prompts do I need? 20 to 50 real buyer prompts is a practical start. Quality beats volume.
How often should it run? Weekly is enough for trends. Answers vary run to run, so daily adds noise.
Can I track Google AI Overviews? Not through model APIs. Third-party SERP APIs exist; check their terms.
Questions people ask
3 answersHow many prompts do I need?
+
20 to 50 real buyer prompts is a practical start. Quality beats volume.
How often should it run?
+
Weekly is enough for trends. Answers vary run to run, so daily adds noise.
Can I track Google AI Overviews?
+
Not through model APIs. Third-party SERP APIs exist; check their terms.
Sources
- n8n Docs, Schedule Trigger nodedocs.n8n.io
- n8n Docs, Data tablesdocs.n8n.io
- n8n Docs, Loop Over Items nodedocs.n8n.io
- n8n Docs, Perplexity nodedocs.n8n.io
- Perplexity API docs, Migrate from Sonardocs.perplexity.ai
- n8n Docs, Handle rate limitsdocs.n8n.io
- n8n Docs, Slack approvalsdocs.n8n.io
- All accessed 4 Nov 2026, except the Sonar migration page, checked 5 Nov 2026.