{
  "id": "WETMyIJCbD3et6Rh",
  "meta": {
    "instanceId": "ddfdf733df99a65c801a91865dba5b7c087c95cc22a459ff3647e6deddf2aee6"
  },
  "name": "High-Level Service Page SEO Blueprint Report",
  "tags": [],
  "nodes": [
    {
      "id": "49aa0dd2-1d64-4047-9988-8e4f386d557a",
      "name": "Convert URLs to Items",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        500
      ],
      "parameters": {
        "jsCode": "// Get the raw input string from the "Start" nodenconst input = $('Start').item.json.Competitors;nn// Split the string by line breaks and filter out any empty linesnconst urls = inputn  .split('\n')n  .map(url => url.trim())n  .filter(url => url.length > 0);nn// Return the array as output with "competitor_url" fieldnreturn urls.map(url => ({ json: { competitor_url: url } }));"
      },
      "typeVersion": 2
    },
    {
      "id": "ec7b74db-43fc-4041-b63e-02ff21b9442e",
      "name": "Start",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        240,
        500
      ],
      "webhookId": "dafbc2ba-7397-4f83-b84d-630294e636b0",
      "parameters": {
        "options": {},
        "formTitle": "Competitors Analysis for Service-Based Queries",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Competitors",
              "placeholder": "competitor1.comncompetitor2.com",
              "requiredField": true
            },
            {
              "fieldLabel": "Target Keyword",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Services Offered",
              "requiredField": true
            },
            {
              "fieldLabel": "Brand Name",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Is Homepage?",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Yes"
                  },
                  {
                    "option": "No"
                  }
                ]
              }
            }
          ]
        },
        "formDescription": "Generate a high-level service page content blueprint report to follow to beat the competition. nnNote: Do not add more than 5 competitors otherwise this could dilute the context and quality of the final report."
      },
      "typeVersion": 2.2
    },
    {
      "id": "c517d397-4962-4281-962e-a57e3a12bea0",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        880,
        500
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ac532215-626d-4690-9c99-d11f09fa86dc",
      "name": "Get URL HTML",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "maxTries": 5,
      "position": [
        1100,
        340
      ],
      "parameters": {
        "url": "=https://r.jina.ai/{{ $json.competitor_url }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Edit Fields').first().json['JINA Reader API Key'] }}"
            },
            {
              "name": "X-Return-Format",
              "value": "html"
            }
          ]
        }
      },
      "executeOnce": false,
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "ed03887c-9996-4dfb-b46a-a745bc64864a",
      "name": "Extract HTML Elements",
      "type": "n8n-nodes-base.code",
      "position": [
        1300,
        340
      ],
      "parameters": {
        "jsCode": "// Function to remove inner HTML tags and decode common HTML entitiesnfunction cleanText(text) {n  // Remove any HTML tags inside the textn  let cleaned = text.replace(/]+(&gt;|$)/g, '');nn  // Decode common HTML entitiesn  cleaned = cleanedn    .replace(/&nbsp;/g, ' ')  // Non-breaking spacen    .replace(/&amp;/g, '&amp;')   // Ampersandn    .replace(/&quot;/g, '"')  // Double quoten    .replace(/&lt;/g, '')    // Greater-thann    .replace(/&#8217;/g, "'")  // Right single quotation markn    .replace(/&#8220;/g, '"')  // Left double quotation markn    .replace(/&#8221;/g, '"')  // Right double quotation markn    .replace(/&rsquo;/g, "'")  // Right single quotation markn    .replace(/&lsquo;/g, "'")  // Left single quotation markn    .replace(/&rdquo;/g, '"')  // Right double quotation markn    .replace(/&ldquo;/g, '"')  // Left double quotation markn    .replace(/&mdash;/g, 'u2014')  // Em dashn    .replace(/&ndash;/g, 'u2013')  // En dashn    .replace(/&hellip;/g, 'u2026') // Ellipsisn    .replace(/&amp;#(\d+);/g, (match, dec) =&gt; String.fromCharCode(dec)); // Handle numeric entitiesnn  return cleaned.trim();  // Remove extra whitespacen}nn// Function to generate n-grams from textnfunction generateNgrams(text, n) {n  // Convert text to lowercase and split into wordsn  const words = text.toLowerCase()n    .replace(/[^\w\s]|_/g, ' ')  // Replace punctuation and underscores with spacesn    .replace(/\s+/g, ' ')        // Replace multiple spaces with a single spacen    .trim()                       // Remove leading/trailing spacesn    .split(' ');                  // Split into wordsn  n  // Filter out stop words and very short words (optional)n  const filteredWords = words.filter(word =&gt; word.length &gt; 1);n  n  // Generate n-gramsn  const ngrams = [];n  for (let i = 0; i  {n    const ngrams = generateNgrams(text, n);n    n    ngrams.forEach(ngram =&gt; {n      ngramCounts[ngram] = (ngramCounts[ngram] || 0) + 1;n    });n  });n  n  // Convert to array of objects and sort by count (descending)n  return Object.entries(ngramCounts)n    .map(([phrase, count]) =&gt; ({ phrase, count }))n    .sort((a, b) =&gt; b.count - a.count);n}nn// Initialize an array to store the results for each itemnlet results = [];nn// Iterate through all items (each item corresponds to one URL in the loop)nitems.forEach(item =&gt; {n  // Get the raw HTML content for the current itemn  const html = item.json.data || '';  // Ensure you're getting the correct field where HTML is storednn  // Initialize arrays to store the extracted outlinen  let outline = [];n  let meta = {};n  let schemas = [];n  let headingTexts = []; // Store all heading texts for n-gram analysisnn  // Store all headings with their positions to maintain original ordern  let headingsWithPositions = [];n  n  // Extract heading content with a more robust approachn  for (let i = 1; i &lt;= 6; i++) {n    // This regex pattern matches h1-h6 tags, capturing everything between opening and closing tagsn    // even if there are nested elementsn    const pattern = new RegExp(`]*&gt;((?:.|\n)*?)`, 'gi');n    let match;n    n    while ((match = pattern.exec(html)) !== null) {n      const fullContent = match[1];n      const cleanedText = cleanText(fullContent);n      n      // Only add non-empty headingsn      if (cleanedText &amp;&amp; cleanedText.trim().length &gt; 0) {n        headingsWithPositions.push({n          position: match.index,n          level: i,n          tag: `h${i}`,n          text: cleanedTextn        });n        n        // Add to headingTexts for n-gram analysisn        headingTexts.push(cleanedText);n      }n    }n  }n  n  // Sort headings by their position in the HTML to maintain the original ordern  headingsWithPositions.sort((a, b) =&gt; a.position - b.position);n  n  // Process the sorted headingsn  headingsWithPositions.forEach(heading =&gt; {n    // Build the outline based on the heading level with dot-based indentationn    const indentation = '.'.repeat(heading.level - 1);  // No dots for H1, one for H2, etc.n    outline.push(`${indentation}${heading.tag.toUpperCase()}: ${heading.text}`);n  });nn  // Generate n-grams (2-gram, 3-gram, and 4-gram) from all headingsn  const ngrams = {n    '2gram': countNgrams(headingTexts, 2),n    '3gram': countNgrams(headingTexts, 3),n    '4gram': countNgrams(headingTexts, 4)n  };n  n  // Filter out n-grams with only one occurrence (optional)n  // This can be adjusted based on preferencen  const filteredNgrams = {n    '2gram': ngrams['2gram'].filter(item =&gt; item.count &gt; 1),n    '3gram': ngrams['3gram'].filter(item =&gt; item.count &gt; 1),n    '4gram': ngrams['4gram'].filter(item =&gt; item.count &gt; 1)n  };nn  // Extract title tagn  const titleMatch = html.match(/<title>(.*?)/i);n  if (titleMatch &amp;&amp; titleMatch[1]) {n    meta.title = cleanText(titleMatch[1]);n  }nn  // Extract meta tagsn  const metaTags = [n    { name: 'description', regex: /]*&gt;/i },n    { name: 'canonical', regex: /]*&gt;/i },n    { name: 'og:locale', regex: /]*&gt;/i },n    { name: 'og:type', regex: /]*&gt;/i },n    { name: 'og:title', regex: /]*&gt;/i },n    { name: 'og:description', regex: /]*&gt;/i },n    { name: 'og:url', regex: /]*&gt;/i },n    { name: 'og:site_name', regex: /]*&gt;/i },n    { name: 'article:publisher', regex: /]*&gt;/i },n    { name: 'article:modified_time', regex: /]*&gt;/i },n    { name: 'og:image', regex: /]*&gt;/i },n    { name: 'og:image:width', regex: /]*&gt;/i },n    { name: 'og:image:height', regex: /]*&gt;/i },n    { name: 'og:image:type', regex: /]*&gt;/i },n    { name: 'twitter:card', regex: /]*&gt;/i },n    { name: 'twitter:title', regex: /]*&gt;/i },n    { name: 'twitter:site', regex: /]*&gt;/i }n  ];nn  // Extract each meta tagn  metaTags.forEach(tag =&gt; {n    const match = html.match(tag.regex);n    if (match &amp;&amp; match[1]) {n      meta[tag.name] = cleanText(match[1]);n    }n  });nn  // Extract all meta tags with name or property attributes (more general approach)n  const generalMetaRegex = /]*&gt;/gi;n  let metaMatch;n  while ((metaMatch = generalMetaRegex.exec(html)) !== null) {n    const name = metaMatch[1];n    const content = cleanText(metaMatch[2]);n    n    // Only add if not already captured and has contentn    if (content &amp;&amp; !meta[name]) {n      meta[name] = content;n    }n  }nn  // Extract JSON-LD schema datan  const schemaRegex = /]*&gt;([\s\S]*?)/gi;n  let schemaMatch;n  n  while ((schemaMatch = schemaRegex.exec(html)) !== null) {n    try {n      const schemaText = schemaMatch[1].trim();n      if (schemaText) {n        const schemaData = JSON.parse(schemaText);n        schemas.push(schemaData);n      }n    } catch (e) {n      // If JSON parsing fails, add the raw textn      schemas.push({ raw: schemaMatch[1].trim() });n    }n  }nn  // Add the outline, meta, schema, and ngrams for the current item to the results arrayn  results.push({n    json: {n      outline: outline,  // Array containing the hierarchy of headings with dot-based indentationn      meta: Object.keys(meta).length &gt; 0 ? meta : undefined,  // Only include if meta tags were foundn      schema: schemas.length &gt; 0 ? schemas : undefined,  // Only include if schema data was foundn      ngrams: headingTexts.length &gt; 0 ? filteredNgrams : undefined  // Only include if headings were foundn    }n  });n});nn// Return the results for all items (all URLs in the loop)nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "9c873ba5-84b2-4366-ac96-a1380ce66701",
      "name": "Set URL Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        340
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "186daf52-90b2-4608-9c94-243187069bf4",
              "name": "Competitor URL",
              "type": "string",
              "value": "={{ $('Loop Over Items').item.json.competitor_url }}"
            },
            {
              "id": "3bb3057c-d84f-4eac-8da2-22740a2c293c",
              "name": "Outline",
              "type": "string",
              "value": "={{ JSON.stringify($json.outline) }}"
            },
            {
              "id": "53c1b42c-14ce-48a0-8802-5b175d7ab127",
              "name": "Meta",
              "type": "string",
              "value": "={{ JSON.stringify($json.meta) }}"
            },
            {
              "id": "ca84a96b-f370-42b6-9f4d-a1e4d1ab066a",
              "name": "Ngrams",
              "type": "string",
              "value": "={{ JSON.stringify($json.ngrams) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5fae604a-d44d-4022-905a-51742ab23144",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1100,
        520
      ],
      "parameters": {
        "jsCode": "let output = '';nnfor (const [index, item] of items.entries()) {n  const data = item.json;nn  const formatField = (value) =&gt; {n    if (typeof value === 'string') {n      try {n        const parsed = JSON.parse(value);n        return JSON.stringify(parsed, null, 2); // Pretty print with 2-space indentn      } catch {n        return value; // Not JSON, return as-isn      }n    }n    return value;n  };nn  output += `\n`;n  output += `  \n    ${data["Competitor URL"]}\n  \n\n`;n  output += `  \n    ${formatField(data["Outline"])}\n  \n\n`;n  output += `  \n${formatField(data["Meta"])}\n  \n\n`;n  output += `  \n${formatField(data["Ngrams"])}\n  \n`;n  output += `\n\n`;n}nnreturn [n  {n    json: {n      competitors_data: output.trim()n    }n  }n];n"
      },
      "typeVersion": 2
    },
    {
      "id": "a2d9be92-5a1e-448c-a4c8-e7ca8d6ce8ca",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1300,
        520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "27ea4c8c-3cd1-47e4-9f22-a4bd5b4b6b3a",
              "name": "competitors_data",
              "type": "string",
              "value": "={{ $json.competitors_data }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "715317ae-e896-48cf-b732-31a0a1ee7999",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        320,
        880
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "E9AQr0xc0FLNxbSQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e96eeecb-9b82-4cba-bf2c-3c5041b724b1",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        940,
        720
      ],
      "webhookId": "2231c6d5-575e-46be-b1e3-6fac3af1a830",
      "parameters": {
        "amount": "={{ $('Edit Fields').first().json['Waiting Time (Seconds)'] }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "998ac0b0-d3e6-4e4a-b8a6-ae8994dbfa58",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1040,
        920
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "E9AQr0xc0FLNxbSQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6ee11671-eb61-4d9f-a4f3-93898809d4e1",
      "name": "Set Competitor Analysis",
      "type": "n8n-nodes-base.set",
      "position": [
        740,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5f9f0ff2-7e00-449a-a5c4-14233315125a",
              "name": "Competitor Analysis Report",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "728cf9c2-7988-4b23-8e00-7511a0f10858",
      "name": "Set User Intent Analysis",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c5b72bf5-a084-4dfe-aad8-d77c64138c54",
              "name": "User Intent Analysis Report",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ecf01be1-fe6a-49f2-836f-8fb2c37a5da5",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1660,
        720
      ],
      "webhookId": "2231c6d5-575e-46be-b1e3-6fac3af1a830",
      "parameters": {
        "amount": "={{ $('Edit Fields').first().json['Waiting Time (Seconds)'] }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "8ac6dc7a-d32f-4366-9b21-fb20aaf1043f",
      "name": "Google Gemini Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        420,
        1220
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "ac65fd5d-6e4b-47cc-a8e2-778295651723",
      "name": "Competitors Analysis",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        400,
        720
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}nn{{ $json.competitors_data }}n",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a Data Analyst specializing in SEO and Content Structure Analysis. Your task is to meticulously analyze the provided data from top-ranking competitor pages for a specific target query. Focus on identifying recurring patterns, themes, and structural elements.nnAnalyze the following inputs:n{target_query}nn{competitors_data}nnnBased on your analysis, generate a report summarizing:n1. **List of Competitors**: Create a numbered coding system for competitors by assigning each competitor a unique code (e.g., C1, C2, C3) followed by their full brand name. For example: 'C1 = Nike, C2 = Adidas, C3 = Under Armour'. This coding system will be used for efficient reference throughout the remainder of the report.n2.  **Meta Title &amp; Description Trends:** Common keywords, angles (e.g., benefit-driven, location-focused, speed-focused), and calls-to-action observed.n3.  **Common Outline Sections/Topics:** Identify frequently recurring sections (based on H2s/H3s) across competitors (e.g., "What is X?", "Our Process", "Pricing", "Why Choose Us", "FAQs", specific service features/types).n4.  **Key Heading Concepts (from N-grams):** List the most prominent and recurring 2, 3, and 4-word phrases found in competitor headings. Highlight concepts that appear critical for demonstrating topic relevance.n5.  **Structural &amp; Content Element Observations:** Note any common patterns in page structure (e.g., typical flow of sections), use of specific elements (e.g., lists, tables, videos, forms, calculators), and perceived content depth/length.nnStructure your entire output within a single XML tag: "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "97d45dd2-4278-4294-8759-7b076e41d684",
      "name": "User Intent Analysis",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1140,
        720
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a User Experience (UX) Researcher and Intent Analyst. Your task is to analyze the provided target query to understand the underlying user needs and expectations, completely independent of any competitor implementations.nnAnalyze the following input:n{target_query}nnGenerate a report based *only* on the query, covering:n1.  **Primary User Intent:** What is the main goal? (Informational, Navigational, Transactional, Commercial Investigation).n2.  **Secondary Intents:** What related questions or needs might the user have?n3.  **Implicit User Persona:** Describe the likely searcher (e.g., role, pain points, context).n4.  **Stage in Buyer's Journey:** (Awareness, Consideration, Decision).n5.  **Expected Services/Content:** What specific services or information types would this user logically expect to find on a page satisfying their intent?n6.  **Problem/Solution Framing:** How should the user's core problem be articulated, and how should a service be positioned as the solution for this specific query?nnStructure your entire output within a single XML tag: "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "731d7b56-fa16-4f7d-a1af-f7908664e477",
      "name": "Synthesis &amp; Gap Analysis",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        500,
        1060
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}nn{{ $('Set Competitor Analysis').first().json['Competitor Analysis Report'] }}nnn{{ $('Set User Intent Analysis').first().json['User Intent Analysis Report'] }}n",
        "messages": {
          "messageValues": [
            {
              "message": "=You are an SEO Content Strategist and UX Architect. Your task is to synthesize the findings from the competitor analysis and the user intent analysis to identify strategic opportunities.nnAnalyze the following inputs:n{target_query}nn{competitor_analysis_report}nnn{user_intent_report}nnnGenerate a synthesis report identifying:n1.  **Content Overlaps ("Table Stakes"):** List the topics, sections, and information points that are BOTH expected by users (from user intent report) AND commonly covered by competitors (from competitor analysis). These are essential baseline requirements.n2.  **Content &amp; UX Gaps (Opportunities):** Identify user needs/expectations (from user intent report) that competitors are NOT addressing well or are missing entirely (based on competitor analysis). Highlight areas where you can provide superior value or a better user experience.n3.  **SEO Keyword/Topic Priorities:** Based on both competitor heading N-grams/themes and user intent, list the most critical keywords, concepts, and semantic topics that the page structure and content must address for relevance and ranking potential.n4.  **Potential UX/Conversion Advantages:** Suggest high-level ways to improve upon common competitor weaknesses in presentation, clarity, navigation, or calls-to-action, based on the combined analysis.nnStructure your entire output within a single XML tag: "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "144f8050-c395-4f02-a786-5dca80bf1f3b",
      "name": "Set Synthesis &amp; Gap Analysis",
      "type": "n8n-nodes-base.set",
      "position": [
        840,
        1060
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4d580b58-4843-43c1-9aa2-a46d82842465",
              "name": "Synthesis &amp; Gap Analysis",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9b5739a8-ac4a-47c5-882d-5f8ecfe08831",
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "position": [
        1020,
        1060
      ],
      "webhookId": "2231c6d5-575e-46be-b1e3-6fac3af1a830",
      "parameters": {
        "amount": "={{ $('Edit Fields').first().json['Waiting Time (Seconds)'] }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "0282d60c-c030-4ccd-8716-dd56bbc636e2",
      "name": "Google Gemini Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1160,
        1260
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "E9AQr0xc0FLNxbSQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1f156e28-7b4c-441d-9626-7762d47acd93",
      "name": "Ideal Page Outline Generation",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1200,
        1060
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}nn{{ $('Set Synthesis &amp; Gap Analysis').first().json['Synthesis &amp; Gap Analysis'] }}nn{{ $('Start').first().json['Is Homepage?'] }}n{{ $('Start').first().json['Brand Name'] }}nn{{ $('Start').first().json['Services Offered'] }}n",
        "messages": {
          "messageValues": [
            {
              "message": "=You are an SEO Content Architect, Information Designer, **and Conversion-Focused Structuring Expert.** Your task is to create the optimal page outline (H1, H2s, H3s, potentially H4s) for the target query, based on the strategic insights from the synthesis and gap analysis. The outline must satisfy user intent, incorporate SEO best practices derived from competitors, provide a logical user experience, **and be structured to effectively persuade and convert visitors.**nnAnalyze the following inputs:n{target_query}nn{synthesis_and_gap_analysis}nn{is_homepage}n{brand_name}n{services_offered}nnBased on the inputs, generate a recommended page outline:n1.  **H1:** Propose a compelling, keyword-rich, **and benefit-oriented** H1 tag.n2.  **Logical &amp; Persuasive Section Flow (H2s):** Structure the main sections (H2s) in a sequence that guides the user naturally (e.g., addressing the problem, introducing the solution/value proposition, detailing the service &amp; benefits, building trust/credibility, addressing potential objections, clear call to action path).n    *   Incorporate the "Table Stakes" sections identified in the synthesis.n    *   Strategically place sections that address the identified "Gaps" to offer unique value.n    *   **Ensure key persuasive elements are included as distinct sections or integrated strategically:** Strong Value Proposition, Key Benefits/Outcomes, Social Proof (e.g., Testimonials/Case Studies placeholder), How it Works/Process, Pricing/Investment (or how pricing is determined), Why Choose Us/Unique Differentiators.n3.  **Detailed Sub-sections (H3s/H4s):** Flesh out each H2 section with relevant H3s (and H4s if needed) that cover specific details, features, benefits, process steps, etc. Naturally weave in the "SEO Keyword/Topic Priorities" identified in the synthesis within these headings. **Ensure H3s under benefit/value sections clearly articulate positive outcomes for the user.**n4.  **Homepage Consideration:** If  is "Yes", adjust the structure to be broader, potentially summarizing multiple services and directing users deeper, while still strongly addressing the core  intent **and presenting a compelling overall brand value proposition.** If "No", keep it focused specifically on the service related to the query.n5.  **Justification:** Briefly explain the rationale behind the placement and content focus of major H2 sections, linking back to user intent, competitor insights, gap-filling, **and persuasive flow.**nnStructure your entire output within a single XML tag: "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "95003089-66bc-4c5c-b281-71009be099ea",
      "name": "Set Page Outline",
      "type": "n8n-nodes-base.set",
      "position": [
        1560,
        1060
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7c205f79-bdaf-4fd5-8fae-14713a0d2eff",
              "name": "Page Outline",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e101cf81-973a-44af-8c7c-3c316398ccda",
      "name": "Wait3",
      "type": "n8n-nodes-base.wait",
      "position": [
        1740,
        1060
      ],
      "webhookId": "2231c6d5-575e-46be-b1e3-6fac3af1a830",
      "parameters": {
        "amount": "={{ $('Edit Fields').first().json['Waiting Time (Seconds)'] }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "bd098536-18dd-4f23-98da-d86c3f0baf2a",
      "name": "Google Gemini Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        500,
        1540
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "5429f86e-2883-4547-a69f-dd8c356b0247",
      "name": "UX, Conversion &amp; Copywriting Enhancement",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        600,
        1400
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}nn{{ $('Set Page Outline').first().json['Page Outline'] }}nnn{{ $('Set User Intent Analysis').first().json['User Intent Analysis Report'] }}nn{{ $('Start').first().json['Brand Name'] }}nn{{ $('Start').first().json['Services Offered'] }}n",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a Conversion Rate Optimization (CRO) Specialist and UX Copywriter. Your task is to take the recommended page outline and layer on specific, actionable recommendations to maximize user experience, conversions, and persuasive communication.nnAnalyze the following inputs:n{target_query}nn{recommended_page_outline}nnn{user_intent_report} <!-- Reference for user needs/pain points -->nn{brand_name}n{services_offered} <!-- Reference for service specifics -->nnBased on the inputs, provide detailed recommendations covering:n1.  **Calls-to-Action (CTAs):**n    *   Suggest specific wording for Primary and Secondary CTAs relevant to the service and user journey stage.n    *   Recommend optimal placement within the proposed outline (e.g., above the fold, after key sections, end of page).n    *   Advise on visual prominence/design.n2.  **Trust Signals:** Recommend specific types of trust signals (e.g., testimonials, case studies, logos, certifications, guarantees, team bios) and suggest where they should be integrated into the outline structure. Tailor suggestions to the likely concerns of the user persona identified in the .n3.  **Copywriting &amp; Tone:**n    *   Advise on the overall tone of voice (e.g., professional, empathetic, urgent, reassuring) suitable for the  and .n    *   Emphasize using benefit-driven language (translating service features into user outcomes) throughout the content. Provide examples related to .n    *   Suggest how to address user pain points (from ) directly in the copy.n4.  **Visual &amp; Interactive Elements:** Recommend types of visuals (e.g., high-quality photos, videos, infographics, icons) or interactive elements (e.g., calculators, quizzes, forms) that would enhance understanding, engagement, and trust, suggesting where they fit within the outline.n5.  **Risk Reversal:** Suggest potential guarantees, free consultations, trials, or clear explanations of processes that can reduce perceived risk for the user.n6.  **Readability &amp; UX:** Reinforce the importance of short paragraphs, bullet points, clear headings (already outlined), whitespace, and mobile responsiveness.nnStructure your entire output within a single XML tag: "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "4478e4a6-604b-4a5c-a7a8-bfadcbf0103d",
      "name": "Set UX &amp; Conversions Enhancements",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        1400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a35489c5-7db5-4d5e-8a3a-9a27ea21c241",
              "name": "UX &amp; Conversions Enhancements",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1e9482a5-6b59-456c-8a92-49cdea47e973",
      "name": "Google Gemini Chat Model5",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1100,
        1560
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/{{ $('Edit Fields').first().json['Google Gemini Model'] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "de163dd6-9e8b-462e-a125-84dfdfbff8ab",
      "name": "Final Service Page Blueprint",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1160,
        1400
      ],
      "parameters": {
        "text": "={{ $('Start').first().json['Target Keyword'] }}n{{ $('Start').first().json['Brand Name'] }}nn{{ $('Start').first().json['Services Offered'] }}nn{{ $('Start').first().json['Is Homepage?'] }}nn{{ $('Set Competitor Analysis').first().json['Competitor Analysis Report'] }}nnn{{ $('Set User Intent Analysis').first().json['User Intent Analysis Report'] }}nnn{{ $('Set Synthesis &amp; Gap Analysis').first().json['Synthesis &amp; Gap Analysis'] }}nnn{{ $('Set Page Outline').first().json['Page Outline'] }}nnn{{ $json['UX &amp; Conversions Enhancements'] }}n",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a Senior Digital Marketing Strategist. Your final task is to compile all the preceding analyses and recommendations into a single, comprehensive, and actionable Service Page Blueprint. This document will serve as the definitive guide for creating the page.nnImportant Context: Remember, this blueprint is for a service page. While comprehensive analysis is crucial, the final page structure and content recommendations should prioritize clarity, conciseness, and a direct path towards user action or conversion, rather than exhaustive detail suitable for a long-form blog post.nnConsolidate the following inputs:n{target_query}n{brand_name}n{services_offered}n{is_homepage}nn{competitor_analysis_report}nnn{user_intent_report}nnn{synthesis_and_gap_analysis}nnn{recommended_page_outline}nnn{ux_conversion_copy_recommendations}nnn**Output Requirements:**nn*   Generate the final blueprint entirely in **Markdown format**.n*   Enclose the *entire* Markdown output within a single XML tag: ``.n*   **Do NOT use any XML tags *inside* the `` tag.** Use Markdown headings (`#`, `##`, `###`) to structure the content as specified below.n*   Ensure the final output is highly readable, well-organized, and suitable for direct presentation to a client.nn**Blueprint Structure (Use Markdown Headings):**nn#   **1. Executive Summary**n    *   Briefly state the target query, the primary user intent, and the overall strategy for the page (e.g., "Create a focused service page for '{target_query}' targeting users with [primary intent]. The strategy is to highlight [key benefit/service aspect], address the common gap of [identified gap], aiming to outperform competitors by offering [unique value proposition] and convert users seeking [user goal]."). Reference `{brand_name}` where appropriate.nn#   **2. User Intent Deep Dive**n    *   Summarize the key findings from the ``.n    *   Clearly state Primary and Secondary Intents.n    *   Describe the Target User Persona(s).n    *   Identify the typical User Journey Stage(s).n    *   List the Core User Needs and Pain Points this page must address.nn#   **3. Competitor Landscape Summary**n    *   Summarize the key findings from the ``.n    *   Highlight common tactics, topics covered, and keywords targeted by top competitors.n    *   Describe typical page structures and common elements observed (e.g., types of CTAs, content sections, trust signals used).nn#   **4. Strategic Opportunities &amp; Gaps**n    *   Summarize the core findings from the ``.n    *   Identify key content/feature overlaps between user intent and competitor offerings.n    *   Pinpoint specific content, angle, or feature gaps the `{brand_name}` page can exploit for differentiation.n    *   List the priority SEO elements (keywords, themes, E-E-A-T considerations) based on the analysis.nn#   **5. Recommended Page Outline**n    *   **Page Structure:**n        *   Present the recommended page structure derived from ``.n        *   Use nested Markdown headings (`H1`, `H2`, `H3`, `H4`) to represent the hierarchy.n        *   Use indentation (e.g., two spaces per level) for visual clarity.n        *   **Example Structure Format (Illustrates Formatting Only):**n            H1: Primary Headingn              H2: First Subheadingn              H2: Second Subheadingn                H3: First Sub-subheading under Second H2n                H3: Second Sub-subheading under Second H2n                  H4: Detail under Second H3n              H2: Third Subheadingn    *   **Heading Justifications:**n        *   Immediately following the structure, provide a list detailing the justification/purpose for *each* heading included in the structure above. Reference the heading text clearly. (e.g., "**H1: [Actual H1 Text]:** Justification for H1..." "**H2: [Actual H2 Text]:** Justification for H2...")nn#   **6. UX, Conversion &amp; Copywriting Plan**n    *   Consolidate and present the detailed recommendations from ``.n    *   Use subheadings (e.g., `## Calls to Action (CTAs)`, `## Trust Signals`, `## Copywriting &amp; Tone of Voice`, `## Visual Elements`, `## Risk Reversal`, `## Readability &amp; Accessibility`) for clarity.n    *   Ensure recommendations are actionable and specific to this service page.nn#   **7. Key Success Factors**n    *   Conclude with a bulleted list summarizing the 3-5 most critical elements required for this page's success.n    *   Focus on factors directly related to satisfying user intent, achieving SEO goals (ranking), and driving conversions based on the preceding analysis."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "35812205-2573-4c30-9c66-168b7af5a530",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        1400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4ec86dd3-14e7-420b-94f0-2e13b11ec622",
              "name": "Final Blueprint",
              "type": "string",
              "value": "={{ $json.text.replace(/[\s\S]*/, '').replace(/[\s\S]*/, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "780a5e01-6f26-43da-b650-5cd3cdf1cfa0",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1740,
        1400
      ],
      "parameters": {
        "options": {
          "fileName": "Blueprint.txt"
        },
        "operation": "toText",
        "sourceProperty": "Final Blueprint"
      },
      "typeVersion": 1.1
    },
    {
      "id": "008ec54d-0791-41b0-bad6-38db3ae42bde",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        500
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d279426b-1764-4989-9202-9bab9ce295fa",
              "name": "JINA Reader API Key",
              "type": "string",
              "value": "YOUR_API_KEY"
            },
            {
              "id": "74cc4b3d-6256-453c-ac16-f860c01549ec",
              "name": "Google Gemini Model",
              "type": "string",
              "value": "gemini-2.5-pro-preview-03-25"
            },
            {
              "id": "eaa9f0cb-478e-4ebc-972a-8e8bd4945602",
              "name": "Waiting Time (Seconds)",
              "type": "string",
              "value": "1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "54ad00ab-6e54-49a2-a8dc-5d258e6ae64a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 1020,
        "height": 460,
        "content": "## Generate High-Level Service Page Blueprint ReportnThis powerful workflow generates comprehensive SEO blueprints for service pages by analyzing competitor websites and user intent. By examining the structure, headings, and meta information of top-ranking competitors for a specific target keyword, the workflow creates a detailed content strategy tailored to your brand and services, designed to outperform the competition and maximize conversions.nn### Setup Instructions:n1. Create a new Jina Reader API key [here](https://jina.ai/api-dashboard/key-manager). You can claim a free API key, which allow you to use up to 1m tokens for free.  n2. Create a new Google Gemini(PaLM) credentials by following the guide [here](https://docs.n8n.io/integrations/builtin/credentials/googleai/#using-geminipalm-api-key). Please note, if you are using the free tier, you need to set the "Waiting Time" to 20s as the free tier allow a maximum of 5 requests per minute.n3. Update the node "Set Fields" with your Jina API Key. Change the Waiting Time to "20" if using free Google Gemini API key. You can change the Gemini model from here as well, in the case Gemini make changes to their Gemini models.n4. Start the form trigger and answer to the following questions:n4.1. Competitors: A list of direct competitors. Up to 5, use their direct service page URL.n4.2. Target Keyword: The query related with your service. (E.g. International accounting services, Chicago cleaning services, etc...)n4.3. Services Offered: Details your complete service offerings. This will be ensure the outline recommended align with your services.n4.4. Brand Name: The name of your brand, your company name.n4.5. Homepage: If you try to rank for a homepage, check that box.n5. Download the .txt file generated at the end, copy/paste it's content (Markdown format) and copy it [here](https://markdownlivepreview.com/). You can after copy/paste the rendered results in Gdocs and share with your client/team.nnYou can see a demo of the report [here](https://docs.google.com/document/d/1XDJV3zNB7cLPBzaMXstzEl7ZvPrjiuBbet5C5ZlC4bo/edit). "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "443f606c-8007-41cd-959e-71d17bbabec5",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "User Intent Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Synthesis &amp; Gap Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Ideal Page Outline Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait3": {
      "main": [
        [
          {
            "node": "UX, Conversion &amp; Copywriting Enhancement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Convert URLs to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Competitors Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get URL HTML": {
      "main": [
        [
          {
            "node": "Extract HTML Elements",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set URL Data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get URL HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Page Outline": {
      "main": [
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Competitors Analysis": {
      "main": [
        [
          {
            "node": "Set Competitor Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User Intent Analysis": {
      "main": [
        [
          {
            "node": "Set User Intent Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert URLs to Items": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract HTML Elements": {
      "main": [
        [
          {
            "node": "Set URL Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Competitor Analysis": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Competitors Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set User Intent Analysis": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Synthesis &amp; Gap Analysis": {
      "main": [
        [
          {
            "node": "Set Synthesis &amp; Gap Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "User Intent Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Synthesis &amp; Gap Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Ideal Page Outline Generation",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "UX, Conversion &amp; Copywriting Enhancement",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Final Service Page Blueprint",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Final Service Page Blueprint": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Synthesis &amp; Gap Analysis": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ideal Page Outline Generation": {
      "main": [
        [
          {
            "node": "Set Page Outline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set UX &amp; Conversions Enhancements": {
      "main": [
        [
          {
            "node": "Final Service Page Blueprint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UX, Conversion &amp; Copywriting Enhancement": {
      "main": [
        [
          {
            "node": "Set UX &amp; Conversions Enhancements",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}