8
n8n 中文网amn8n.com

Google趋势数据提取,使用Bright Data和Google Gemini进行摘要生成

高级

这是一个Engineering, AI, Marketing领域的自动化工作流,包含 16 个节点。主要使用 Set, Gmail, Function, HttpRequest, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 使用Bright Data和Google Gemini的Google趋势数据提取与摘要生成

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "9Or3kzIEI2tskRyR",
  "meta": {
    "instanceId": "885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40",
    "templateCredsSetupCompleted": true
  },
  "name": "Google 趋势数据提取,使用 Bright Data 和 Google Gemini 进行摘要生成",
  "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": "29e6ce01-c42f-4155-add1-8a5cfff56967",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        200,
        -420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6abf0439-8286-4198-9b5e-226a7bf805dc",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -780
      ],
      "parameters": {
        "width": 400,
        "height": 300,
        "content": "## 注意"
      },
      "typeVersion": 1
    },
    {
      "id": "6443bdea-4577-4983-adb7-0f52d6eb3825",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -780
      ],
      "parameters": {
        "width": 480,
        "height": 300,
        "content": "## LLM 使用情况"
      },
      "typeVersion": 1
    },
    {
      "id": "31280203-1ab1-4fb5-862f-e9c4f2969436",
      "name": "Markdown 到文本数据提取器",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        860,
        -420
      ],
      "parameters": {
        "text": "=You need to analyze the below markdown and convert to textual data. Please do not output with your own thoughts. Make sure to output with textual data only with no links, scripts, css etc.\n\n{{ $json.data }}",
        "messages": {
          "messageValues": [
            {
              "message": "You are a markdown expert"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "80e40926-aff3-4512-ad1e-61b3741b2387",
      "name": "设置 URL 和 Bright Data 区域",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        -420
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3aedba66-f447-4d7a-93c0-8158c5e795f9",
              "name": "url",
              "type": "string",
              "value": "https://trends.google.com/trends/explore?gprop=youtube&hl=en-US"
            },
            {
              "id": "4e7ee31d-da89-422f-8079-2ff2d357a0ba",
              "name": "zone",
              "type": "string",
              "value": "web_unlocker1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a60b2ac6-42c9-42af-a7fe-9cf570fcd017",
      "name": "为 Markdown 到文本数据提取启动 Webhook 通知",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1320,
        -720
      ],
      "parameters": {
        "url": "https://webhook.site/3c36d7d1-de1b-4171-9fd3-643ea2e4dd76",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "content",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c8f9b2ad-8e66-43d0-aeb5-3f5e202910d3",
      "name": "用于数据提取的 Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        948,
        -200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YeO7dHZnuGBVQKVZ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "30d3b080-d35a-422d-990d-0df0d73b96a8",
      "name": "执行 Bright Data 网络请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        -420
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "={{ $json.zone }}"
            },
            {
              "name": "url",
              "value": "={{ $json.url }}?product=unlocker&method=api"
            },
            {
              "name": "format",
              "value": "raw"
            },
            {
              "name": "data_format",
              "value": "markdown"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "kdbqXuxIR8qIxF7y",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "18acbc0a-f0e2-4f5b-b98c-dec69c656a7e",
      "name": "创建二进制数据",
      "type": "n8n-nodes-base.function",
      "position": [
        1980,
        -640
      ],
      "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": "1c386966-85ae-4b30-a485-259f1eb0727b",
      "name": "结构化数据提取器",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1280,
        -420
      ],
      "parameters": {
        "text": "=Extract the Google Trend Data in JSON.\n\nHere's the content:\n\n {{ $json.text }}",
        "options": {},
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"array\",\n\t\"properties\": {\n\t\t\"topics\": {\n\t\t\t\"type\": \"string\"\n\t\t},\"desc\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "aa7b5dd7-53c7-4197-b2e8-886832cad82e",
      "name": "汇总 Google 趋势",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        1760,
        -420
      ],
      "parameters": {
        "options": {},
        "chunkingMode": "advanced"
      },
      "typeVersion": 2
    },
    {
      "id": "25f0a115-ba3a-4ec6-8fe6-8e33e6302a2b",
      "name": "为摘要生成启动 Webhook 通知",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2200,
        -420
      ],
      "parameters": {
        "url": "https://webhook.site/3c36d7d1-de1b-4171-9fd3-643ea2e4dd76",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "content",
              "value": "={{ $json.response.text }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "50b55d73-5506-439c-8e82-e198f3b4f431",
      "name": "将文件写入磁盘",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        2200,
        -640
      ],
      "parameters": {
        "options": {},
        "fileName": "d:\\google-trends.json",
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "a163f8d3-2b5c-48a5-8a1d-26c0caba6383",
      "name": "用于摘要生成的 Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1860,
        -200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YeO7dHZnuGBVQKVZ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e3db8e9-ad4c-4247-841e-1f5f4937b93c",
      "name": "用于结构化数据提取的 Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1380,
        -200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YeO7dHZnuGBVQKVZ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "122d3269-e932-48e0-af01-e2c421650e16",
      "name": "发送摘要到 Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2200,
        -160
      ],
      "webhookId": "a57ca2f7-42dc-4ee9-808d-85455bb7c12f",
      "parameters": {
        "sendTo": "ranjancse@gmail.com",
        "message": "={{ $json.response.text }}",
        "options": {},
        "subject": "Google Trends Summary"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "WiMjt9PIpypF2dJF",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bc73fbca-1218-47bd-93cf-b308b424894d",
  "connections": {
    "Create a binary data": {
      "main": [
        [
          {
            "node": "Write the file to disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write the file to disk": {
      "main": [
        []
      ]
    },
    "Summarize Google Trends": {
      "main": [
        [
          {
            "node": "Initiate a Webhook Notification for Summarization",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Summary to Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Data Extractor": {
      "main": [
        [
          {
            "node": "Create a binary data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Summarize Google Trends",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set URL and Bright Data Zone": {
      "main": [
        [
          {
            "node": "Perform Bright Data Web Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perform Bright Data Web Request": {
      "main": [
        [
          {
            "node": "Markdown to Textual Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set URL and Bright Data Zone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown to Textual Data Extractor": {
      "main": [
        [
          {
            "node": "Initiate a Webhook Notification for Markdown to Textual Data Extraction",
            "type": "main",
            "index": 0
          },
          {
            "node": "Structured Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model for Data Extract": {
      "ai_languageModel": [
        [
          {
            "node": "Markdown to Textual Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model for Summarization": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Google Trends",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model for Structured Data Extract": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 工程, 人工智能, 营销

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流