{
  "id": "Lwatm8WTAXDtGuDt",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Backlink Monitoring & SEO Intelligence with SE Ranking + OpenAI GPT-4.1-mini",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    },
    {
      "id": "ZOwtAMLepQaGW76t",
      "name": "Building Blocks",
      "createdAt": "2025-04-13T15:23:40.462Z",
      "updatedAt": "2025-04-13T15:23:40.462Z"
    },
    {
      "id": "ddPkw7Hg5dZhQu2w",
      "name": "AI",
      "createdAt": "2025-04-13T05:38:08.053Z",
      "updatedAt": "2025-04-13T05:38:08.053Z"
    }
  ],
  "nodes": [
    {
      "id": "1f43c277-363d-429a-a659-bb3aa6144e2f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        240,
        -32
      ],
      "parameters": {
        "text": "={{ $json.query }}\n\nDo not include your own thoughts or suggestions",
        "options": {},
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "fef3b474-1c5e-4fb9-b143-73f370ee968a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -96,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "99678379-f85d-4883-b4ae-29d86311b022",
      "name": "HTTP Request for Backlink Summary",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        112,
        224
      ],
      "parameters": {
        "url": "https://api.seranking.com/v1/backlinks/summary",
        "options": {
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        },
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "target",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            },
            {
              "name": "mode",
              "value": "host"
            },
            {
              "name": "output",
              "value": "json"
            }
          ]
        },
        "toolDescription": "Returns the extended statistics for the target, such as: number of backlinks to the target, number of referring domains, subnets, IPs, top anchors, top TLDs, etc. This command supports batching multiple targets into a single request. If you need to make a batch request and get metrics for multiple targets (100 maximum), pass multiple targets as GET parameters (separated by \u2018&\u2019) or use a POST request."
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "e35b0898-c899-40cb-a282-979d721b3092",
      "name": "HTTP Request for Backlink Metrics",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        320,
        224
      ],
      "parameters": {
        "url": "https://api.seranking.com/v1/backlinks/metrics",
        "options": {
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        },
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "target",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            },
            {
              "name": "mode",
              "value": "domain"
            },
            {
              "name": "output",
              "value": "json"
            }
          ]
        },
        "toolDescription": "Returns the extended statistics for the target, such as: number of backlinks to the target, number of referring domains, subnets, IPs, top anchors, top TLDs, etc. This command supports batching multiple targets into a single request. If you need to make a batch request and get metrics for multiple targets (100 maximum), pass multiple targets as GET parameters (separated by \u2018&\u2019) or use a POST request."
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "daf1b63c-b653-4be3-bbb2-9fdc90349640",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 304,
        "content": "## SE Ranking Backlinks API\n\nThe Backlinks API retrieves backlink data for a target domain, host, or URL. It provides aggregated metrics such as counts of backlinks, referring domains, IPs, and subnets, as well as anchor texts, top pages, TLDs, and countries. \n\nThe API includes endpoints for summary metrics, historical data, raw backlink lists, export options, and authority scores. Data is refreshed on a monthly basis."
      },
      "typeVersion": 1
    },
    {
      "id": "b6b40bad-08b4-4d55-90d0-e70cd3413dc1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -368
      ],
      "parameters": {
        "width": 432,
        "height": 768,
        "content": "## **How It Works**\nThis n8n workflow automates backlink monitoring, analysis, and AI-driven interpretation for any domain or URL. It combines backlink intelligence from SE Ranking with structured reasoning and summarization powered by OpenAI.\n\n## **Setup Instructions**\n\n1. Configure SE Ranking API credentials using HTTP Header Authentication.\n2. Configure OpenAI credentials and select the GPT-4.1-mini model.\n3. (Optional) Connect Google Sheets credentials for data storage.\n4. Open the **Set Input Fields** node and enter your target domain or URL.\n5. Verify storage destinations (DataTable, Sheet, CSV/JSON export).\n6. Click **Execute Workflow** to run the automation.\n\n## **Customize**\n\n1. Change the analysis scope between domain, host, or URL.\n2. Adjust the AI prompt to generate alerts, risk signals, or link quality insights.\n3. Add scheduling to run the workflow automatically.\n4. Replace export nodes with databases, BI tools, or notifications.\n5. Extend the workflow to include competitor or historical backlink analysis.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "55800380-e03c-425a-918b-991a5b263a10",
      "name": "HTTP Request for All Backlinks",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        512,
        224
      ],
      "parameters": {
        "url": "https://api.seranking.com/v1/backlinks/all",
        "options": {
          "redirect": {}
        },
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "target",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            },
            {
              "name": "mode",
              "value": "url"
            },
            {
              "name": "output",
              "value": "json"
            }
          ]
        },
        "toolDescription": "Returns information about backlinks pointing to a target.\n\nThe command supports both GET and POST requests, but doesn\u2019t allow making batch requests and accepts only a single target input parameter.",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c382e5f6-a3a8-4808-8a4f-ec9c687ec072",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 304,
        "content": "##  Common Use cases\n\n- Ongoing backlink health monitoring\n\n- SEO audits and reporting\n\n- Link quality and risk assessment\n\n- Agency client reporting\n\n- Competitive backlink analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "b720df5b-aa31-4743-908d-b0ee9f6bfca3",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -336,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "76e59da2-ea21-4ad3-a9b9-ddae17fb9fec",
      "name": "Set Input Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -112,
        -32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5ebfd5aa-9a70-4d40-b7aa-d92644097c7f",
              "name": "query",
              "type": "string",
              "value": "Backlinks Summary for https://www.aezion.com/"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f590c256-667c-429c-8d7f-9034dbd26457",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        208
      ],
      "parameters": {
        "columns": {
          "value": {
            "Query": "={{ $('Set Input Fields').item.json.query }}",
            "Summary": "={{ $json.output }}"
          },
          "schema": [
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/18wztZeDZFVbY789LH-2m_CORB7uUJFILwj20vReDnUI/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "18wztZeDZFVbY789LH-2m_CORB7uUJFILwj20vReDnUI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/18wztZeDZFVbY789LH-2m_CORB7uUJFILwj20vReDnUI/edit?usp=drivesdk",
          "cachedResultName": "SE Ranking Backlinks"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "ebe13457-1752-4085-a442-8915fae51964",
      "name": "Create a Binary Data",
      "type": "n8n-nodes-base.function",
      "position": [
        944,
        16
      ],
      "parameters": {
        "functionCode": "const content = JSON.stringify(items[0].json, null, 2);\n\nitems[0].binary = {\n  data: {\n    data: Buffer.from(content, 'utf8').toString('base64'),\n    mimeType: 'application/json',\n    fileName: 'backlinks.json'\n  }\n};\n\nreturn items;"
      },
      "typeVersion": 1
    },
    {
      "id": "fed46bb1-d72f-4f24-9d64-44bb5a2ec1d9",
      "name": "Extract Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        16
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      summary: $input.first().json.output,\n      timestamp: new Date().toISOString()\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "f02855ad-a373-4d05-bc2d-52e8cc59ccf6",
      "name": "Save as CSV",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1152,
        16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "531084ee-5814-4e76-9026-698bbed0e601",
      "name": "Persist on DataTable",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        720,
        -176
      ],
      "parameters": {
        "columns": {
          "value": {
            "Query": "={{ $('Set Input Fields').item.json.query }}",
            "Summary": "={{ $json.output }}"
          },
          "schema": [
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false
            },
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Summary"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "i6H9uoOwgFPHUMGR",
          "cachedResultUrl": "/projects/OFZrD6piltNz73Y6/datatables/i6H9uoOwgFPHUMGR",
          "cachedResultName": "Backlinks"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6b0c33ba-08ee-4919-bb3d-d5eafd0caaf6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 720,
        "content": "## Export Data Handling\n\nThe Export Data Handling section manages how enriched backlink insights are stored and shared. It converts the AI-generated summaries into structured formats such as DataTables, Google Sheets, CSV, and JSON files."
      },
      "typeVersion": 1
    },
    {
      "id": "3dac59cb-31ee-4e70-ba3e-3ab41a465144",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 800,
        "height": 720,
        "content": "## SE Ranking AI Agent\n\nThe SE Ranking AI Agent acts as the intelligence layer of this workflow. It interprets backlink data retrieved from SE Ranking APIs, automatically selects the appropriate datasets, and normalizes complex SEO metrics. Using GPT-4.1-mini"
      },
      "typeVersion": 1
    },
    {
      "id": "98faa1ba-62b2-41c9-abb8-a3b6617add7f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -768
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 384,
        "content": "![Logo](https://s3-eu-west-1.amazonaws.com/tpd/logos/538f1575000064000578dee6/0x0.png)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "58bd2dfc-c050-4146-9be5-51f0349fa0fc",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Persist on DataTable",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Summary": {
      "main": [
        [
          {
            "node": "Create a Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Input Fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create a Binary Data": {
      "main": [
        [
          {
            "node": "Save as CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Persist on DataTable": {
      "main": [
        []
      ]
    },
    "HTTP Request for All Backlinks": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request for Backlink Metrics": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request for Backlink Summary": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Set Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}