---
name: n8n-question-mining
description: Design an n8n workflow that extracts real customer questions (email, chats, call transcripts, searches), groups them, drops ones already answered and produces SEO/AIO content briefs with human approval. Use when the user wants data-driven content ideas, FAQs, or to rank in Google and AI answers.
---

# n8n Question-Mining for SEO/AIO

## Outcome
Every week, a table of real questions, grouped and prioritized, with a brief per topic. The user approves what gets written.

## Workflow architecture (n8n)
1. **Schedule Trigger**: weekly (e.g. Monday 7:00).
2. **Sources** (only the ones the user has connected):
   - Gmail: emails from customers and prospects in the last 7 days.
   - CRM / WhatsApp: inbound conversations.
   - Call transcripts (AI receptionist or recordings).
   - Search: Google autocomplete and "People also ask" via a search results API, if the user has one.
3. **Cleanup (Code node)**: strip signatures, quoted threads and personal data (names, phones, emails) before sending text to any model.
4. **Extraction (AI node)**: prompt: "Return only questions the customer asked explicitly or implicitly, rewritten as a short question, inventing nothing. JSON: [{question, source, date}]".
5. **Grouping**: normalize (lowercase, no accents) and group equivalent questions; keep a count of how often each appears.
6. **Dedupe**: compare against the published-content table (Google Sheets or Notion). If it exists, add to the count and mark `already_answered`.
7. **Prioritization**: score = frequency + closeness to purchase (price, timing, how to hire weigh more) + whether nobody answers it well in Google.
8. **Brief per topic (AI node)**: question-style title, a direct 2–3 sentence answer (the one an AI can quote), subtopics, related questions for an FAQ block, and facts the owner must confirm.
9. **Output**: new row in Notion or Google Sheets with status `Pending approval`, plus a notification to the user.

## Rules
- Never publish. The workflow ends at `Pending approval`.
- Brief answers never invent figures or policies; unknowns go under "to confirm".
- AIO-friendly format: the question as a heading, the direct answer first, and FAQPage markup only when the page actually shows those questions and answers.

## Deliverable
- The exported n8n workflow JSON.
- The output table template.
- One test run on the user's real data, with its result.
