🚀 SEO Data Analyst Agent for n8n
Supercharge SEO analysis and content optimization with a plug‑and‑play n8n agentic workflow. It combines:
- Main SEO Data Analyst Agent (BigQuery + NL2SQL)
- Website Agent (on‑page crawling and analysis)
- Scrape Tool (Serper by default; swap for Firecrawl/Crawl4AI)
Use natural language to query GSC/BQ data, crawl pages, extract titles/meta, compute n‑grams, and get actionable recommendations.
Overview
This workflow is designed to streamline SEO analysis by allowing you to ask natural language questions about your website’s performance. The main agent generates and executes queries on your BigQuery data, while a dedicated website agent crawls and analyzes your content. Including titles, meta descriptions, and n-gram analysis. This makes it easy to update and optimize your articles based on real data and AI-driven recommendations.
Files & Components
SEO Data Analyst Agent
This is the main agent you interact with. It interprets your questions, generates the necessary queries, and coordinates the analysis process.
Website Agent
Responsible for crawling and analyzing website content. The SEO Data Analyst Agent uses this agent as a tool to fetch and process on-page data.
Tool – Scrape Website
This workflow is used by the Website Agent to scrape content. It currently uses Serper for crawling, which is cost-effective (about €0.0017 per scrape) and easy to set up. You can easily swap Serper for Crawl4AI or Firecrawl if you prefer.
🧭 Quick Start
🧱 Architecture
- SEO Data Analyst Agent: NL prompts → SQL for BigQuery → returns insights as structured text and tables.
- Website Agent (tool): Crawls URLs → extracts title, meta, headers, content → n‑grams and quality checks.
- Scrape Tool: Serper scrape endpoint by default. Plug‑replace with Firecrawl/Crawl4AI.
Data flow: Prompt → Analyst Agent → (optional) Website Agent → BigQuery → Answers + Recommendations
✅ Requirements
| Component | Purpose | Notes |
|---|---|---|
| n8n (self‑hosted or cloud) | Orchestrates agents/workflows | Latest stable recommended |
| Google BigQuery | Stores GSC export and site data | Ensure GSC → BigQuery export is enabled |
| OpenAI API key | NL2SQL + reasoning | Model configurable (e.g., gpt-4o, o3-mini) |
| Serper API key | Page scrape via endpoint | Replaceable with Firecrawl/Crawl4AI |
📦 Files in this repo
| File | Description |
|---|---|
seo_data_analyst.json | Main agentic workflow (BigQuery + tools) |
tool_website_agent.json | Website agent used as a tool |
tool_serper_crawl_urls.json | Serper scraping helper workflow |
n8n-*.png | Architecture and node screenshots |
🛠️ Installation
- Install n8n and log in to your instance.
- Ensure your GSC → BigQuery export is configured.
- Gather API keys: OpenAI, Serper.
Import Workflows
- In n8n, click Import and select:
seo_data_analyst.jsontool_website_agent.jsontool_serper_crawl_urls.json
- Activate the helper tools first, then the main workflow.
⚙️ Configuration
- System Prompt: Update BigQuery table dataset and names inside the Analyst Agent system instructions.
- Credentials: Create credentials in n8n for:
- Google BigQuery
- OpenAI
- Serper
- Swap Scraper (optional): Replace Serper nodes with Firecrawl/Crawl4AI equivalents.
🔑 Environment Variables (typical)
| Key | Example |
|---|---|
OPENAI_API_KEY | sk-... |
SERPER_API_KEY | serper_... |
GOOGLE_APPLICATION_CREDENTIALS | /home/n8n/gcp.json |
💸 Costs
| Resource | Est. cost |
|---|---|
| Serper scrape | ~€0.0017 per URL |
| OpenAI LLM calls | Varies by tokens/model |
| BigQuery query | Per TB scanned (optimize with filters) |
Tips:
- Scope queries with date filters and specific page paths.
- Use cached crawls where possible.
▶️ Usage
- Open the main SEO Data Analyst workflow in n8n.
- Provide a natural language prompt. Examples below.
- Optionally pass a list of URLs for on‑page analysis.
- Review returned tables and recommendations. Iterate.
🗣️ Example Prompts
- "Top pages losing clicks month‑over‑month for /blog/. Include queries and positions."
- "Find opportunities: pages with high impressions but low CTR in last 28 days."
- "Crawl these URLs and extract H1, meta description, and bigram/trigram density."
- "Suggest title/meta rewrites for pages with CTR
🧰 Troubleshooting
- BigQuery auth errors: Verify service account JSON and dataset access. Check
GOOGLE_APPLICATION_CREDENTIALSpath. - Empty query results: Confirm GSC export freshness and correct table name in system prompt.
- Serper failures: Validate API key and rate limits. Add retries/backoff in HTTP node if needed.
- Token limits: Reduce content length or switch to a larger-context model.
❓ FAQ
- Can I use a different LLM? Yes, swap the OpenAI node for your preferred provider in n8n.
- Can I use Firecrawl/Crawl4AI? Yes. Replace the Serper call node; the Website Agent contract expects URL → HTML/text.
- Do I need BigQuery? Strongly recommended for scale and SQL. You could adapt to a different warehouse with minimal changes.
🗺️ Roadmap
- Add semantic clustering for queries and pages
- Auto‑rewrite drafts (title/meta/H1) with guardrails
- Export findings to Sheets/Notion with one click
🤝 Contributing
- Fork and create a feature branch.
- Keep nodes modular and credentials externalized.
- Open a PR with before/after screenshots and a short test plan.
🙌 Credits & References
- n8n community and docs
- Google Search Console + BigQuery export
- Serper API
- Tutorials:
🔗 Related Templates
—