{
  "name": "Run a multi-agent SEO domain audit with SE Ranking and Claude",
  "tags": [],
  "nodes": [
    {
      "id": "3c9559bb-8fa3-40d4-bb36-fdb1c0129fc3",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        1056
      ],
      "parameters": {
        "color": 5,
        "width": 568,
        "height": 1112,
        "content": "## Run a multi-agent SEO domain audit with SE Ranking and Claude\n\n## Who is this for\n- SEO agencies running competitor analysis for clients\n- Content teams planning editorial strategies\n- Marketing teams tracking competitive performance\n\n## What this workflow does\nEnter any domain and get a full SEO strategy report. Five AI agents analyze your technical health, backlinks, keywords, AI visibility, and competitors -- then a Strategy Director builds a prioritized 90-day action plan.\n\n## What you'll get\n- Domain performance baseline (keywords, traffic, traffic value)\n- Technical SEO audit with health score and Core Web Vitals\n- Backlink profile with anchor text analysis\n- Top competitors discovered by keyword overlap\n- AI visibility across ChatGPT, Perplexity, Gemini, and AI Overviews\n- Prioritized 90-day action plan from the Strategy Director\n- Full report in Google Drive + metrics in Google Sheets\n\n## How it works\n1. You enter a domain, business description, and target market via a form\n2. Pulls domain overview, keywords, competitors, backlinks, and audit data in parallel\n3. Checks AI search visibility across 4 engines\n4. Four specialist agents analyze the data (Technical SEO, Links, Keywords, AI Visibility)\n5. A Strategy Director agent reviews everything and builds a unified plan\n6. Saves the report to Google Drive and metrics to Google Sheets\n\n## Requirements\n- Self-hosted n8n instance\n- SE Ranking community node v1.3.5+ ([Install from npm](https://www.npmjs.com/package/@seranking/n8n-nodes-seranking))\n- SE Ranking API token ([Get one here](https://online.seranking.com/admin.api.dashboard.html))\n- Anthropic API key (for Claude)\n- Google Drive + Sheets accounts (optional)\n\n## Setup\n1. Install the [SE Ranking community node v1.3.5+](https://www.npmjs.com/package/@seranking/n8n-nodes-seranking)\n2. Add your SE Ranking and Anthropic API credentials\n3. Connect Google Drive and Google Sheets (optional)\n4. Open the form, enter a domain, and run it\n\n## Customization\n- Change the target market dropdown to add more countries\n- Swap Claude models for different cost/speed tradeoffs\n- Add a Slack notification node at the end for team alerts"
      },
      "typeVersion": 1
    },
    {
      "id": "611b60f9-36cd-48c0-bf33-caf8781ff108",
      "name": "Domain Input Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        128,
        1008
      ],
      "parameters": {
        "options": {},
        "formTitle": "AI SEO Strategy Agent",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Domain",
              "placeholder": "example.com",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Business Description",
              "placeholder": "Brief description of what the company does"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Target Market",
              "fieldOptions": {
                "values": [
                  {
                    "option": "us"
                  },
                  {
                    "option": "uk"
                  },
                  {
                    "option": "de"
                  },
                  {
                    "option": "fr"
                  },
                  {
                    "option": "es"
                  },
                  {
                    "option": "it"
                  },
                  {
                    "option": "au"
                  },
                  {
                    "option": "ca"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Main Competitors (comma-separated)",
              "placeholder": "competitor1.com, competitor2.com"
            }
          ]
        },
        "formDescription": "Enter a domain to generate a comprehensive SEO strategy report"
      },
      "typeVersion": 2.2
    },
    {
      "id": "dadff507-264f-44c2-80b6-f6a3fb0f5f18",
      "name": "Set Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        1008
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"domain\": \"{{ $json['Domain'].replace('https://', '').replace('http://', '').replace('www.', '').split('/')[0] }}\",\n  \"business_description\": \"{{ $json['Business Description'] || 'Not provided' }}\",\n  \"source\": \"{{ $json['Target Market'] }}\",\n  \"competitors\": \"{{ $json['Main Competitors (comma-separated)'] || '' }}\",\n  \"report_date\": \"{{ new Date().toISOString().split('T')[0] }}\",\n  \"ai_engines\": [\"chatgpt\", \"perplexity\", \"gemini\", \"ai-overview\"]\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "ec48be19-8a33-4c9b-a933-ddc02af5316d",
      "name": "Data Collection Phase",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        736
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 112,
        "content": "## Data Collection\nPulls domain overview, keywords, backlinks, competitors, audit, and AI visibility data from SE Ranking"
      },
      "typeVersion": 1
    },
    {
      "id": "5f946ad5-b37f-4ec8-9feb-d14c83502c47",
      "name": "Get Domain Overview",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        816,
        880
      ],
      "parameters": {
        "domain": "={{ $json.domain }}",
        "additionalFields": {}
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "756955c5-e853-4266-ac48-76e62e95ce52",
      "name": "Get Top Keywords",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        816,
        1040
      ],
      "parameters": {
        "domain": "={{ $('Set Configuration').item.json.domain }}",
        "source": "={{ $('Set Configuration').item.json.source }}",
        "operation": "getKeywords",
        "additionalFields": {
          "limit": 100,
          "orderType": "desc",
          "orderField": "volume"
        }
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5e65e4ea-06a2-40f6-aeb9-4ac149a8ee28",
      "name": "Get Competitors",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        816,
        1200
      ],
      "parameters": {
        "domain": "={{ $('Set Configuration').item.json.domain }}",
        "source": "={{ $('Set Configuration').item.json.source }}",
        "operation": "getCompetitors",
        "additionalFields": {}
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9c5611e4-7619-44c4-b9ee-ee4c13f4ad28",
      "name": "Get Backlinks Summary",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        608,
        1360
      ],
      "parameters": {
        "target": "={{ $('Set Configuration').item.json.domain }}",
        "resource": "backlinks",
        "additionalFields": {}
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "63f22448-530d-4853-a073-6b2b02600e32",
      "name": "Get Backlinks Anchors",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        608,
        1520
      ],
      "parameters": {
        "target": "={{ $('Set Configuration').item.json.domain }}",
        "resource": "backlinks",
        "operation": "getAnchors",
        "additionalFields": {
          "limit": 50
        }
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "42c0082f-ced3-49c9-9464-5a3dbf4e424c",
      "name": "Wait for audit (1 min)",
      "type": "n8n-nodes-base.wait",
      "position": [
        416,
        1920
      ],
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c3fde7a0-33c7-498e-a35b-f1a81c302de6",
      "name": "Get Audit Report",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        608,
        1920
      ],
      "parameters": {
        "auditId": "={{ $('Create standard audit').item.json.id }}",
        "resource": "websiteAudit",
        "operation": "getReport"
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7fd8069f-3754-46d2-baee-e9a74320760b",
      "name": "Get AI Search Leaderboard",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        608,
        1712
      ],
      "parameters": {
        "source": "={{ $('Set Configuration').item.json.source }}",
        "engines": [
          "chatgpt",
          "ai-overview",
          "perplexity",
          "gemini"
        ],
        "resource": "aiSearch",
        "operation": "getLeaderboard",
        "competitors": {
          "competitorValues": [
            {
              "brand": "={{ $json.competitorValues[0].brand }}",
              "target": "={{ $json.competitorValues[0].target }}"
            },
            {
              "brand": "={{ $json.competitorValues[1].brand }}",
              "target": "={{ $json.competitorValues[1].target }}"
            },
            {
              "brand": "={{ $json.competitorValues[2].brand }}",
              "target": "={{ $json.competitorValues[2].target }}"
            }
          ]
        },
        "primaryBrand": "={{ $('Set Configuration').item.json.domain.split('.')[0] }}",
        "primaryTarget": "={{ $('Set Configuration').item.json.domain }}"
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1397cf6f-d387-4c1a-a596-6c409f828fe4",
      "name": "Merge All Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1120,
        1360
      ],
      "parameters": {
        "numberInputs": 7
      },
      "typeVersion": 3.2
    },
    {
      "id": "f915bfeb-c7df-4c29-bc49-add83c56587d",
      "name": "Format Data for AI Agents",
      "type": "n8n-nodes-base.code",
      "position": [
        1328,
        1280
      ],
      "parameters": {
        "jsCode": "// Get all inputs from the 7 data sources\nconst config = $('Set Configuration').first().json;\n\n// 1. Domain Overview\nconst domainOverview = $('Get Domain Overview').first().json;\n\n// 2. Top Keywords  \nconst topKeywords = $('Get Top Keywords').all().map(item => item.json);\n\n// 3. Competitors\nconst competitors = $('Get Competitors').all().map(item => item.json);\n\n// 4. Backlinks Summary\nconst backlinksSummary = $('Get Backlinks Summary').first().json;\n\n// 5. Backlinks Anchors\nconst backlinksAnchors = $('Get Backlinks Anchors').first().json;\n\n// 6. AI Leaderboard\nconst aiLeaderboard = $('Get AI Search Leaderboard').first().json;\n\n// 7. Website Audit\nconst websiteAudit = $('Get Audit Report').first().json;\n\n// Format for AI Agents\nconst formattedData = {\n  // Config\n  domain: config.domain,\n  brand: config.brand || config.domain.split('.')[0],\n  business_description: config.business_description,\n  report_date: new Date().toISOString().split('T')[0],\n\n  // Domain Overview\n  overview: {\n    organic_traffic: domainOverview.organic?.[0]?.traffic_sum || 0,\n    total_keywords: domainOverview.organic?.[0]?.keywords_count || 0,\n    traffic_value: domainOverview.organic?.[0]?.price_sum || 0,\n    paid_keywords: domainOverview.adv?.[0]?.keywords_count || 0,\n    paid_traffic: domainOverview.adv?.[0]?.traffic_sum || 0\n  },\n\n  // Keywords\n  keywords: {\n    total: topKeywords.length,\n    top_20: topKeywords.slice(0, 20).map(k => ({\n      keyword: k.keyword,\n      position: k.position,\n      volume: k.volume,\n      difficulty: k.difficulty,\n      cpc: k.cpc,\n      url: k.url,\n      traffic: k.traffic,\n      intents: k.intents\n    })),\n    positions_1_3: topKeywords.filter(k => k.position <= 3).length,\n    positions_4_10: topKeywords.filter(k => k.position > 3 && k.position <= 10).length,\n    positions_11_20: topKeywords.filter(k => k.position > 10 && k.position <= 20).length,\n    positions_21_50: topKeywords.filter(k => k.position > 20 && k.position <= 50).length,\n    avg_position: topKeywords.length > 0 \n      ? Math.round(topKeywords.reduce((sum, k) => sum + k.position, 0) / topKeywords.length) \n      : 0\n  },\n\n  // Competitors\n  competitors: competitors.slice(0, 10).map(c => ({\n    domain: c.domain,\n    common_keywords: c.common_keywords,\n    missing_keywords: c.missing_keywords,\n    total_keywords: c.total_keywords,\n    traffic: c.traffic_sum,\n    traffic_value: c.price_sum,\n    relevance: c.domain_relevance\n  })),\n\n  // Backlinks\nbacklinks: {\n  total_backlinks: backlinksSummary.summary?.[0]?.backlinks || 0,\n  referring_domains: backlinksSummary.summary?.[0]?.refdomains || 0,\n  dofollow_backlinks: backlinksSummary.summary?.[0]?.dofollow_backlinks || 0,\n  nofollow_backlinks: backlinksSummary.summary?.[0]?.nofollow_backlinks || 0,\n  subnets: backlinksSummary.summary?.[0]?.subnets || 0,\n  ips: backlinksSummary.summary?.[0]?.ips || 0,\n  edu_backlinks: backlinksSummary.summary?.[0]?.edu_backlinks || 0,\n  dofollow_ratio: backlinksSummary.summary?.[0]?.backlinks > 0\n    ? Math.round((backlinksSummary.summary[0].dofollow_backlinks / backlinksSummary.summary[0].backlinks) * 100)\n    : 0,\n  top_anchors: backlinksAnchors.anchors?.slice(0, 10).map(a => ({\n    anchor: a.anchor || '[empty]',\n    backlinks: a.backlinks,\n    referring_domains: a.refdomains,\n    dofollow: a.dofollow_backlinks\n  })) || []\n},\n\n  // Website Audit (Technical SEO)\n  technical: {\n    health_score: websiteAudit.score_percent || 0,\n    weighted_score: websiteAudit.weighted_score_percent || 0,\n    total_pages: websiteAudit.total_pages || 0,\n    total_errors: websiteAudit.total_errors || 0,\n    total_warnings: websiteAudit.total_warnings || 0,\n    total_notices: websiteAudit.total_notices || 0,\n    total_passed: websiteAudit.total_passed || 0,\n    is_finished: websiteAudit.is_finished || false,\n    audit_time: websiteAudit.audit_time || null,\n    \n    // Domain properties\n    domain_trust: websiteAudit.domain_props?.dt || 0,\n    google_index: websiteAudit.domain_props?.index_google || 0,\n    total_backlinks_audit: websiteAudit.domain_props?.backlinks || 0,\n    \n    // Core Web Vitals (Desktop)\n    cwv_desktop: {\n      overall: websiteAudit.chromeux?.desktop?.result === 1 ? 'Good' : 'Needs Improvement',\n      lcp: websiteAudit.chromeux?.desktop?.lcp?.result === 1 ? 'Good' : 'Needs Improvement',\n      cls: websiteAudit.chromeux?.desktop?.cls?.result === 1 ? 'Good' : 'Needs Improvement',\n      inp: websiteAudit.chromeux?.desktop?.inp?.result === 1 ? 'Good' : 'Needs Improvement'\n    },\n    \n    // Core Web Vitals (Mobile)\n    cwv_mobile: {\n      overall: websiteAudit.chromeux?.mobile?.result === 1 ? 'Good' : \n               websiteAudit.chromeux?.mobile?.result === 2 ? 'Needs Improvement' : 'Poor',\n      lcp: websiteAudit.chromeux?.mobile?.lcp?.result === 1 ? 'Good' : 'Needs Improvement',\n      cls: websiteAudit.chromeux?.mobile?.cls?.result === 1 ? 'Good' : 'Needs Improvement',\n      inp: websiteAudit.chromeux?.mobile?.inp?.result === 1 ? 'Good' : \n           websiteAudit.chromeux?.mobile?.inp?.result === 2 ? 'Needs Improvement' : 'Poor'\n    },\n\n    // Issues by section\n    sections: websiteAudit.sections?.map(section => {\n      const errors = Object.values(section.props).filter(p => p.status === 'error' && p.value > 0);\n      const warnings = Object.values(section.props).filter(p => p.status === 'warning' && p.value > 0);\n      \n      return {\n        name: section.name,\n        uid: section.uid,\n        errors: errors.map(e => ({ name: e.name, count: e.value })),\n        warnings: warnings.map(w => ({ name: w.name, count: w.value })),\n        error_count: errors.reduce((sum, e) => sum + e.value, 0),\n        warning_count: warnings.reduce((sum, w) => sum + w.value, 0)\n      };\n    }).filter(s => s.error_count > 0 || s.warning_count > 0) || []\n  },\n\n  // AI Search Visibility\n  ai_visibility: {\n    // Your domain stats\n    your_stats: {\n      chatgpt: aiLeaderboard.results?.[config.domain]?.chatgpt || { brand_presence: 0, link_presence: 0 },\n      perplexity: aiLeaderboard.results?.[config.domain]?.perplexity || { brand_presence: 0, link_presence: 0 },\n      gemini: aiLeaderboard.results?.[config.domain]?.gemini || { brand_presence: 0, link_presence: 0 },\n      ai_overview: aiLeaderboard.results?.[config.domain]?.['ai-overview'] || { brand_presence: 0, link_presence: 0 }\n    },\n    \n    // Leaderboard ranking\n    leaderboard: aiLeaderboard.leaderboard?.map(entry => ({\n      rank: entry.rank,\n      domain: entry.domain,\n      is_you: entry.is_primary_target,\n      share_of_voice: Math.round(entry.share_of_voice * 100),\n      brand_presence: entry.brand_presence,\n      link_presence: entry.link_presence\n    })) || [],\n    \n    // Competitor comparison\n    competitor_stats: Object.entries(aiLeaderboard.results || {})\n      .filter(([domain]) => domain !== config.domain)\n      .map(([domain, stats]) => ({\n        domain,\n        chatgpt: stats.chatgpt,\n        perplexity: stats.perplexity,\n        gemini: stats.gemini,\n        ai_overview: stats['ai-overview']\n      }))\n  }\n};\n\nreturn [{ json: formattedData }];"
      },
      "typeVersion": 2
    },
    {
      "id": "ee52669d-387d-428e-b2c2-d4f2ba9bff62",
      "name": "AI Agents Phase",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        1024
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 112,
        "content": "## AI Analysis (5 Agents)\nFour specialists analyze the data, then a Strategy Director builds the final action plan"
      },
      "typeVersion": 1
    },
    {
      "id": "b32cedd1-a44f-4c02-930f-2b92b1af53c7",
      "name": "Technical SEO Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1568,
        1360
      ],
      "parameters": {
        "text": "=Analyze the technical SEO health for {{ $json.domain }}:\n\nAUDIT SUMMARY:\n- Health Score: {{ $json.technical.health_score }}%\n- Total Pages Crawled: {{ $json.technical.total_pages }}\n- Errors: {{ $json.technical.total_errors }}\n- Warnings: {{ $json.technical.total_warnings }}\n- Domain Trust: {{ $json.technical.domain_trust }}\n\nCORE WEB VITALS:\nDesktop: {{ JSON.stringify($json.technical.cwv_desktop) }}\nMobile: {{ JSON.stringify($json.technical.cwv_mobile) }}\n\nISSUES BY SECTION:\n{{ JSON.stringify($json.technical.sections, null, 2) }}\n\nProvide a technical SEO analysis with prioritized recommendations.",
        "options": {
          "systemMessage": "You are a Technical SEO Specialist. Analyze the website audit data and provide:\n\n1. **Health Score Assessment** - Interpret the score and what it means\n2. **Critical Issues** (must fix immediately) - List specific problems\n3. **High Priority** (fix within 2 weeks) - Important but not urgent\n4. **Quick Wins** (easy fixes with big impact)\n\nFor each issue category, provide:\n- What the problem likely is\n- Why it matters for SEO\n- How to fix it\n\nBe specific and actionable. Format with markdown headers."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "e4f3c796-f356-43fc-b370-c0d99b3964c8",
      "name": "Link Building Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1568,
        1552
      ],
      "parameters": {
        "text": "=Analyze the backlink profile for {{ $json.domain }}:\n\nBACKLINK SUMMARY:\n- Total Backlinks: {{ $json.backlinks.total_backlinks }}\n- Referring Domains: {{ $json.backlinks.referring_domains }}\n- Dofollow Ratio: {{ $json.backlinks.dofollow_ratio }}%\n- Domain Inlink Rank: {{ $json.backlinks.domain_inlink_rank }}\n\nTOP ANCHORS:\n{{ JSON.stringify($json.backlinks.top_anchors, null, 2) }}\n\nCOMPETITORS:\n{{ JSON.stringify($json.competitors.slice(0, 5), null, 2) }}\n\nProvide a link building analysis with prioritized recommendations.",
        "options": {
          "systemMessage": "You are a Link Building Strategist. Analyze the backlink profile and provide:\n\n1. **Profile Health Assessment**\n   - Authority score interpretation\n   - Dofollow/nofollow ratio analysis\n   - Toxic link risk assessment\n\n2. **Anchor Text Analysis**\n   - Over-optimization risks\n   - Brand vs keyword anchor balance\n\n3. **Competitor Gap Analysis**\n   - Where competitors are getting links\n   - Opportunities to outreach\n\n4. **Recommended Actions** (prioritized)\n   - Quick wins (low effort, high impact)\n   - Medium-term strategies\n   - Long-term link building plan\n\nBe specific with tactics. Format with markdown."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "a5bf7664-c501-4414-a457-2cdee021fe34",
      "name": "Keyword Strategy Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1568,
        1744
      ],
      "parameters": {
        "text": "=Analyze keyword strategy for {{ $json.domain }}:\n\nOVERVIEW:\n- Total Keywords: {{ $json.overview.total_keywords }}\n- Organic Traffic: {{ $json.overview.organic_traffic }}\n- Traffic Value: ${{ $json.overview.traffic_value }}\n\nPOSITION DISTRIBUTION:\n- Positions 1-3: {{ $json.keywords.positions_1_3 }}\n- Positions 4-10: {{ $json.keywords.positions_4_10 }}\n- Positions 11-20: {{ $json.keywords.positions_11_20 }}\n- Positions 21-50: {{ $json.keywords.positions_21_50 }}\n- Average Position: {{ $json.keywords.avg_position }}\n\nTOP KEYWORDS:\n{{ JSON.stringify($json.keywords.top_20, null, 2) }}\n\nCOMPETITORS:\n{{ JSON.stringify($json.competitors.slice(0, 5), null, 2) }}\n\nProvide keyword strategy recommendations with prioritized actions.",
        "options": {
          "systemMessage": "You are a Keyword Research Specialist. Analyze the keyword data and provide:\n\n1. **Quick Wins** (keywords ranking 4-20 with high volume)\n   - Specific keywords to target\n   - Optimization recommendations\n\n2. **Defend** (top 3 rankings to protect)\n   - High-value keywords at risk\n   - Defense strategies\n\n3. **Attack** (competitor keywords to target)\n   - Gap opportunities\n   - Content to create\n\n4. **Content Gaps**\n   - Topics missing from the site\n   - Content cluster recommendations\n\n5. **Keyword Difficulty Assessment**\n   - Easy wins vs long-term targets\n\nProvide specific keyword examples. Format with markdown."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "9cbffbcf-9093-4bc3-bb2a-52ebe12eed0c",
      "name": "AI Visibility Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1568,
        1168
      ],
      "parameters": {
        "text": "=Analyze AI search visibility for {{ $json.domain }}:\n\nYOUR AI VISIBILITY:\n- ChatGPT: Brand mentions {{ $json.ai_visibility.your_stats.chatgpt.brand_presence }}, Links {{ $json.ai_visibility.your_stats.chatgpt.link_presence }}\n- Perplexity: Brand mentions {{ $json.ai_visibility.your_stats.perplexity.brand_presence }}, Links {{ $json.ai_visibility.your_stats.perplexity.link_presence }}\n- Gemini: Brand mentions {{ $json.ai_visibility.your_stats.gemini.brand_presence }}, Links {{ $json.ai_visibility.your_stats.gemini.link_presence }}\n- AI Overviews: Brand mentions {{ $json.ai_visibility.your_stats.ai_overview.brand_presence }}, Links {{ $json.ai_visibility.your_stats.ai_overview.link_presence }}\n\nLEADERBOARD:\n{{ JSON.stringify($json.ai_visibility.leaderboard, null, 2) }}\n\nCOMPETITOR STATS:\n{{ JSON.stringify($json.ai_visibility.competitor_stats, null, 2) }}\n\nBusiness: {{ $json.business_description }}\n\nProvide AI visibility analysis with strategies to improve presence in AI search engines.",
        "options": {
          "systemMessage": "You are an AI Search Optimization Specialist (AEO/GEO expert). Analyze the AI visibility data and provide:\n\n1. **Current AI Presence Assessment**\n   - ChatGPT visibility score interpretation\n   - Perplexity presence analysis\n   - Gemini visibility\n   - Google AI Overview presence\n\n2. **Benchmark Analysis**\n   - How these scores compare to industry averages\n   - Which AI engines are underperforming\n\n3. **Optimization Opportunities**\n   - How to increase AI citations\n   - Content formatting for AI\n   - Structured data recommendations\n\n4. **Content Recommendations**\n   - Topics that perform well in AI search\n   - FAQ content strategy\n   - Authority-building tactics\n\n5. **Future-Proofing**\n   - Emerging AI search trends\n   - Preparation strategies\n\nBe specific about GEO/AEO tactics. Format with markdown."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "d227c3e7-5266-47cd-861e-f5517533271f",
      "name": "Merge Agent Outputs",
      "type": "n8n-nodes-base.merge",
      "position": [
        1888,
        1392
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "5d5cd269-d877-40f9-ab92-5223e3470de4",
      "name": "Compile Agent Reports",
      "type": "n8n-nodes-base.code",
      "position": [
        2080,
        1392
      ],
      "parameters": {
        "jsCode": "const technicalReport = $('Technical SEO Agent').first().json.output || $('Technical SEO Agent').first().json.text || '';\nconst linkReport = $('Link Building Agent').first().json.output || $('Link Building Agent').first().json.text || '';\nconst keywordReport = $('Keyword Strategy Agent').first().json.output || $('Keyword Strategy Agent').first().json.text || '';\nconst aiReport = $('AI Visibility Agent').first().json.output || $('AI Visibility Agent').first().json.text || '';\nconst originalData = $('Format Data for AI Agents').first().json;\n\nreturn [{\n  json: {\n    ...originalData,\n    agent_reports: {\n      technical: technicalReport,\n      link_building: linkReport,\n      keyword_strategy: keywordReport,\n      ai_visibility: aiReport\n    }\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "ab30f5b7-b1df-4f16-ab45-7469902346f6",
      "name": "Strategy Director Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2288,
        1392
      ],
      "parameters": {
        "text": "=Today's date is {{ $json.report_date }}. All recommendations, references, and publication titles MUST use the current year ({{ $json.report_date.split('-')[0] }}). Never reference past years in forward-looking recommendations.\n\nCreate an executive SEO strategy for {{ $json.domain }} ({{ $json.business_description }}).\n\nCURRENT METRICS:\n- Organic Traffic: {{ $json.overview.organic_traffic.toLocaleString() }}\n- Total Keywords: {{ $json.overview.total_keywords.toLocaleString() }}\n- Traffic Value: ${{ $json.overview.traffic_value.toLocaleString() }}\n- Backlinks: {{ $json.backlinks.total_backlinks.toLocaleString() }}\n- Referring Domains: {{ $json.backlinks.referring_domains.toLocaleString() }}\n- Technical Health Score: {{ $json.technical.health_score }}%\n- AI Share of Voice: {{ $json.ai_visibility.leaderboard.find(l => l.is_you)?.share_of_voice || 0 }}%\n\nAGENT REPORTS:\n\n=== TECHNICAL SEO ANALYSIS ===\n{{ $json.agent_reports.technical }}\n\n=== LINK BUILDING ANALYSIS ===\n{{ $json.agent_reports.link_building }}\n\n=== KEYWORD STRATEGY ANALYSIS ===\n{{ $json.agent_reports.keyword_strategy }}\n\n=== AI VISIBILITY ANALYSIS ===\n{{ $json.agent_reports.ai_visibility }}\n\nSynthesize these reports into a unified executive strategy with clear priorities and a 90-day action plan.",
        "options": {
          "systemMessage": "You are an SEO Strategy Director. Review all specialist reports and create an EXECUTIVE SUMMARY:\n\n1. **Overall SEO Health Score** (1-100)\n   - Weighted assessment across all areas\n   - Brief justification\n\n2. **Key Findings** (3-5 bullet points)\n   - Most critical insights from each specialist\n\n3. **Top 3 Priorities** (what to focus on first)\n   - Specific, actionable items\n   - Expected impact\n   - Effort required\n\n4. **90-Day Action Plan**\n   - Month 1: Foundation (what to fix first)\n   - Month 2: Growth (what to build)\n   - Month 3: Scale (what to expand)\n\n5. **Expected Impact**\n   - Traffic improvement estimate\n   - Ranking improvements\n   - Timeline for results\n\n6. **Resource Requirements**\n   - Time investment\n   - Budget recommendations\n   - Tools needed\n\nBe decisive and prioritize ruthlessly. Format with markdown headers."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "40c204fa-bf03-4436-82fa-1b385ea1f781",
      "name": "Output Phase",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2624,
        1232
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 112,
        "content": "## Report & Export\nCompiles the full report and saves it to Google Drive and Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "6142370f-0525-42fa-8a47-2ad5f69142cf",
      "name": "Compile Final Report",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        1392
      ],
      "parameters": {
        "jsCode": "// Get inputs\nconst formattedData = $('Format Data for AI Agents').first().json;\nconst strategyDirectorOutput = $('Strategy Director Agent').first().json;\n\n// Get Strategy Director output\nconst executiveSummary = strategyDirectorOutput.output || \n  strategyDirectorOutput.text || \n  strategyDirectorOutput.content || \n  '[Strategy Director output]';\n\n// Get individual agent reports\nconst technicalReport = $('Technical SEO Agent').first().json.output || \n  $('Technical SEO Agent').first().json.text || 'Report not available';\nconst linkBuildingReport = $('Link Building Agent').first().json.output || \n  $('Link Building Agent').first().json.text || 'Report not available';\nconst keywordReport = $('Keyword Strategy Agent').first().json.output || \n  $('Keyword Strategy Agent').first().json.text || 'Report not available';\nconst aiVisibilityReport = $('AI Visibility Agent').first().json.output || \n  $('AI Visibility Agent').first().json.text || 'Report not available';\n\n// Calculate AI visibility totals\nconst aiStats = formattedData.ai_visibility.your_stats;\nconst totalBrandMentions = \n  (aiStats.chatgpt?.brand_presence || 0) +\n  (aiStats.perplexity?.brand_presence || 0) +\n  (aiStats.gemini?.brand_presence || 0) +\n  (aiStats.ai_overview?.brand_presence || 0);\n\nconst totalLinkCitations = \n  (aiStats.chatgpt?.link_presence || 0) +\n  (aiStats.perplexity?.link_presence || 0) +\n  (aiStats.gemini?.link_presence || 0) +\n  (aiStats.ai_overview?.link_presence || 0);\n\n// Get your position in AI leaderboard\nconst yourAiPosition = formattedData.ai_visibility.leaderboard.find(l => l.is_you);\nconst aiShareOfVoice = yourAiPosition?.share_of_voice || 0;\n\n// Calculate keyword distribution\nconst keywordsTop3 = formattedData.keywords.positions_1_3 || 0;\nconst keywordsTop10 = keywordsTop3 + (formattedData.keywords.positions_4_10 || 0);\nconst keywordsTop20 = keywordsTop10 + (formattedData.keywords.positions_11_20 || 0);\n\n// Calculate backlink health metrics\nconst backlinkHealthScore = formattedData.backlinks.dofollow_ratio >= 70 ? 'Healthy' : \n  formattedData.backlinks.dofollow_ratio >= 50 ? 'Moderate' : 'Needs Attention';\n\n// Build competitor summary table\nconst competitorTable = formattedData.competitors.map(c => \n  `| ${c.domain} | ${c.common_keywords.toLocaleString()} | ${c.traffic?.toLocaleString() || 'N/A'} |`\n).join('\\n');\n\n// Build the final report markdown\nconst reportContent = `# SEO Strategy Report: ${formattedData.domain}\n\n**Generated:** ${formattedData.report_date}\n**Business:** ${formattedData.business_description || 'N/A'}\n\n---\n\n## Executive Summary\n\n${executiveSummary}\n\n---\n\n## 1. Technical SEO Analysis\n\n**Health Score:** ${formattedData.technical.health_score || 0}/100\n**Pages Crawled:** ${formattedData.technical.total_pages || 0}\n**Critical Issues:** ${formattedData.technical.total_errors || 0}\n**Warnings:** ${formattedData.technical.total_warnings || 0}\n\n### Core Web Vitals\n\n| Metric | Desktop | Mobile |\n|--------|---------|--------|\n| Overall | ${formattedData.technical.cwv_desktop?.overall || 'N/A'} | ${formattedData.technical.cwv_mobile?.overall || 'N/A'} |\n| LCP | ${formattedData.technical.cwv_desktop?.lcp || 'N/A'} | ${formattedData.technical.cwv_mobile?.lcp || 'N/A'} |\n| CLS | ${formattedData.technical.cwv_desktop?.cls || 'N/A'} | ${formattedData.technical.cwv_mobile?.cls || 'N/A'} |\n| INP | ${formattedData.technical.cwv_desktop?.inp || 'N/A'} | ${formattedData.technical.cwv_mobile?.inp || 'N/A'} |\n\n### Issues by Section\n\n${formattedData.technical.sections?.length > 0 ? \n  formattedData.technical.sections.map(s => \n    `**${s.name}:** ${s.error_count} errors, ${s.warning_count} warnings`\n  ).join('\\n') : 'No critical sections identified'}\n\n---\n\n## 2. Backlink Profile Analysis\n\n**Total Backlinks:** ${formattedData.backlinks.total_backlinks?.toLocaleString() || 0}\n**Referring Domains:** ${formattedData.backlinks.referring_domains?.toLocaleString() || 0}\n**Dofollow Ratio:** ${formattedData.backlinks.dofollow_ratio || 0}%\n**Profile Health:** ${backlinkHealthScore}\n\n### Backlink Breakdown\n\n| Type | Count |\n|------|-------|\n| Dofollow | ${formattedData.backlinks.dofollow_backlinks?.toLocaleString() || 0} |\n| Nofollow | ${formattedData.backlinks.nofollow_backlinks?.toLocaleString() || 0} |\n| .edu Links | ${formattedData.backlinks.edu_backlinks?.toLocaleString() || 0} |\n| Unique IPs | ${formattedData.backlinks.ips?.toLocaleString() || 0} |\n| Unique Subnets | ${formattedData.backlinks.subnets?.toLocaleString() || 0} |\n\n### Top Anchor Texts\n\n${formattedData.backlinks.top_anchors?.slice(0, 5).map((a, i) => \n  `${i + 1}. **\"${a.anchor}\"** - ${a.backlinks?.toLocaleString() || 0} backlinks from ${a.referring_domains?.toLocaleString() || 0} domains`\n).join('\\n') || 'No anchor data available'}\n\n---\n\n## 3. Keyword Performance\n\n**Total Keywords Tracked:** ${formattedData.keywords.total || 0}\n**Total Keywords (Domain):** ${formattedData.overview.total_keywords?.toLocaleString() || 0}\n**Estimated Traffic:** ${formattedData.overview.organic_traffic?.toLocaleString() || 0}\n**Traffic Value:** $${formattedData.overview.traffic_value?.toLocaleString() || 0}\n**Average Position:** ${formattedData.keywords.avg_position || 'N/A'}\n\n### Position Distribution\n\n| Position Range | Keywords |\n|----------------|----------|\n| Top 3 (1-3) | ${keywordsTop3} |\n| Page 1 (4-10) | ${formattedData.keywords.positions_4_10 || 0} |\n| Page 2 (11-20) | ${formattedData.keywords.positions_11_20 || 0} |\n| Page 3-5 (21-50) | ${formattedData.keywords.positions_21_50 || 0} |\n\n### Top Ranking Keywords\n\n${formattedData.keywords.top_20?.slice(0, 10).map((k, i) => \n  `${i + 1}. **\"${k.keyword}\"** - Position ${k.position} | Volume: ${k.volume?.toLocaleString() || 0} | Traffic: ${k.traffic || 0}`\n).join('\\n') || 'No keyword data available'}\n\n---\n\n## 4. AI Search Visibility\n\n**Share of Voice:** ${aiShareOfVoice}%\n**Total Brand Mentions:** ${totalBrandMentions.toLocaleString()}\n**Total Link Citations:** ${totalLinkCitations.toLocaleString()}\n**Brand-to-Link Ratio:** ${totalLinkCitations > 0 ? ((totalBrandMentions / totalLinkCitations) * 100).toFixed(2) : 0}%\n\n### Performance by AI Engine\n\n| AI Engine | Brand Mentions | Link Citations |\n|-----------|----------------|----------------|\n| ChatGPT | ${aiStats.chatgpt?.brand_presence || 0} | ${aiStats.chatgpt?.link_presence || 0} |\n| Perplexity | ${aiStats.perplexity?.brand_presence || 0} | ${aiStats.perplexity?.link_presence || 0} |\n| Gemini | ${aiStats.gemini?.brand_presence || 0} | ${aiStats.gemini?.link_presence || 0} |\n| AI Overviews | ${aiStats.ai_overview?.brand_presence || 0} | ${aiStats.ai_overview?.link_presence || 0} |\n\n### AI Leaderboard Position\n\n${formattedData.ai_visibility.leaderboard?.map(entry => \n  `${entry.rank}. **${entry.domain}**${entry.is_you ? ' (YOU)' : ''} - ${entry.share_of_voice}% SoV | Brand: ${entry.brand_presence?.toLocaleString() || 0} | Links: ${entry.link_presence?.toLocaleString() || 0}`\n).join('\\n') || 'No leaderboard data available'}\n\n---\n\n## 5. Competitor Landscape\n\n| Competitor | Common Keywords | Est. Traffic |\n|------------|-----------------|--------------|\n${competitorTable}\n\n---\n\n## Appendix: Detailed Agent Reports\n\n<details>\n<summary>Technical SEO Agent Report</summary>\n\n${technicalReport}\n\n</details>\n\n<details>\n<summary>Link Building Agent Report</summary>\n\n${linkBuildingReport}\n\n</details>\n\n<details>\n<summary>Keyword Strategy Agent Report</summary>\n\n${keywordReport}\n\n</details>\n\n<details>\n<summary>AI Visibility Agent Report</summary>\n\n${aiVisibilityReport}\n\n</details>\n\n---\n\n*Report generated by AI SEO Strategy Agent (SE Ranking + n8n)*\n`;\n\n// Return the final compiled report\n// Return TWO items: [0] for Google Sheets, [1] for Google Drive\nreturn [\n  {\n    // Item 0 -> route to Google Sheets (metrics only, no large text)\n    json: {\n      // Google Drive fields\n      file_name: `SEO_Strategy_Report_${formattedData.domain}_${formattedData.report_date}.md`,\n      file_content: reportContent,\n      domain: formattedData.domain,\n      report_date: formattedData.report_date,\n      business_description: formattedData.business_description || 'N/A',\n      \n      health_score: formattedData.technical.health_score || 0,\n      pages_crawled: formattedData.technical.total_pages || 0,\n      technical_errors: formattedData.technical.total_errors || 0,\n      technical_warnings: formattedData.technical.total_warnings || 0,\n      cwv_desktop: formattedData.technical.cwv_desktop?.overall || 'N/A',\n      cwv_mobile: formattedData.technical.cwv_mobile?.overall || 'N/A',\n      \n      organic_traffic: formattedData.overview.organic_traffic || 0,\n      traffic_value: formattedData.overview.traffic_value || 0,\n      total_keywords: formattedData.overview.total_keywords || 0,\n      keywords_top_3: keywordsTop3,\n      keywords_top_10: keywordsTop10,\n      keywords_top_20: keywordsTop20,\n      avg_position: formattedData.keywords.avg_position || 0,\n      \n      total_backlinks: formattedData.backlinks.total_backlinks || 0,\n      referring_domains: formattedData.backlinks.referring_domains || 0,\n      dofollow_ratio: formattedData.backlinks.dofollow_ratio || 0,\n      backlink_health: backlinkHealthScore,\n      \n      ai_share_of_voice: aiShareOfVoice,\n      ai_leaderboard_rank: yourAiPosition?.rank || 'N/A',\n      ai_brand_mentions: totalBrandMentions,\n      ai_link_citations: totalLinkCitations,\n      ai_chatgpt_brand: aiStats.chatgpt?.brand_presence || 0,\n      ai_chatgpt_links: aiStats.chatgpt?.link_presence || 0,\n      ai_perplexity_brand: aiStats.perplexity?.brand_presence || 0,\n      ai_perplexity_links: aiStats.perplexity?.link_presence || 0,\n      ai_gemini_brand: aiStats.gemini?.brand_presence || 0,\n      ai_gemini_links: aiStats.gemini?.link_presence || 0,\n      ai_overview_brand: aiStats.ai_overview?.brand_presence || 0,\n      ai_overview_links: aiStats.ai_overview?.link_presence || 0,\n      \n      competitor_1: formattedData.competitors[0]?.domain || '',\n      competitor_1_common_kw: formattedData.competitors[0]?.common_keywords || 0,\n      competitor_1_traffic: formattedData.competitors[0]?.traffic || 0,\n      competitor_2: formattedData.competitors[1]?.domain || '',\n      competitor_2_common_kw: formattedData.competitors[1]?.common_keywords || 0,\n      competitor_2_traffic: formattedData.competitors[1]?.traffic || 0,\n      competitor_3: formattedData.competitors[2]?.domain || '',\n      competitor_3_common_kw: formattedData.competitors[2]?.common_keywords || 0,\n      competitor_3_traffic: formattedData.competitors[2]?.traffic || 0\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "499c61d3-5a84-460e-8f22-8ff673d7de97",
      "name": "Save to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2928,
        1392
      ],
      "parameters": {
        "columns": {
          "value": {
            "domain": "={{ $json.domain }}",
            "cwv_mobile": "={{ $json.traffic_value }}",
            "cwv_desktop": "={{ $json.traffic_value }}",
            "report_date": "={{ $json.report_date }}",
            "avg_position": "={{ $json.avg_position }}",
            "competitor_1": "={{ $json.competitor_1 }}",
            "competitor_2": "={{ $json.competitor_2 }}",
            "competitor_3": "={{ $json.competitor_3 }}",
            "health_score": "={{ $json.health_score }}",
            "pages_crawled": "={{ $json.pages_crawled }}",
            "traffic_value": "={{ $json.traffic_value }}",
            "dofollow_ratio": "={{ $json.dofollow_ratio }}",
            "keywords_top_3": "={{ $json.keywords_top_3 }}",
            "total_keywords": "={{ $json.total_keywords }}",
            "ai_gemini_brand": "={{ $json.ai_gemini_brand }}",
            "ai_gemini_links": "={{ $json.ai_gemini_links }}",
            "backlink_health": "={{ $json.backlink_health }}",
            "keywords_top_10": "={{ $json.keywords_top_10 }}",
            "keywords_top_20": "={{ $json.keywords_top_20 }}",
            "organic_traffic": "={{ $json.traffic_value }}",
            "total_backlinks": "={{ $json.total_backlinks }}",
            "ai_chatgpt_brand": "={{ $json.ai_chatgpt_brand }}",
            "ai_chatgpt_links": "={{ $json.ai_chatgpt_links }}",
            "technical_errors": "={{ $json.technical_errors }}",
            "ai_brand_mentions": "={{ $json.ai_brand_mentions }}",
            "ai_link_citations": "={{ $json.ai_link_citations }}",
            "ai_overview_brand": "={{ $json.ai_overview_brand }}",
            "ai_overview_links": "={{ $json.ai_overview_links }}",
            "ai_share_of_voice": "={{ $json.ai_share_of_voice }}",
            "referring_domains": "={{ $json.referring_domains }}",
            "technical_warnings": "={{ $json.traffic_value }}",
            "ai_leaderboard_rank": "={{ $json.ai_leaderboard_rank }}",
            "ai_perplexity_brand": "={{ $json.ai_perplexity_brand }}",
            "ai_perplexity_links": "={{ $json.ai_perplexity_links }}",
            "business_description": "={{ $json.business_description }}",
            "competitor_1_traffic": "={{ $json.competitor_1_traffic }}",
            "competitor_2_traffic": "={{ $json.competitor_2_traffic }}",
            "competitor_3_traffic": "={{ $json.competitor_3_traffic }}",
            "competitor_1_common_kw": "={{ $json.competitor_1_common_kw }}",
            "competitor_2_common_kw": "={{ $json.competitor_2_common_kw }}",
            "competitor_3_common_kw": "={{ $json.competitor_3_common_kw }}"
          },
          "schema": [
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "report_date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "report_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "business_description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "business_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "health_score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "health_score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pages_crawled",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "pages_crawled",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "technical_errors",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "technical_errors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "technical_warnings",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "technical_warnings",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cwv_desktop",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "cwv_desktop",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cwv_mobile",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "cwv_mobile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organic_traffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organic_traffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "traffic_value",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "traffic_value",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "total_keywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "total_keywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keywords_top_3",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keywords_top_3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keywords_top_10",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keywords_top_10",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keywords_top_20",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keywords_top_20",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "avg_position",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "avg_position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "total_backlinks",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "total_backlinks",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "referring_domains",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "referring_domains",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "dofollow_ratio",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "dofollow_ratio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "backlink_health",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "backlink_health",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_share_of_voice",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_share_of_voice",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_leaderboard_rank",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_leaderboard_rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_brand_mentions",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_brand_mentions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_link_citations",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_link_citations",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_chatgpt_brand",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_chatgpt_brand",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_chatgpt_links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_chatgpt_links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_perplexity_brand",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_perplexity_brand",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_perplexity_links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_perplexity_links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_gemini_brand",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_gemini_brand",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_gemini_links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_gemini_links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_overview_brand",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_overview_brand",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_overview_links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ai_overview_links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_1",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_1_common_kw",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_1_common_kw",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_1_traffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_1_traffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_2_common_kw",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_2_common_kw",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_2_traffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_2_traffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_3",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_3_common_kw",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_3_common_kw",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor_3_traffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitor_3_traffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "domain"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bc3d8de9-7602-4bf5-b40d-b9e4f1c40623",
      "name": "Create standard audit",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        208,
        1920
      ],
      "parameters": {
        "domain": "={{ $json.domain }}",
        "resource": "websiteAudit",
        "operation": "createStandard",
        "additionalFields": {}
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e2ac3e1d-7be8-43ce-898f-43e1cfb02cf2",
      "name": "If audit still running",
      "type": "n8n-nodes-base.if",
      "position": [
        816,
        1920
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0f18148b-a685-4df0-8727-779555cc6321",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.is_finished }}",
              "rightValue": false
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "87d2dc0e-5f1b-4d0f-b30d-389e05292d0b",
      "name": "Prepare competitors for AI Leaderboard",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        1712
      ],
      "parameters": {
        "jsCode": "const config = $input.first().json;\n\n// Split comma-separated string into array of competitor objects\nconst competitorValues = config.competitors\n  .split(',')\n  .map(c => {\n    const domain = c.trim();\n    const brand = domain.split('.')[0].charAt(0).toUpperCase() + domain.split('.')[0].slice(1);\n    return {\n      target: domain,\n      brand: brand\n    };\n  });\n\nreturn [{\n  json: {\n    ...config,\n    competitorValues: competitorValues\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "1b6774d4-2e7d-4ba2-80a0-8823d606153e",
      "name": "Claude Sonnet (Specialist Agents)",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1440,
        1952
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d14e7e55-8f44-4f0f-b779-c6aaf907d04c",
      "name": "Claude Opus (Strategy Director)",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        2160,
        1600
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-opus-4-6",
          "cachedResultName": "Claude Opus 4.6"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "9da10d22-e454-48c4-b0b7-caa645e9532e",
      "name": "Save report to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2928,
        1584
      ],
      "parameters": {
        "name": "={{ $json.file_name }}",
        "content": "={{ $json.file_content }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultUrl": "",
          "cachedResultName": "/ (Root folder)"
        },
        "operation": "createFromText"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Merge All Data": {
      "main": [
        [
          {
            "node": "Format Data for AI Agents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Competitors": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Get Audit Report": {
      "main": [
        [
          {
            "node": "If audit still running",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Top Keywords": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Domain Input Form": {
      "main": [
        [
          {
            "node": "Set Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Configuration": {
      "main": [
        [
          {
            "node": "Get Domain Overview",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Top Keywords",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Competitors",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Backlinks Summary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Backlinks Anchors",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create standard audit",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prepare competitors for AI Leaderboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Visibility Agent": {
      "main": [
        [
          {
            "node": "Merge Agent Outputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Domain Overview": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Link Building Agent": {
      "main": [
        [
          {
            "node": "Merge Agent Outputs",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Merge Agent Outputs": {
      "main": [
        [
          {
            "node": "Compile Agent Reports",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Technical SEO Agent": {
      "main": [
        [
          {
            "node": "Merge Agent Outputs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Compile Final Report": {
      "main": [
        [
          {
            "node": "Save to Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save report to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compile Agent Reports": {
      "main": [
        [
          {
            "node": "Strategy Director Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create standard audit": {
      "main": [
        [
          {
            "node": "Wait for audit (1 min)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Backlinks Anchors": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Get Backlinks Summary": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "If audit still running": {
      "main": [
        [
          {
            "node": "Wait for audit (1 min)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 6
          }
        ]
      ]
    },
    "Keyword Strategy Agent": {
      "main": [
        [
          {
            "node": "Merge Agent Outputs",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Wait for audit (1 min)": {
      "main": [
        [
          {
            "node": "Get Audit Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strategy Director Agent": {
      "main": [
        [
          {
            "node": "Compile Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data for AI Agents": {
      "main": [
        [
          {
            "node": "Technical SEO Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Link Building Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Keyword Strategy Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Visibility Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get AI Search Leaderboard": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "Claude Opus (Strategy Director)": {
      "ai_languageModel": [
        [
          {
            "node": "Strategy Director Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Claude Sonnet (Specialist Agents)": {
      "ai_languageModel": [
        [
          {
            "node": "Keyword Strategy Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Link Building Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Technical SEO Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "AI Visibility Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prepare competitors for AI Leaderboard": {
      "main": [
        [
          {
            "node": "Get AI Search Leaderboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}