8
n8n 中文网amn8n.com

使用 Brightdata 和 OpenRouter AI 从网站生成 B2B 潜在客户机会

高级

这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 Set, Code, Html, Agent, ChatTrigger 等节点。 使用 Brightdata 和 OpenRouter AI 从网站生成 B2B 潜在客户机会

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "4a11afdb3c52fd098e3eae9fad4b39fdf1bbcde142f596adda46c795e366b326",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "9a0fbaa1-3529-4fcb-8552-97def2e37c92",
      "name": "参数",
      "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": "提取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": "抓取URL",
      "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": {
          "id": "i897C8Zq5VcQXQU9",
          "name": "BrightData Inforeole"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8c653ced-e6d3-411f-8eb0-ae7c5b802424",
      "name": "OpenRouter聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        384,
        464
      ],
      "parameters": {
        "model": "openai/o4-mini",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "KElXI3DlHnhrYSjM",
          "name": "OpenRouter PrestaM"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "23555c2f-4f1c-4367-9431-1b0c0a8a02d4",
      "name": "结构化输出解析器1",
      "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": "抓取URL1",
      "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": {
          "id": "i897C8Zq5VcQXQU9",
          "name": "BrightData Inforeole"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "846e8b1a-5ce4-456d-8828-d2f58f5097a0",
      "name": "HTML清理器",
      "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 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1492,
        320
      ],
      "parameters": {
        "model": "openai/gpt-5",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "KElXI3DlHnhrYSjM",
          "name": "OpenRouter PrestaM"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c6b38f95-1ac7-4ea0-a983-70986dd1c972",
      "name": "结构化输出解析器2",
      "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 聊天模型3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2132,
        320
      ],
      "parameters": {
        "model": "openai/gpt-5",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "KElXI3DlHnhrYSjM",
          "name": "OpenRouter PrestaM"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3993fafb-ccc8-4291-9e66-b2c3d06234ac",
      "name": "合并页面",
      "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": "清理列表",
      "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ée.\nreturn items.flatMap((item, index) => {\n  const url = item.json.output?.[0]?.url;\n\n  // Si une URL est trouvée, retourne un nouvel objet item avec sa liaison.\n  // Sinon, retourne un tableau vide pour l'écarter du résultat final.\n  return url ? [{ json: { url }, pairedItem: index }] : [];\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "df3f47a3-fa75-49a7-8b71-22e6205ee5e1",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -528,
        96
      ],
      "webhookId": "79b08ee2-afd5-4748-8914-4411a8872b81",
      "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": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -320
      ],
      "parameters": {
        "width": 640,
        "height": 320,
        "content": "# 潜在客户机会查找器"
      },
      "typeVersion": 1
    },
    {
      "id": "a7399426-ec3b-4fb5-946b-de78410f8768",
      "name": "查找最佳页面",
      "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": "识别业务机会",
      "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": "去重",
      "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
    }
  ],
  "pinData": {},
  "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - AI 摘要总结, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类2
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
phil

phil

@phil

e-com AI automation: 90% time saved on repetitive tasks: product sheets, after-sales chatbots, etc. 🚀 save time, win customers

外部链接
在 n8n.io 查看

分享此工作流