8
n8n 中文网amn8n.com

Reddit评论情感分析与Bright Data和Gemini AI至Google表格

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 19 个节点。主要使用 Set, Wait, Limit, GoogleSheets, ManualTrigger 等节点。 Reddit评论情感分析与Bright Data和Gemini AI至Google表格

前置要求
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "741fe657cb1cf25e93c97c159943779bc83f3af267584292298f2b35e660e8e8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ee795e8e-16a9-4df6-8b86-95cf51c031d0",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1184,
        272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "F7LQ42cm1uM82fqY",
          "name": "Google Gemini(PaLM) Api account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d94afee5-9940-46fd-8f2e-61bc7f1fe56c",
      "name": "自动修正输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1440,
        272
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "9dd364d6-9745-49fe-ba37-1d6696f6e8d7",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1328,
        480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "F7LQ42cm1uM82fqY",
          "name": "Google Gemini(PaLM) Api account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "90aa8498-a254-431e-931c-55743b71fc5b",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1584,
        480
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"comment\": \"My 14 pro feels a bit laggy after the update.\",\n  \"sentiment\": \"negative\",\n  \"reason\": \"The user expressed dissatisfaction with the phone’s performance after the update, using the word 'laggy', which is a negative experience.\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "54500d82-6d1b-4f65-945e-210a36208bda",
      "name": "触发器:手动启动",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -160,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f241718c-7a61-4a3b-adb9-da0e621f7cbc",
      "name": "设置 Reddit 帖子 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        32,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c602fcde-572b-43c9-b9e3-bb1ae11d3b22",
              "name": "post URL",
              "type": "string",
              "value": "https://www.reddit.com/r/iphone/comments/1kl0tb5/new_ios_185_update/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a1593058-3d9b-4b3b-8b06-9e7ab53b561e",
      "name": "Bright Data:获取评论",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        336,
        0
      ],
      "parameters": {
        "urls": "=[{\"url\":\"{{ $json[\"post URL\"] }}\"}]",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_lvzdpsdlw09j6t702",
          "cachedResultName": "Reddit - Comments"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "id": "lDByWafjWjWDBc6n",
          "name": "BrightData account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c2069b85-63a9-4e81-914f-bca4016f128d",
      "name": "等待快照处理(5分钟)",
      "type": "n8n-nodes-base.wait",
      "position": [
        512,
        0
      ],
      "webhookId": "de346d16-e51c-4add-b1c1-fdc9b9a1b6d4",
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1be77fde-720e-4283-970b-5228e7d0ccb3",
      "name": "Bright Data:下载评论快照",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        768,
        0
      ],
      "parameters": {
        "resource": "webScrapper",
        "operation": "downloadSnapshot",
        "snapshot_id": "={{ $json.snapshot_id }}",
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "id": "lDByWafjWjWDBc6n",
          "name": "BrightData account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "403fe1e9-aaab-49c6-a531-601641b08119",
      "name": "限制为5条评论",
      "type": "n8n-nodes-base.limit",
      "position": [
        960,
        0
      ],
      "parameters": {
        "maxItems": 5
      },
      "typeVersion": 1
    },
    {
      "id": "3c6c116e-b384-42ff-af10-cad357fdf44f",
      "name": "AI 情感分类器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        0
      ],
      "parameters": {
        "text": "=Based on the Reddit post's comment below, decide whether the sentiment is positive, negative or neutral.\n\ncomment: {{ $json.comment }}\nNumber of upvotes: {{ $json.num_upvotes }}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "05188346-66f3-453c-8f57-dab11b11899c",
      "name": "保存情感分析结果到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1616,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Reason": "={{ $json.output.reason }}",
            "Comment": "={{ $json.output.comment }}",
            "Sentiment": "={{ $json.output.sentiment }}"
          },
          "schema": [
            {
              "id": "Comment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reason",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA/edit?usp=drivesdk",
          "cachedResultName": "Reddit post's comment sentiment analysis"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gc9orBYG6NkEvySy",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9fac1e20-5b36-47c7-9fa3-74fbdeb49520",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -608
      ],
      "parameters": {
        "color": 6,
        "width": 352,
        "height": 784,
        "content": "### 🔹 **第一部分:触发器与输入设置**"
      },
      "typeVersion": 1
    },
    {
      "id": "23c69791-3aef-453e-91b7-c32c75066f96",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -688
      ],
      "parameters": {
        "color": 4,
        "width": 352,
        "height": 880,
        "content": "### 🔹 **第二部分:快照创建与等待**"
      },
      "typeVersion": 1
    },
    {
      "id": "1fe96203-40e6-446d-b6d5-d36d98cafd0d",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -672
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 864,
        "content": "### 🔹 **第三部分:下载与限制数据**"
      },
      "typeVersion": 1
    },
    {
      "id": "9cffe2f5-f99c-495f-96f0-4b08a7dcab33",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -1120
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 1312,
        "content": "### 🔹 **第四部分:情感分析与存储**"
      },
      "typeVersion": 1
    },
    {
      "id": "3af53eb1-98d7-441a-bf70-8db0d468c891",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1824,
        -1120
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 240,
        "content": "## 如果您通过此链接加入 Bright Data,我将获得少量佣金 — 感谢您支持更多免费内容!"
      },
      "typeVersion": 1
    },
    {
      "id": "5e9cc429-7b58-476c-9e85-9881f9d93285",
      "name": "## 1. 创建新的自定义 OpenAI 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        -608
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "82f3a17c-4317-4132-92e4-f5a3e00c38bb",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 1289,
        "height": 3106,
        "content": "## 🌐✨ Reddit 情感分析器 – 工作流详解"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Limit to 5 Comments": {
      "main": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Reddit Post URL": {
      "main": [
        [
          {
            "node": "Bright Data: Get comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: Manual Start": {
      "main": [
        [
          {
            "node": "Set Reddit Post URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Sentiment Classifier": {
      "main": [
        [
          {
            "node": "Save Sentiment to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data: Get comments": {
      "main": [
        [
          {
            "node": "Wait for Snapshot Processing (5 min)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Snapshot Processing (5 min)": {
      "main": [
        [
          {
            "node": "Bright Data: Download Comments Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data: Download Comments Snapshot": {
      "main": [
        [
          {
            "node": "Limit to 5 Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研, AI 摘要总结

需要付费吗?

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

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

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

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

外部链接
在 n8n.io 查看

分享此工作流