8
n8n 中文网amn8n.com

AI代理驱动的ProductHunt数据提取和搜索(使用Bright Data和Google Gemini)

高级

这是一个AI, Marketing领域的自动化工作流,包含 21 个节点。主要使用 Set, Function, McpClient, HttpRequest, GoogleSheets 等节点,结合人工智能技术实现智能自动化。 使用Bright Data MCP和Google Gemini AI提取和搜索ProductHunt数据

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ko4fOc1jV3wKbt7T",
  "meta": {
    "instanceId": "885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40",
    "templateCredsSetupCompleted": true
  },
  "name": "AI 代理驱动的 ProductHunt 数据提取和搜索(使用 Bright Data 和 Google Gemini)",
  "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": "5af692c1-c035-49c0-84ac-d9dcff94269b",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -640,
        -20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c6f927ef-1664-4a4a-b9b0-faf9f9e052b6",
      "name": "列出 Bright Data 的所有工具",
      "type": "n8n-nodes-mcp.mcpClient",
      "position": [
        -420,
        -20
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "08175de9-ddc7-4664-87e9-cf3b6e9008b6",
      "name": "设置输入字段",
      "type": "n8n-nodes-base.set",
      "position": [
        -200,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac9abb54-45af-488d-b3f8-f923c85dbda9",
              "name": "base_url",
              "type": "string",
              "value": "https://www.producthunt.com"
            },
            {
              "id": "a15e928c-7c39-46a0-9bd2-5a3a7564d4ed",
              "name": "category",
              "type": "string",
              "value": "resumes"
            },
            {
              "id": "2d440cf4-4e48-400d-9752-1ea6d5cfcc62",
              "name": "search",
              "type": "string",
              "value": "The best resume tools in 2025"
            },
            {
              "id": "5d0e3985-b268-4ca6-8702-07f6f2f439b7",
              "name": "engine",
              "type": "string",
              "value": "google"
            },
            {
              "id": "c4781bc2-b870-4030-9ce8-3b7111a8ea59",
              "name": "webhook_url",
              "type": "string",
              "value": "https://webhook.site/c9118da2-1c54-460f-a83a-e5131b7098db"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "cba889d2-71b7-46fa-a723-00d41e1e891d",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        280,
        -20
      ],
      "parameters": {
        "text": "={{ $json.agent_operation }}\n\nOuput the data in a clean and human readable format. Output only the tool response.",
        "options": {},
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "e2f19c38-899d-475f-87f8-2305c27560ab",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        100,
        220
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YeO7dHZnuGBVQKVZ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bae60554-4022-4af3-a2c7-067235b2f03a",
      "name": "Google 搜索的 MCP 客户端",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        280,
        220
      ],
      "parameters": {
        "toolName": "search_engine",
        "operation": "executeTool",
        "toolParameters": "={\n   \"query\": \"{{ $('Set the Input Fields').item.json.search }}\",\n   \"engine\": \"{{ $('Set the Input Fields').item.json.engine }}\"\n}  ",
        "descriptionType": "manual",
        "toolDescription": "=Perform a search as per the specified search engine :  {{ $('Set the Input Fields').item.json.engine }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b1ca5ed5-e0e5-4434-897b-25efad53577f",
      "name": "Markdown 数据提取的 MCP 客户端",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        480,
        220
      ],
      "parameters": {
        "toolName": "scrape_as_markdown",
        "operation": "executeTool",
        "toolParameters": "={\n   \"url\": \"{{ $('Set the Input Fields').item.json.base_url }}/categories/{{ encodeURI($('Set the Input Fields').item.json.category) }}\"\n}  ",
        "descriptionType": "manual",
        "toolDescription": "Perform Product Hunt data scrapping in markdown format"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "JtatFSfA2kkwctYa",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "57305e8e-2731-45e7-b1d8-d9f73786f1da",
      "name": "设置代理操作",
      "type": "n8n-nodes-base.set",
      "position": [
        20,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f243ff07-a39e-4fdc-a32b-2c50e809b3fa",
              "name": "agent_operation",
              "type": "string",
              "value": "=Perform a Product Hunt data extract"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "be721837-c5e8-4ade-98fc-01b6aae10dd9",
      "name": "为结构化数据提取创建二进制数据",
      "type": "n8n-nodes-base.function",
      "position": [
        760,
        -20
      ],
      "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": "83cf444d-4b85-4688-ac1c-67fb6027b2ec",
      "name": "将结构化内容写入磁盘",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        980,
        -20
      ],
      "parameters": {
        "options": {},
        "fileName": "=d:\\ProductData.json",
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "2f179451-1a1d-437a-bddd-370d5deed3a2",
      "name": "为结构化数据启动 Webhook 通知",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        760,
        180
      ],
      "parameters": {
        "url": "={{ $('Set the Input Fields').item.json.webhook_url }}",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "product_info",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7431be44-2bc5-466a-aa24-cff3aa97ecef",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        -420
      ],
      "parameters": {
        "color": 3,
        "width": 440,
        "height": 120,
        "content": "## 免责声明"
      },
      "typeVersion": 1
    },
    {
      "id": "2c01a180-4202-4287-a656-c9afb052c950",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -300
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 220,
        "content": "## LLM 使用情况"
      },
      "typeVersion": 1
    },
    {
      "id": "02ba0f5d-f210-46fa-888a-53740f2f57d7",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -840
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 400,
        "content": "## 徽标"
      },
      "typeVersion": 1
    },
    {
      "id": "2561fbea-ac79-4a48-a141-9906bec656ed",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -400
      ],
      "parameters": {
        "width": 400,
        "height": 320,
        "content": "## 注意"
      },
      "typeVersion": 1
    },
    {
      "id": "7c7e69f2-393e-4725-9bc6-0fd6e3271ea0",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -460
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 120,
        "content": "## 代理操作"
      },
      "typeVersion": 1
    },
    {
      "id": "823039f1-e41f-4286-adde-4da05924f8cf",
      "name": "结构化数据提取器",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        760,
        440
      ],
      "parameters": {
        "text": "=Extract the links, keywords, description from  {{ $('AI Agent').item.json.output }}\n\nConstruct the links with the base url as {{ $('Set the Input Fields').item.json.base_url }}",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "467a58f7-b480-4975-9045-17ffef12553b",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        980,
        640
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"array\",\n\t\"properties\": {\n\t\t\"link\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n        \"desc\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c6a9ef1d-f1d8-469c-a149-20b70613a7a4",
      "name": "Google Gemini 聊天模型结构化数据提取",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        740,
        640
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YeO7dHZnuGBVQKVZ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d9ca7a55-ccb8-4c34-aec1-792f67e7cab4",
      "name": "为结构化数据更新 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1200,
        440
      ],
      "parameters": {
        "columns": {
          "value": {
            "structured_data": "={{ $json.output.toJsonString() }}"
          },
          "schema": [
            {
              "id": "structured_data",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "structured_data",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "structured_data"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1785677350,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cmJkB_DuSUbHoZ-LthySa7utEZFIvzeLinGcHjMyvzI/edit#gid=1785677350",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cmJkB_DuSUbHoZ-LthySa7utEZFIvzeLinGcHjMyvzI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cmJkB_DuSUbHoZ-LthySa7utEZFIvzeLinGcHjMyvzI/edit?usp=drivesdk",
          "cachedResultName": "ProductHunt"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Zjoxh2BUZ6VXGQhA",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "380351d4-2b49-4824-bbb6-3bba45f9fb37",
      "name": "为 AI 代理更新 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        760,
        -220
      ],
      "parameters": {
        "columns": {
          "value": {
            "output": "={{ $json.output.toJsonString() }}"
          },
          "schema": [
            {
              "id": "output",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "output",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "output"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10gAihQMT8-h8Mpehe9j-xxN4oTTpg8qwToI-I-Eauew/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cmJkB_DuSUbHoZ-LthySa7utEZFIvzeLinGcHjMyvzI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cmJkB_DuSUbHoZ-LthySa7utEZFIvzeLinGcHjMyvzI/edit?usp=drivesdk",
          "cachedResultName": "ProductHunt"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Zjoxh2BUZ6VXGQhA",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "07e2bb99-d6bf-4023-b61a-582436d22d04",
  "connections": {
    "AI Agent": {
      "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
          },
          {
            "node": "Update Google Sheets for AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Structured Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the Input Fields": {
      "main": [
        [
          {
            "node": "Set the Agent Operation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the Agent Operation": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Data Extractor": {
      "main": [
        [
          {
            "node": "Update Google Sheets for Structured Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client for Google Search": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "List all tools for Bright Data": {
      "main": [
        [
          {
            "node": "Set the Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client for Markdown Data Extract": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "List all tools for Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a binary data for Structured Data Extract": {
      "main": [
        [
          {
            "node": "Write the structured content to disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model Structured Data Extract": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人工智能, 营销

需要付费吗?

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

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

适合高级用户,包含 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 查看

分享此工作流