{
  "id": "youmS3CDd7bKSGFe",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Generate SEO audit reports from a web form with GPT-5 mini and Gmail",
  "tags": [],
  "nodes": [
    {
      "id": "c140e25f-edc0-48ed-ac34-b88f47ecec4d",
      "name": "Audit request form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        32,
        384
      ],
      "parameters": {
        "options": {
          "ignoreBots": true,
          "buttonLabel": "Get my free SEO audit",
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "Your SEO audit is on its way! Check your inbox in the next few minutes."
            }
          }
        },
        "formTitle": "Free AI SEO Audit",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Landing Page URL",
              "placeholder": "https://example.com",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Your Email",
              "placeholder": "user@example.com",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Your landing page is leaking traffic. Paste your URL and get a full on-page SEO audit in your inbox in minutes."
      },
      "typeVersion": 2.6
    },
    {
      "id": "660c35ed-59b2-4029-ae0e-9a5da1ca0e7a",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        384
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-page-url",
              "name": "page_url",
              "type": "string",
              "value": "={{ $json['Landing Page URL'] }}"
            },
            {
              "id": "cfg-recipient",
              "name": "recipient_email",
              "type": "string",
              "value": "={{ $json['Your Email'] }}"
            },
            {
              "id": "cfg-model",
              "name": "openai_model",
              "type": "string",
              "value": "gpt-5-mini"
            },
            {
              "id": "cfg-language",
              "name": "output_language",
              "type": "string",
              "value": "English"
            },
            {
              "id": "cfg-reco-count",
              "name": "number_of_recommendations",
              "type": "number",
              "value": 10
            },
            {
              "id": "cfg-max-chars",
              "name": "max_html_chars",
              "type": "number",
              "value": 100000
            },
            {
              "id": "cfg-subject",
              "name": "email_subject_prefix",
              "type": "string",
              "value": "Your free on-page SEO audit"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "decfda1d-a767-43b4-9e9a-263499035368",
      "name": "Scrape landing page",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 2,
      "position": [
        464,
        400
      ],
      "parameters": {
        "url": "={{ $json.page_url }}",
        "options": {
          "timeout": 30000,
          "redirect": {
            "redirect": {
              "maxRedirects": 10
            }
          },
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.4
    },
    {
      "id": "732bc7f0-c89a-49d0-98b3-acb1f5a9a412",
      "name": "Run technical SEO audit",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        912,
        128
      ],
      "parameters": {
        "text": "=You are a world-class technical SEO expert.\n\nAnalyze the raw HTML source code below and produce a structured on-page technical SEO audit written in {{ $(\"Configuration\").first().json.output_language }}.\n\nStart your answer with the heading \"## Technical SEO audit\".\n\nOrganize your findings into 3 sections:\n- Critical issues (must be fixed immediately)\n- Quick wins (easy fixes with big impact)\n- Opportunities for improvement (more effort, real upside)\n\nCheck at minimum: title tag, meta description, heading hierarchy, canonical tag, robots meta, Open Graph tags, structured data (JSON-LD), image alt attributes, internal links, mobile viewport, page weight signals.\n\nFinish with a prioritized action plan containing the top {{ $(\"Configuration\").first().json.number_of_recommendations }} recommendations.\n\nOutput clean Markdown only. Do not include any introductory or closing text.\n\nHTML source code:\n{{ $json.data.slice(0, $(\"Configuration\").first().json.max_html_chars) }}",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "a570a48c-9974-4e07-af7d-930a560504f2",
      "name": "OpenAI model (technical)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        912,
        288
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Configuration\").first().json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b7e3762e-c600-4a2c-addd-20c41cb82804",
      "name": "Combine both audits",
      "type": "n8n-nodes-base.merge",
      "position": [
        1264,
        336
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "43babd24-5ae6-4e13-bab5-a727f0f28825",
      "name": "Extract page content",
      "type": "n8n-nodes-base.html",
      "position": [
        672,
        512
      ],
      "parameters": {
        "options": {
          "trimValues": true,
          "cleanUpText": true
        },
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "page_title",
              "cssSelector": "title"
            },
            {
              "key": "meta_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "h1_headings",
              "cssSelector": "h1",
              "returnArray": true
            },
            {
              "key": "body_text",
              "cssSelector": "body",
              "skipSelectors": "script,style,noscript,svg,iframe"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6af6bfb1-b953-47f5-b83c-b2a4c1f5c369",
      "name": "Run content SEO audit",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        896,
        512
      ],
      "parameters": {
        "text": "=You are a world-class SEO content strategist.\n\nWrite a structured on-page content SEO audit in {{ $(\"Configuration\").first().json.output_language }} for the page below.\n\nStart your answer with the heading \"## Content SEO audit\".\n\nCover:\n- Content quality and search intent match\n- Primary and secondary keywords (current targeting and gaps)\n- Readability assessment\n- Headings and content structure\n- Trust and conversion signals\n\nFinish with the top {{ $(\"Configuration\").first().json.number_of_recommendations }} prioritized, actionable recommendations as bullet points.\n\nOutput clean Markdown only. Do not include any introductory or closing text.\n\nPage title: {{ $json.page_title }}\nMeta description: {{ $json.meta_description }}\nH1 headings: {{ $json.h1_headings }}\n\nPage content:\n{{ ($json.body_text || \"\").slice(0, $(\"Configuration\").first().json.max_html_chars) }}",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "823d08c3-cbfb-4fa1-80eb-9137e92d2a1f",
      "name": "OpenAI model (content)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Configuration\").first().json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e6319261-8563-43d9-bf10-0bc377a5b1bf",
      "name": "Aggregate audit sections",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1488,
        336
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "text"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5372be9b-5582-45fd-b405-390d7c5e7677",
      "name": "Build HTML report",
      "type": "n8n-nodes-base.markdown",
      "position": [
        1712,
        336
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {
          "tables": true,
          "simpleLineBreaks": false
        },
        "markdown": "=# On-page SEO audit\n\nAudited page: {{ $(\"Configuration\").first().json.page_url }}\n\n{{ $json.text[0] }}\n\n---\n\n{{ $json.text[1] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "65cb511b-e736-4c1a-9d0d-3542a5eb4e6f",
      "name": "Email the audit report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1952,
        336
      ],
      "parameters": {
        "sendTo": "={{ $(\"Configuration\").first().json.recipient_email }}",
        "message": "={{ $json.data }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $(\"Configuration\").first().json.email_subject_prefix }} - {{ $(\"Configuration\").first().json.page_url }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "40e94553-74e5-4125-b4ef-298ff929bc2e",
      "name": "Log the lead in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        2160,
        336
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "SEO audit leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "6f524db3-d56f-443e-98be-36dc28827903",
      "name": "Sticky Note 674dca4c",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -512
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 1756,
        "content": "# Generate SEO audit reports from a web form with GPT-5 mini and Gmail\n# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Course-Generate-SEO-audit-reports-from-a-web-form-with-GPT-5-mini-and-Gmail-39d3d6550fd9815e99dfc72a5e05e0ea)\n\n## How it works\n1. A visitor submits their landing page URL and email in a hosted n8n form.\n2. The workflow fetches the raw HTML of the page and extracts the readable content (title, meta description, headings, body text).\n3. Two AI chains run on the same page: a technical on-page audit on the HTML source, and a content and keyword audit on the extracted text.\n4. Both audits are combined into a single HTML report and emailed to the visitor with Gmail.\n5. Every request is logged as a lead in Google Sheets (date, URL, email), turning the audit into a lead magnet.\n\n## Setup\n1. Select your OpenAI credential on both OpenAI model nodes.\n2. Select your Gmail credential on the \"Email the audit report\" node.\n3. Select your Google Sheets credential and pick your leads spreadsheet and tab on \"Log the lead in Google Sheets\" (columns: audited_at, page_url, email).\n4. Open the \"Configuration\" node to adjust the AI model, output language, number of recommendations and email subject.\n5. Activate the workflow and share the production form URL.\n\n## Requirements\n- An OpenAI API credential\n- A Gmail OAuth2 credential\n- A Google Sheets OAuth2 credential and a spreadsheet with the headers audited_at, page_url, email\n\n## Customization\n- Change `openai_model`, `output_language`, `number_of_recommendations` or `max_html_chars` in the Configuration node - it is the single place to configure the workflow.\n- Edit the audit prompts inside the two Basic LLM Chain nodes.\n- Replace Gmail with SMTP or Outlook, or Google Sheets with Airtable.\n\nNeed help customizing?\nContact me for consulting and support : [Linkedin](https://www.linkedin.com/in/doctor-firass/)\n\n# MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new YouTube channel](https://www.youtube.com/@DrFiras_AI). Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.\n\n[![The AI Doctor](https://www.dr-firas.com/the-ai-doctor.png)](https://www.youtube.com/@DrFiras_AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "86c0d8a4-d234-40b1-85b9-dca1bf20199f",
      "name": "Sticky Note f7d10c04",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 460,
        "height": 320,
        "content": "## 1. Lead capture form\nThe visitor enters a landing page URL and their email. All adjustable variables live in the \"Configuration\" node - edit them there only."
      },
      "typeVersion": 1
    },
    {
      "id": "e382616c-7821-4fe2-a919-bbcab8f6719f",
      "name": "Sticky Note cadb0180",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 520,
        "content": "## 2. Scrape and extract\nFetches the raw HTML of the page, then extracts the title, meta description, H1 headings and clean body text for the content audit."
      },
      "typeVersion": 1
    },
    {
      "id": "452e7734-eb1c-4c6c-8150-02a364c88f27",
      "name": "Sticky Note ed725e9c",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 330,
        "height": 980,
        "content": "## 3. AI SEO audits\nSelect your OpenAI credential on both model nodes. One chain audits the technical HTML, the other audits the content and keywords. One run costs a few cents with gpt-5-mini."
      },
      "typeVersion": 1
    },
    {
      "id": "105339c7-bbf2-4a61-8b9e-739778462922",
      "name": "Sticky Note 8798853f",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 1140,
        "height": 320,
        "content": "## 4. Report and lead logging\nCombines both audits into one HTML email sent to the visitor with Gmail, then logs the lead (date, URL, email) in Google Sheets."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "817abc51-f185-4f11-a528-4179a87fd1d9",
  "nodeGroups": [],
  "connections": {
    "Configuration": {
      "main": [
        [
          {
            "node": "Scrape landing page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build HTML report": {
      "main": [
        [
          {
            "node": "Email the audit report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audit request form": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine both audits": {
      "main": [
        [
          {
            "node": "Aggregate audit sections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape landing page": {
      "main": [
        [
          {
            "node": "Run technical SEO audit",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract page content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract page content": {
      "main": [
        [
          {
            "node": "Run content SEO audit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run content SEO audit": {
      "main": [
        [
          {
            "node": "Combine both audits",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Email the audit report": {
      "main": [
        [
          {
            "node": "Log the lead in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI model (content)": {
      "ai_languageModel": [
        [
          {
            "node": "Run content SEO audit",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Run technical SEO audit": {
      "main": [
        [
          {
            "node": "Combine both audits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate audit sections": {
      "main": [
        [
          {
            "node": "Build HTML report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI model (technical)": {
      "ai_languageModel": [
        [
          {
            "node": "Run technical SEO audit",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}