# 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.

Source: https://mentionx.ai/learn/n8n/n8n-ai-visibility-monitoring  
Author: Dipuck Jones, founder of MentionX  
Updated: 5 November 2026  
Level: Practitioner

**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.**

> **Key takeaways**
>
> - 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.*

## Why 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](https://mentionx.ai/learn/tools/build-own-ai-visibility-tracker-apis) covers the API-only version; this lesson builds it in n8n.

## How 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](https://mentionx.ai/learn/perplexity/perplexity-api-agent-search-marketers) and [Automate Perplexity research with n8n](https://mentionx.ai/learn/perplexity/perplexity-n8n-automation).

Use the same prompt text for each engine, and record which model or effort level answered if the API returns it.

## Detecting 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.

## Reporting

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](https://mentionx.ai/learn/measurement/monthly-ai-visibility-report-template) and the [share of voice method](https://mentionx.ai/learn/measurement/measure-ai-share-voice). The Claude track's [brand visibility lesson](https://mentionx.ai/learn/claude/measure-brand-visibility-claude) and the ChatGPT track's [referral tracking lesson](https://mentionx.ai/learn/chatgpt/track-chatgpt-referral-traffic-mentions) 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.

> **Pro move:** run each prompt twice per engine per week and count a mention only if it appears in both. It halves noise for little extra cost.

## The 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](https://mentionx.ai/learn/measurement/manual-automated-ai-visibility-tracking) explains how to choose them.

## The 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.

## What 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](https://mentionx.ai/learn/measurement/ga4-custom-channel-group-ai-referrals)) for a fuller picture.

## A 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.

## Interpreting 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.

## The detection Code node

A short Code node (Run Once for Each Item) that marks mentions and position:

```javascript
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.

## Cost 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.

## Worked 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

1. **Schedule Trigger**: weekly, Monday 07:00, workflow timezone set.
2. **Data table** Get rows where active = true (or Google Sheets Get Row(s)).
3. **Loop Over Items** with batch size 5, plus a **Wait** node to respect rate limits.
4. 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.
5. **Code** node or **Information Extractor** to detect mentions: exact name matching for Ledgerline and Competitors A-D, plus position by first index.
6. **Data table** Insert results.
7. After the loop, **Summarize** node: mention rate by engine, by intent, and versus each competitor.
8. **Slack** message to #marketing with the summary and a link to the full table.
9. Set an error workflow (lesson 16).

## Try 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.

## Quick 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.

## What 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](https://mentionx.ai/learn/n8n/n8n-competitor-monitoring). Or return to the [n8n for Marketers track](https://mentionx.ai/learn/n8n/n8n-for-marketers).

## Common 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.

## Sources

- n8n Docs, [Schedule Trigger node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger)
- n8n Docs, [Data tables](https://docs.n8n.io/build/work-with-data/data-tables)
- n8n Docs, [Loop Over Items node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches)
- n8n Docs, [Perplexity node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.perplexity)
- Perplexity API docs, [Migrate from Sonar](https://docs.perplexity.ai/docs/agent-api/migrate-from-sonar/overview)
- n8n Docs, [Handle rate limits](https://docs.n8n.io/integrations/builtin/handle-rate-limits)
- n8n Docs, [Slack approvals](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/approvals)
- All accessed 4 Nov 2026, except the Sonar migration page, checked 5 Nov 2026.

## Frequently asked 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.

---

Written and reviewed by Dipuck Jones for MentionX Learn. The HTML version of this page: https://mentionx.ai/learn/n8n/n8n-ai-visibility-monitoring
