8
n8n 中文网amn8n.com

使用Bright Data、Gemini AI和Google Sheets按关键词分析Crunchbase初创公司

中级

这是一个AI, Marketing领域的自动化工作流,包含 13 个节点。主要使用 If, Code, Wait, Merge, FormTrigger 等节点,结合人工智能技术实现智能自动化。 使用Bright Data、Gemini AI和Google Sheets按关键词分析Crunchbase初创公司

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "71eb5622cf8abac565805540c0900dbae437dddbda45bf1b87bf3bfeea26393c"
  },
  "nodes": [
    {
      "id": "03a69683-ae41-4457-a067-f8eb3070e6cc",
      "name": "快照进度",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -120,
        -220
      ],
      "parameters": {
        "url": "=https://api.brightdata.com/datasets/v3/progress/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "042743bc-4a3a-4be7-87d2-5a0d7327b2aa",
      "name": "HTTP 请求 - 向 Bright Data 发送 API 调用",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -620,
        40
      ],
      "parameters": {
        "url": "https://api.brightdata.com/datasets/v3/trigger",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "keyword",
              "value": "={{ $json[\"Keyword\"] }}"
            }
          ]
        },
        "queryParameters": {
          "parameters": [
            {
              "name": "dataset_id",
              "value": "gd_l1vijqt9jfj7olije"
            },
            {
              "name": "type",
              "value": "discover_new"
            },
            {
              "name": "discover_by",
              "value": "keyword"
            },
            {
              "name": "include_errors",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4ae4d5a0-b266-4620-ae74-1230a1622437",
      "name": "等待 - 轮询 Bright Data",
      "type": "n8n-nodes-base.wait",
      "position": [
        -340,
        -220
      ],
      "webhookId": "8005a2b3-2195-479e-badb-d90e4240e699",
      "parameters": {
        "amount": 15
      },
      "executeOnce": false,
      "typeVersion": 1.1
    },
    {
      "id": "fdd36a29-ee46-4737-892c-a8095db01233",
      "name": "条件判断 - 检查快照状态 - 数据是否就绪",
      "type": "n8n-nodes-base.if",
      "position": [
        100,
        -220
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7932282b-71bb-4bbb-ab73-4978e554de7e",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "running"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6ef4e903-ef2d-4b0d-921b-30e848ad7590",
      "name": "HTTP 请求 - 从 Bright Data 获取数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        -220
      ],
      "parameters": {
        "url": "=https://api.brightdata.com/datasets/v3/snapshot/{{ $json.snapshot_id }}",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "format",
              "value": "json"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5686b066-2f14-4aa9-bfd0-834f02e514c7",
      "name": "代码 - 解析和清理 JSON 数据",
      "type": "n8n-nodes-base.code",
      "position": [
        540,
        -220
      ],
      "parameters": {
        "language": "python",
        "pythonCode": "from datetime import datetime\n\nall_companies = _input.all()\n\nvalid_companies = []\nfor item in all_companies:\n    company = item.json\n    date_str = company.get(\"founded_date\")\n    try:\n        date = datetime.strptime(date_str, \"%Y-%m-%d\")\n        valid_companies.append((date, company))\n    except (TypeError, ValueError):\n        continue\n\nsorted_companies = sorted(valid_companies, key=lambda x: x[0], reverse=True)\n\ncleaned = []\nfor _, c in sorted_companies[:10]:\n    founders = c.get(\"founders\") or []\n    products = c.get(\"products_and_services\") or []\n    financials = c.get(\"financials_highlights\") or {}\n\n    cleaned.append({\n        \"name\": c.get(\"name\"),\n        \"founded\": c.get(\"founded_date\"),\n        \"about\": c.get(\"about\"),\n        \"num_employees\": c.get(\"num_employees\"),\n        \"type\": c.get(\"type\"),\n        \"ipo_status\": c.get(\"ipo_status\"),\n        \"full_description\": c.get(\"full_description\", \"\"),\n        \"monthly_visits\": c.get(\"monthly_visits\"),\n        \"social_media_links\": c.get(\"social_media_links\", []),\n        \"website\": c.get(\"website\"),\n        \"address\": c.get(\"address\"),\n        \"funding_total\": financials.get(\"funding_total\"),\n        \"num_investors\": c.get(\"num_investors\") or financials.get(\"num_investors\"),\n        \"lead_investors\": financials.get(\"num_lead_investors\"),\n        \"founders\": \", \".join([p.get(\"value\") for p in founders if p.get(\"value\")]),\n        \"products_and_services\": \", \".join([p.get(\"product_name\") for p in products if p.get(\"product_name\")]),\n        \"crunchbase_link\": c.get(\"url\"),\n        \"ai_analysis\": \"\"\n    })\n\nreturn [{\n    \"json\": {\n        \"companies\": cleaned\n    }\n}]\n"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "29f39c43-e688-43de-b249-5407abd3ff50",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -400
      ],
      "parameters": {
        "content": "## 注意"
      },
      "typeVersion": 1
    },
    {
      "id": "29b00dad-9e5d-45fd-87ad-0c1a6659bfcd",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        340,
        220
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "92076574-6e30-4436-81b0-a016c47d707e",
      "name": "Google Gemini - 比较分析",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        340,
        40
      ],
      "parameters": {
        "text": "={{$json}}",
        "messages": {
          "messageValues": [
            {
              "message": "=You will be provided with data for companies from Crunchbase, operating in the sector (or field of interests) that user requested by [keyword].\n\nPlease perform a comparative analysis of these companies. Highlight key similarities, differences, perspectives, and any notable outliers. The [keyword] user requested initially: {{ $('When User Completes Form').first().json['Keyword']}}.\nDon't start your answer with 'Okay'."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "10dacf61-006d-4821-aced-72beb4de1cf0",
      "name": "当用户完成表单时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -840,
        40
      ],
      "webhookId": "41d0bffa-f5ca-4df7-b757-ca5a1e472b8a",
      "parameters": {
        "options": {
          "ignoreBots": true
        },
        "formTitle": "Search from Crunchbase by keyword",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Keyword",
              "placeholder": "e.g. \"AI in healthcare\"",
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode",
        "formDescription": "Please provide a keyword to search and compare relevant startups"
      },
      "typeVersion": 2.2
    },
    {
      "id": "28aa3e45-bbaa-40a1-b0ec-33c81e8a1a7a",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        780,
        -80
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "e7da127a-864c-4957-8be9-a48229885c78",
      "name": "代码 - 合并 JSON 和 AI 输出",
      "type": "n8n-nodes-base.code",
      "position": [
        1000,
        -80
      ],
      "parameters": {
        "language": "python",
        "pythonCode": "input_0 = _input.all(0)\ninput_1 = _input.all(1) \n\nif not input_0 or not input_1:\n    raise ValueError(\"Missing input data on one of the inputs.\")\n\ncompanies = input_0[0].json.get(\"companies\")\nanalysis_text = input_1[1].json.get(\"text\")\n\nif companies:\n    companies[0][\"ai_analysis\"] = analysis_text\n\nreturn [{ \"json\": company } for company in companies]\n"
      },
      "typeVersion": 2
    },
    {
      "id": "60268912-b8e8-4fd9-ac86-ad5e4494e013",
      "name": "Google Sheets - 导出结果",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1220,
        -80
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $json.companies[0].name }}"
          },
          "schema": [
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "founded",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "founded",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "about",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "num_employees",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "num_employees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ipo_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ipo_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "full_description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "full_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "social_media_links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "social_media_links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "funding_total",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "funding_total",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "num_investors",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "num_investors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lead_investors",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "lead_investors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "founders",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "founders",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "products_and_services",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "products_and_services",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "crunchbase_link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "crunchbase_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companies",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companies",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/134y4U1gc8DvM4bPhSfOUtZhjoBvx62dTsff2P8niGAg/edit#gid=0",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "134y4U1gc8DvM4bPhSfOUtZhjoBvx62dTsff2P8niGAg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/134y4U1gc8DvM4bPhSfOUtZhjoBvx62dTsff2P8niGAg/edit?usp=drivesdk",
          "cachedResultName": "Crunchbase Output"
        }
      },
      "typeVersion": 4.3,
      "alwaysOutputData": true
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Code - Combining JSON and AI outputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Snapshot Progress": {
      "main": [
        [
          {
            "node": "If - Checking status of Snapshot - if data is ready or not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Google Gemini - Comparative Analisys",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When User Completes Form": {
      "main": [
        [
          {
            "node": "HTTP Request- Post API call to Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - Polling Bright Data": {
      "main": [
        [
          {
            "node": "Snapshot Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Export Results": {
      "main": [
        []
      ]
    },
    "Code - Parse and Clean JSON Data": {
      "main": [
        [
          {
            "node": "Google Gemini - Comparative Analisys",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Combining JSON and AI outputs": {
      "main": [
        [
          {
            "node": "Google Sheets - Export Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini - Comparative Analisys": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "HTTP Request- Post API call to Bright Data": {
      "main": [
        [
          {
            "node": "Wait - Polling Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request - Getting data from Bright Data": {
      "main": [
        [
          {
            "node": "Code - Parse and Clean JSON Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If - Checking status of Snapshot - if data is ready or not": {
      "main": [
        [
          {
            "node": "Wait - Polling Bright Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request - Getting data from Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

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

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流