{
  "nodes": [
    {
      "id": "3cf8e9de-6f60-48cb-b4a0-fbef30449344",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -320,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "Automatic SEO Report",
        "formFields": {
          "values": [
            {
              "fieldName": "url",
              "fieldLabel": "What the URL you want to analyze?",
              "placeholder": "e.g. https://your-website.com",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Generate a full SEO report of a URL using AI"
      },
      "typeVersion": 2.5
    },
    {
      "id": "f18990ba-5519-4824-947f-34ba994ae7b5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        224,
        0
      ],
      "parameters": {
        "text": "=Here's the website HTML content: \n```html\n{{ $json.data.replace(/<script[\\s\\S]*?<\\/script>/gi, '').replace(/<style[\\s\\S]*?<\\/style>/gi, '').replace(/<noscript[\\s\\S]*?<\\/noscript>/gi, '').replace(/<svg[\\s\\S]*?<\\/svg>/gi, '').replace(/<!--[\\s\\S]*?-->/g, '').replace(/ (class|style|onclick|onload|onerror|data-[\\w-]+)=\"[^\"]*\"/gi, '').replace(/ (class|style|onclick|onload|onerror|data-[\\w-]+)='[^']*'/gi, '').replace(/\\s{2,}/g, ' ').replace(/>\\s+</g, '><').trim()}}\n```",
        "options": {
          "systemMessage": "You are a senior SEO analyst. Analyze this company website HTML content provided and generate a comprehensive SEO audit report.\n\nStructure your analysis in these sections:\n1. **Overall Score** (0-100) with a brief summary\n2. **Title Tag Analysis** \u2014 current title, length, recommendations\n3. **Meta Description** \u2014 current description, length, recommendations\n4. **Heading Structure** \u2014 H1-H6 hierarchy, issues found\n5. **Content Analysis** \u2014 word count, keyword density, readability\n6. **Technical SEO** \u2014 canonical tags, Open Graph, schema markup\n7. **Top 5 Recommendations** \u2014 prioritized action items\n\nFormat your response as clean, professional and semantic HTML ready for PDF generation.\nFollow PDF best practices from https://github.com/pdfnoodle/pdf-best-practices:\n- Use proper page-break-inside: avoid on content blocks\n- Include print-friendly CSS\n- Use A4-compatible margins and sizing\n- Avoid content that would split awkwardly across pages\n\nReturn only the complete HTML document inside <html></html> tags. No markdown fences, no explanations, no JSON wrapper \u2014 just the raw HTML string."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "4b09e212-676a-4c1f-8b7f-bdb30bb5a495",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        224,
        192
      ],
      "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": "3b3e548d-09ff-4910-ae1c-4f745091eec6",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        576,
        0
      ],
      "parameters": {
        "options": {
          "encoding": "utf8",
          "fileName": "index.html"
        },
        "operation": "toText",
        "sourceProperty": "=output"
      },
      "typeVersion": 1.1
    },
    {
      "id": "13cf480f-1f25-4da4-9d3e-77fc338cb9aa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        -80
      ],
      "parameters": {
        "width": 420,
        "height": 504,
        "content": "## Welcome to the SEO PDF Report Generator with AI Workflow!\n\n**This workflow has the following sequence:**\n1. Form submission trigger (pass the URL you want to analyze)\n2. Extract and sanitize the HTML content from the URL\n3. AI Agent analyzes the HTML and generates a comprehensive SEO report in HTML format (using Anthropic)\n4. Convert the HTML output to a file (index.html) for Gotenberg\n5. HTTP Request to Gotenberg to convert HTML to PDF\n\n\n**The following accesses are required for the workflow:**\n- Anthropic API key (or swap for OpenAI, Google, Ollama)\n- Gotenberg instance (demo URL included for testing \u2014 see the Gotenberg node notes for setup options)\n\n\nYou can contact me via LinkedIn if you have any questions: https://www.linkedin.com/in/marceloamiranda"
      },
      "typeVersion": 1
    },
    {
      "id": "bb3db19e-770e-4967-b48d-d3f8baaf0ed9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 256,
        "content": "### 1. Passing the URL for analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "1f50d1c3-6212-43b5-a107-73e897201ea9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 432,
        "content": "### 2. Generating the HTML of the SEO report with an AI Agent"
      },
      "typeVersion": 1
    },
    {
      "id": "a0494128-f1f3-4cd2-8c7d-d64cb265b034",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 432,
        "content": "### 3. Generating the HTML file for gotenberg"
      },
      "typeVersion": 1
    },
    {
      "id": "cb570613-cba8-48f6-87b0-a278143cac2d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 256,
        "content": "### 4. Using gotenberg to convert HTML to PDF"
      },
      "typeVersion": 1
    },
    {
      "id": "39add221-7c4b-4971-8405-0bda7151a41d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        192
      ],
      "parameters": {
        "color": 6,
        "width": 768,
        "height": 736,
        "content": "#### GOTENBERG API CALL \ud83d\udca1\n\nThis node sends your HTML file to Gotenberg for PDF conversion.\n\n**IMPORTANT:**\nThe default URL is `https://demo.gotenberg.dev`. This is a public test instance with rate limits \u2014 **do not use in production**.\n\nFor production, you have two options:\n\n**Option 1 \u2014 Docker (if you self-host n8n):**\nYou need Gotenberg running alongside n8n. The simplest way is adding it as a service in your `docker-compose.yml` \u2014 the same file where your n8n service is defined:\n```yaml\nservices:\n  # ... your n8n service ...\n  gotenberg:\n    image: gotenberg/gotenberg:8\n    restart: always\n```\n\nAfter saving, run `docker compose up -d` to restart your stack. Gotenberg will be accessible at `http://gotenberg:3000` from inside your n8n container \u2014 just update the URL in this node.\n\n**Option 2 \u2014 Google Cloud Run (if you use n8n Cloud or don't have access to Docker):**\nDeploy the `gotenberg/gotenberg:8` image to Google Cloud Run and use the generated URL as your Gotenberg endpoint.\n\n**Customization:**\nYou can configure PDF output settings through the Body Parameters of this node, including:\n- Page margins (top, bottom, left, right)\n- Default headers and footers\n- PDF metadata (author, title, subject, etc.)\n\nFor the full list of available options, check the [Gotenberg documentation](https://gotenberg.dev/docs/routes#convert-with-chromium)."
      },
      "typeVersion": 1
    },
    {
      "id": "0c571ba2-ae9f-49da-b22a-0b5b368955f7",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 256,
        "content": "### 2. Extracting HTML from URL"
      },
      "typeVersion": 1
    },
    {
      "id": "753e8d17-58a7-4463-b586-8f302e36a331",
      "name": "Extracting HTML from URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        0
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "da53550d-10ef-46ee-81ab-b47efce70480",
      "name": "Using Gotenberg",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        0
      ],
      "parameters": {
        "url": "https://demo.gotenberg.dev/forms/chromium/convert/html",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "files",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "content-type",
              "value": "multipart/form-data"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "8cd124f2-e14c-4a07-bc5c-4015b66a2df7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -704
      ],
      "parameters": {
        "color": 4,
        "width": 1008,
        "height": 592,
        "content": "@[youtube](gl1zdyvqHiQ)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Using Gotenberg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Extracting HTML from URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extracting HTML from URL": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}