{
  "id": "",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Run automated technical SEO audits with SE Ranking",
  "tags": [],
  "nodes": [
    {
      "id": "3b3dd901-ad80-4778-893a-75488fd1dd2b",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        256
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 884,
        "content": "## Run automated technical SEO audits\n\n## Who is this for\n- SEO agencies auditing client sites\n- Web developers checking pre-launch SEO\n- Website owners monitoring site health\n\n## What you'll get\n- Overall health score (0-100)\n- Errors, warnings, and notices by category\n- Audit history tracking in Google Sheets\n- Trend analysis over time (last 10 audits)\n\n## How it works\n1. Starts new audit for your domain\n2. Waits for crawl to finish (~5 min)\n3. Checks status\u2014retries if not done\n4. Pulls full report with health score\n5. Fetches last 10 audits for trend tracking\n6. Exports audit history to Google Sheets\n\n## Setup steps\n1. Install [SE Ranking node](https://www.npmjs.com/package/@seranking/n8n-nodes-seranking)\n2. Add SE Ranking API credentials\n3. Replace `example.com` with your domain\n4. Connect Google Sheets (optional)\n5. Select your spreadsheet for export\n\n## Customization\n- Change domain in Create audit node\n- Add Schedule Trigger for weekly runs\n- Adjust wait times for large sites"
      },
      "typeVersion": 1
    },
    {
      "id": "9f5d8abc-b0d3-47dc-9b37-a426ca284bf8",
      "name": "Step 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        848
      ],
      "parameters": {
        "color": 4,
        "width": 700,
        "height": 80,
        "content": "### \ud83d\udd0d Run Audit & Wait"
      },
      "typeVersion": 1
    },
    {
      "id": "bfa087ce-7c7a-4437-9575-221b70e9f0a7",
      "name": "Step 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2384,
        832
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "height": 80,
        "content": "### \ud83d\udcca Get Report & Last 10 reports\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b836ce13-5782-420d-8c85-6713f18d44fc",
      "name": "Step 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        848
      ],
      "parameters": {
        "color": 4,
        "width": 308,
        "height": 80,
        "content": "### \ud83d\udce4 Export to Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "128fcad7-c904-4ad8-a6d7-7d52a50298dd",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1216,
        944
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "39bb9fa9-68b6-406d-93d4-b9243f1b0f2d",
      "name": "Create standard audit",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        1440,
        944
      ],
      "parameters": {
        "domain": "example.com",
        "resource": "websiteAudit",
        "operation": "createStandard",
        "additionalFields": {
          "title": "Weekly Technical SEO Audit"
        }
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "43b523b2-cb28-4d53-a73d-8978c3159bd4",
      "name": "Wait for crawl (5 min)",
      "type": "n8n-nodes-base.wait",
      "position": [
        1664,
        944
      ],
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    },
    {
      "id": "9803b991-8155-4725-b55b-27ab6e5ad087",
      "name": "Check audit status",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        1888,
        944
      ],
      "parameters": {
        "auditId": "={{ $('Create standard audit').item.json.id }}",
        "resource": "websiteAudit",
        "operation": "getStatus"
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5fd3d6f8-6974-49c1-8fc0-4e39fa5f662b",
      "name": "If audit complete",
      "type": "n8n-nodes-base.if",
      "position": [
        2112,
        944
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "status-condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "finished"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e8e396e2-a8ca-47ab-a71b-0a17eabfeef6",
      "name": "Get audit report",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        2352,
        944
      ],
      "parameters": {
        "auditId": "={{ $('Create standard audit').item.json.id }}",
        "resource": "websiteAudit",
        "operation": "getReport"
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "059d077d-0e3b-421d-a19f-8eec7a42e120",
      "name": "Wait and retry (2 min)",
      "type": "n8n-nodes-base.wait",
      "position": [
        2112,
        1088
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "71a1db8e-f134-4fa0-bfd3-89a9d506f48b",
      "name": "List all audits for domain",
      "type": "@seranking/n8n-nodes-seranking.seRanking",
      "position": [
        2576,
        944
      ],
      "parameters": {
        "resource": "websiteAudit",
        "additionalFields": {
          "limit": 10,
          "search": "={{ $('Create standard audit').item.json.domain }}"
        }
      },
      "credentials": {
        "seRankingApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3bc8fd02-11aa-46e4-a962-96b0d8ca01fd",
      "name": "Format audits for Sheet",
      "type": "n8n-nodes-base.code",
      "position": [
        2800,
        944
      ],
      "parameters": {
        "jsCode": "// Format audit history for Google Sheets\nconst items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n  const audits = item.json.items || [item.json];\n  \n  for (const audit of audits) {\n    results.push({\n      json: {\n        audit_id: audit.id,\n        domain: audit.url?.replace(/^https?:\\/\\//, '') || '',\n        title: audit.title || '',\n        last_update: audit.last_update || '',\n        status: audit.status || '',\n        health_score: audit.stats?.score || 0,\n        errors: audit.stats?.errors || 0,\n        warnings: audit.stats?.warnings || 0,\n        notices: audit.stats?.notices || 0,\n        pages_crawled: audit.stats?.crawled || 0\n      }\n    });\n  }\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "b469a5ed-c38c-4f34-9c58-f6dc3d5de6ff",
      "name": "Export to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3024,
        944
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "audit_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "audit_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_update",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "last_update",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "health_score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "health_score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "errors",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "errors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "warnings",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "warnings",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "notices",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "notices",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pages_crawled",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "pages_crawled",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Get audit report": {
      "main": [
        [
          {
            "node": "List all audits for domain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If audit complete": {
      "main": [
        [
          {
            "node": "Get audit report",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait and retry (2 min)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check audit status": {
      "main": [
        [
          {
            "node": "If audit complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create standard audit": {
      "main": [
        [
          {
            "node": "Wait for crawl (5 min)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait and retry (2 min)": {
      "main": [
        [
          {
            "node": "Check audit status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for crawl (5 min)": {
      "main": [
        [
          {
            "node": "Check audit status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format audits for Sheet": {
      "main": [
        [
          {
            "node": "Export to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List all audits for domain": {
      "main": [
        [
          {
            "node": "Format audits for Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Create standard audit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}