AutomationFlowsAI & RAG › Generate B2b Lead Opportunities From Websites with Brightdata & Openrouter AI

Generate B2b Lead Opportunities From Websites with Brightdata & Openrouter AI

Byphil @phil on n8n.io

This workflow is designed for B2B professionals to automatically identify and summarize business opportunities from a company's website.

Chat trigger trigger★★★★☆ complexityAI-powered17 nodes@Brightdata/N8N Nodes BrightdataOpenRouter ChatOutput Parser StructuredChat TriggerAgent
AI & RAG Trigger: Chat trigger Nodes: 17 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #8076 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "9a0fbaa1-3529-4fcb-8552-97def2e37c92",
      "name": "parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -304,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d16e4ff1-02f6-4627-8eed-f1dc94b37bda",
              "name": "url",
              "type": "string",
              "value": "={{ $json.chatInput }}"
            },
            {
              "id": "39d8ba7a-3daf-4d3c-bec5-20f84b3d769c",
              "name": "sitemap",
              "type": "string",
              "value": "sitemap.xml"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b49ab874-73e6-4077-9798-3e723ce7e38f",
      "name": "extract url",
      "type": "n8n-nodes-base.code",
      "position": [
        144,
        96
      ],
      "parameters": {
        "jsCode": "// Extracts all URLs from <a> tags within the HTML body.\nconst htmlBody = items[0].json.body;\n\n// Checks if the HTML body is a string.\nif (typeof htmlBody !== 'string') {\n  return [];\n}\n\nconst regex = /<a\\s+(?:[^>]*?\\s+)?href=\"([^\"]+)\"/gi;\nconst matches = [...htmlBody.matchAll(regex)];\n\n// Maps each match to create a new n8n item with the extracted URL.\nreturn matches.map(match => {\n  return {\n    json: {\n      url: match[1]\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "f15809c1-8492-4642-878d-aafe9dac0649",
      "name": "scrap urls",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        -80,
        96
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "zone": {
          "__rl": true,
          "mode": "list",
          "value": "web_unlocker1"
        },
        "format": "json",
        "country": {
          "__rl": true,
          "mode": "list",
          "value": "us",
          "cachedResultName": "us"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8c653ced-e6d3-411f-8eb0-ae7c5b802424",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        384,
        464
      ],
      "parameters": {
        "model": "openai/o4-mini",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "23555c2f-4f1c-4367-9431-1b0c0a8a02d4",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        544,
        304
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\n\"url\": \n\"https://www.example.com/about.html\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "52f25a6b-fd76-49d0-b6da-ecb26f3bbc43",
      "name": "scrap urls1",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        1036,
        96
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "zone": {
          "__rl": true,
          "mode": "list",
          "value": "web_unlocker1"
        },
        "format": "json",
        "country": {
          "__rl": true,
          "mode": "list",
          "value": "us",
          "cachedResultName": "us"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "846e8b1a-5ce4-456d-8828-d2f58f5097a0",
      "name": "HTML cleaner",
      "type": "n8n-nodes-base.html",
      "position": [
        1260,
        96
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "dataPropertyName": "body",
        "extractionValues": {
          "values": [
            {
              "key": "body",
              "cssSelector": "body"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0ce43f94-c79b-4054-9365-45c2b385181e",
      "name": "OpenRouter Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1492,
        320
      ],
      "parameters": {
        "model": "openai/gpt-5",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c6b38f95-1ac7-4ea0-a983-70986dd1c972",
      "name": "Structured Output Parser2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1620,
        320
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\"summary\": \n\"summary\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b0a1d3e5-5388-4d73-a07b-f21a18f60749",
      "name": "OpenRouter Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2132,
        320
      ],
      "parameters": {
        "model": "openai/gpt-5",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3993fafb-ccc8-4291-9e66-b2c3d06234ac",
      "name": "merge pages",
      "type": "n8n-nodes-base.code",
      "position": [
        1836,
        96
      ],
      "parameters": {
        "jsCode": "/**\n * Merges the `output` objects from all incoming items into a single object.\n * Each item is expected to have a structure of { json: { output: { ... } } }.\n */\nconst mergedData = items.reduce((accumulator, item) => {\n  if (item.json && item.json.output) {\n    // The spread operator (...) merges the properties of the current object\n    // into the accumulator. If keys are identical, the last value seen prevails.\n    return { ...accumulator, ...item.json.output };\n  }\n  return accumulator;\n}, {});\n\n// Returns a single item containing the merged object, paired with the first input item.\nreturn [{ json: { mergedOutput: mergedData }, pairedItem: 0 }];"
      },
      "typeVersion": 2
    },
    {
      "id": "db0e0c06-d57d-4de6-904c-875d0d7eb983",
      "name": "clean list",
      "type": "n8n-nodes-base.code",
      "position": [
        812,
        96
      ],
      "parameters": {
        "jsCode": "// Extrait les URLs, filtre les valeurs vides, et retourne une liste\n// d'items en conservant la liaison avec les items d'entr\u00e9e.\nreturn items.flatMap((item, index) => {\n  const url = item.json.output?.[0]?.url;\n\n  // Si une URL est trouv\u00e9e, retourne un nouvel objet item avec sa liaison.\n  // Sinon, retourne un tableau vide pour l'\u00e9carter du r\u00e9sultat final.\n  return url ? [{ json: { url }, pairedItem: index }] : [];\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "df3f47a3-fa75-49a7-8b71-22e6205ee5e1",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -528,
        96
      ],
      "parameters": {
        "public": true,
        "options": {
          "responseMode": "lastNode"
        },
        "initialMessages": "Welcome, I am your business opportunity detection agent. Enter the URL of the company to be analyzed, and I will search their website for the best business opportunities based on your activity."
      },
      "typeVersion": 1.3
    },
    {
      "id": "7ef4c30a-6d51-46f7-82eb-48de5517a73f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -320
      ],
      "parameters": {
        "width": 640,
        "height": 320,
        "content": "# Lead Opportunity Finder\n\nThis workflow automates the **B2B lead generation** process by analyzing a company\u2019s website with AI.\n\n\ud83d\udc49 Get your free Bright Data API key here: [https://get.brightdata.com/scrap](https://get.brightdata.com/scrap)\n\n**Automated Website Analysis**\nThe workflow is triggered by a URL and uses Bright Data's Web Unblocker to scrape key company pages like \"About Us\" and \"Team\".\n\n**AI-Powered Opportunity Detection**\nAdvanced AI models from OpenRouter analyze the content to identify potential pain points and business needs related to automation.\n\n**Actionable Insights**\nThe final output is a synthesized, non-redundant report of all identified opportunities, formatted for a Google Doc to help sales and business development teams prepare for outreach."
      },
      "typeVersion": 1
    },
    {
      "id": "a7399426-ec3b-4fb5-946b-de78410f8768",
      "name": "Find best pages",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        368,
        96
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are a B2B data extraction expert. |Task : Analyze the following list of JSON objects. Identify the URLs that are relevant for obtaining information about a company for prospecting purposes (pages such as \"who we are\", \"about us\", \"recruitment\", \"team\", \"contact\"). Output instructions : Extract the value of the \"url\" key for each relevant object. Return only absolute URLs (starting with http). Ignore relative URLs (/) and anchors (#). Your response must contain ONLY the list of relevant URLs, one per line, without any additional comments, titles, or formatting, according to this JSON format {\"url\": \"https://www.example.com/about.html\"}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "ca67e038-046f-483f-9c86-de822c268a48",
      "name": "Identify business opportunities",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1484,
        96
      ],
      "parameters": {
        "text": "={{ $json.body }}",
        "options": {
          "systemMessage": "You are a B2B lead generation expert for an agency that offers AI-powered process automation.\n\nYou will be given pages from a prospect's website as input: {{ $('parameters').item.json.url }}\n\nYour role is to look for business opportunities.\n\nRespond without any commentary with a summary of the opportunities you identify. JSON format."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "f2b564ee-127c-47cb-92b1-120dcf2e359e",
      "name": "de-dupe",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2060,
        96
      ],
      "parameters": {
        "text": "={{ $json.mergedOutput }}",
        "options": {
          "systemMessage": "You are a B2B lead generation expert for an agency that offers AI-powered process automation.\n\nYou will be given a summary of their website's pages as input: {{ $('parameters').item.json.url }}\n\nYour role is to find and synthesize business opportunities.\n\nEliminate redundancies.\n\nRespond without any commentary, providing a summary of the opportunities you identify, formatted for a Google Doc with headings."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "de-dupe": {
      "main": [
        []
      ]
    },
    "clean list": {
      "main": [
        [
          {
            "node": "scrap urls1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parameters": {
      "main": [
        [
          {
            "node": "scrap urls",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "scrap urls": {
      "main": [
        [
          {
            "node": "extract url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract url": {
      "main": [
        [
          {
            "node": "Find best pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "merge pages": {
      "main": [
        [
          {
            "node": "de-dupe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "scrap urls1": {
      "main": [
        [
          {
            "node": "HTML cleaner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML cleaner": {
      "main": [
        [
          {
            "node": "Identify business opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find best pages": {
      "main": [
        [
          {
            "node": "clean list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser1",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Find best pages",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Identify business opportunities",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "de-dupe",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Find best pages",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "Identify business opportunities",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identify business opportunities": {
      "main": [
        [
          {
            "node": "merge pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow is designed for B2B professionals to automatically identify and summarize business opportunities from a company's website.

Source: https://n8n.io/workflows/8076/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system a

Chat Trigger, HTTP Request, Google Sheets +8
AI & RAG

Turn any YouTube channel into a searchable knowledge base. The AI agent understands relationships between videos, topics, tools, and concepts - enabling powerful queries like "Which videos talk about

OpenRouter Chat, Agent, Chat Trigger +8
AI & RAG

⚠️ Important: This workflow uses community nodes (JsonCut, Blotato) and requires a self-hosted n8n instance.

HTTP Request, OpenAI, Google Gemini +7
AI & RAG

Want to check out all my flows, follow me on:

Agent, Output Parser Structured, Tool Workflow +6
AI & RAG

[](https://youtu.be/D11S0s3PDNc)

Chat Trigger, Memory Buffer Window, HTTP Request +7