8
n8n 中文网amn8n.com

使用Bright Data和OpenAI 4o mini进行DNB公司搜索与提取

高级

这是一个Product, AI, Marketing领域的自动化工作流,包含 18 个节点。主要使用 Set, Function, McpClient, HttpRequest, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 基于Bright Data和OpenAI 4o mini的DNB公司搜索与提取

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "fw2n6WbzzOSBziD2",
  "meta": {
    "instanceId": "885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Bright Data 和 Open AI 4o mini 进行 DNB 公司搜索与提取",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    },
    {
      "id": "ddPkw7Hg5dZhQu2w",
      "name": "AI",
      "createdAt": "2025-04-13T05:38:08.053Z",
      "updatedAt": "2025-04-13T05:38:08.053Z"
    }
  ],
  "nodes": [
    {
      "id": "647ba3af-65c7-40ae-954d-1eacfd032057",
      "name": "点击“测试工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1140,
        440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5ac1546f-0215-4ba4-996d-8b8298e8813b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        120
      ],
      "parameters": {
        "width": 400,
        "height": 240,
        "content": "## 注意"
      },
      "typeVersion": 1
    },
    {
      "id": "98264472-dec1-4930-8759-cd7765aebbb7",
      "name": "设置输入字段",
      "type": "n8n-nodes-base.set",
      "position": [
        -700,
        440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88826650-2a6f-4d19-8a2f-27b039296a00",
              "name": "webhook_notification_url",
              "type": "string",
              "value": "https://webhook.site/c9118da2-1c54-460f-a83a-e5131b7098db"
            },
            {
              "id": "af7fb77a-7411-4f39-bd04-3bf8cc52a6f9",
              "name": "search",
              "type": "string",
              "value": "dnb starbucks url"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a888ec8a-9211-4196-8577-4a93c0ebda51",
      "name": "列出 Bright Data 的所有工具",
      "type": "n8n-nodes-mcp.mcpClient",
      "position": [
        -920,
        440
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f06c235a-7726-4580-8ea3-1f34a789b153",
      "name": "搜索引擎 MCP 客户端",
      "type": "n8n-nodes-mcp.mcpClient",
      "position": [
        -480,
        440
      ],
      "parameters": {
        "toolName": "search_engine",
        "operation": "executeTool",
        "toolParameters": "={\n  \"query\": \"{{ $json.search }}\",\n  \"engine\": \"google\"\n} "
      },
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7462d4bf-eb0e-48e2-988f-64874a8e5c51",
      "name": "DNB 专用 Bright Data MCP 客户端",
      "type": "n8n-nodes-mcp.mcpClient",
      "notes": "Scrape a single webpage URL with advanced options for content extraction and get back the results in MarkDown language.",
      "position": [
        116,
        440
      ],
      "parameters": {
        "toolName": "scrape_as_markdown",
        "operation": "executeTool",
        "toolParameters": "={\n   \"url\": \"{{ $json.output.url }}\"\n} "
      },
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "1adbe55f-3649-45f3-825a-70ec021452dd",
      "name": "使用 LLM 进行 DNB URL 数据提取",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -260,
        440
      ],
      "parameters": {
        "text": "=Extract the URLs for DNB  {{ $json.result.content[0].text }}\n",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "2fd7b177-2ac7-4cae-82af-47ea2cef08ed",
      "name": "使用 LLM 进行 DNB 结构化数据提取",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        336,
        440
      ],
      "parameters": {
        "text": "=Extract the Company Profile from {{ $json.result.content[0].text }}\n\nOutput in a highly structured JSON format.\n",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "7d2101c1-edc6-4f2b-8d2e-577bc07ac2ee",
      "name": "为结构化数据提取创建二进制数据",
      "type": "n8n-nodes-base.function",
      "position": [
        712,
        340
      ],
      "parameters": {
        "functionCode": "items[0].binary = {\n  data: {\n    data: new Buffer(JSON.stringify(items[0].json, null, 2)).toString('base64')\n  }\n};\nreturn items;"
      },
      "typeVersion": 1
    },
    {
      "id": "937e7a23-32c8-4894-88c9-4c2d5b8fe274",
      "name": "将结构化内容写入磁盘",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        932,
        340
      ],
      "parameters": {
        "options": {},
        "fileName": "=d:\\DNB_Info.json",
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "0a40a4f0-6dba-4638-944d-192cd6e0c3a6",
      "name": "为结构化数据启动Webhook通知",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        712,
        540
      ],
      "parameters": {
        "url": "={{ $('Set input fields').item.json.webhook_notification_url }}",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "dnb_company_info",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "de9da4f8-126d-48bd-a391-92f69a44a613",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        240
      ],
      "parameters": {
        "width": 440,
        "height": 120,
        "content": "## 免责声明"
      },
      "typeVersion": 1
    },
    {
      "id": "534cc990-a9fe-4d8c-813c-19f864e92dd8",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        120
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 240,
        "content": "## LLM 使用情况"
      },
      "typeVersion": 1
    },
    {
      "id": "95d188e1-8e68-4843-a4d7-fd25d066b4aa",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -300
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 400,
        "content": "## 徽标"
      },
      "typeVersion": 1
    },
    {
      "id": "439f4da4-5055-4281-895f-38768bb62168",
      "name": "URL 结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -80,
        660
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"url\": \"url\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "82b4a20c-2046-4314-8179-6123f18ea97f",
      "name": "结构化提取输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        520,
        660
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/schema#\",\n  \"title\": \"DNBCompanyProfile\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"companyName\": { \"type\": \"string\" },\n    \"website\": { \"type\": \"string\", \"format\": \"uri\" },\n    \"dnbHooversFreeTrial\": { \"type\": \"string\" },\n    \"claimCompany\": { \"type\": \"string\" },\n\n    \"overview\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"doingBusinessAs\": { \"type\": \"string\" },\n        \"companyDescription\": { \"type\": \"string\" },\n        \"industry\": {\n          \"type\": \"array\",\n          \"items\": { \"type\": \"string\" }\n        },\n        \"address\": { \"type\": \"string\" },\n        \"phone\": { \"type\": [\"string\", \"null\"] },\n        \"employeesThisSite\": { \"type\": [\"string\", \"null\"] },\n        \"employeesAllSites\": { \"type\": [\"string\", \"null\"] },\n        \"revenue\": { \"type\": [\"string\", \"null\"] },\n        \"yearStarted\": { \"type\": [\"integer\", \"null\"] },\n        \"esgRanking\": { \"type\": [\"number\", \"null\"] },\n        \"esgIndustryAverage\": { \"type\": [\"number\", \"null\"] }\n      },\n      \"required\": [\"companyDescription\", \"industry\", \"address\"]\n    },\n\n    \"contacts\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"headline\": { \"type\": \"string\" },\n        \"contact1\": { \"type\": \"string\" },\n        \"contactLink\": { \"type\": \"string\" },\n        \"dnbHooversLogo\": { \"type\": \"string\" }\n      }\n    },\n\n    \"financialData\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"description\": { \"type\": \"string\" },\n        \"creditReportLink\": { \"type\": \"string\" }\n      }\n    },\n\n    \"creditReports\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"description\": { \"type\": \"string\" }\n      }\n    },\n\n    \"faq\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"location\": { \"type\": \"string\" },\n        \"industry\": { \"type\": \"string\" },\n        \"phoneNumber\": { \"type\": \"string\" },\n        \"website\": { \"type\": \"string\" },\n        \"employees\": { \"type\": \"string\" },\n        \"keyPrincipal\": { \"type\": \"string\" },\n        \"yearStarted\": { \"type\": \"string\" },\n        \"sales\": { \"type\": \"string\" }\n      }\n    }\n  },\n  \"required\": [\"companyName\", \"overview\"]\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "a08383bf-b90b-4b82-9698-2f6c842749e2",
      "name": "URL 数据提取专用 OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -280,
        660
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "vPKynKbDzJ5ZU4cU",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5e577d2d-240a-4851-a1d7-04b66442049e",
      "name": "DNB 结构化数据提取专用 OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        320,
        660
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "vPKynKbDzJ5ZU4cU",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e8616327-2a5b-4815-bcff-ee154750f8cf",
  "connections": {
    "Set input fields": {
      "main": [
        [
          {
            "node": "MCP Client for Search Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client for Search Engine": {
      "main": [
        [
          {
            "node": "DNB URL Data Extract Using LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data MCP Client For DNB": {
      "main": [
        [
          {
            "node": "DNB Structured Data Extract Using LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DNB URL Data Extract Using LLM": {
      "main": [
        [
          {
            "node": "Bright Data MCP Client For DNB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List all tools for Bright Data": {
      "main": [
        [
          {
            "node": "Set input fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser for URL": {
      "ai_outputParser": [
        [
          {
            "node": "DNB URL Data Extract Using LLM",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "List all tools for Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DNB Structured Data Extract Using LLM": {
      "main": [
        [
          {
            "node": "Create a binary data for Structured Data Extract",
            "type": "main",
            "index": 0
          },
          {
            "node": "Initiate a Webhook Notification for Structured Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for URL Data Extract": {
      "ai_languageModel": [
        [
          {
            "node": "DNB URL Data Extract Using LLM",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser for Structured Extract": {
      "ai_outputParser": [
        [
          {
            "node": "DNB Structured Data Extract Using LLM",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create a binary data for Structured Data Extract": {
      "main": [
        [
          {
            "node": "Write the structured content to disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for DNB Structured Data Extract": {
      "ai_languageModel": [
        [
          {
            "node": "DNB Structured Data Extract Using LLM",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 产品, 人工智能, 营销

需要付费吗?

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

工作流信息
难度等级
高级
节点数量18
分类3
节点类型10
难度说明

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

作者
Ranjan Dailata

Ranjan Dailata

@ranjancse

A Professional based out of India specialized in handling AI-powered automations. Contact me at ranjancse@gmail.com

外部链接
在 n8n.io 查看

分享此工作流