8
n8n 中文网amn8n.com

使用AI分析YouTube评论自动检测情感倾向

中级

这是一个AI, Marketing领域的自动化工作流,包含 15 个节点。主要使用 If, Set, Code, SplitOut, QuickChart 等节点,结合人工智能技术实现智能自动化。 使用 Google Gemini AI 和 Google Sheets 进行 YouTube 评论情感分析

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "SFcUKSlMqxy2Mp1m",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "使用AI分析YouTube评论自动检测情感倾向",
  "tags": [],
  "nodes": [
    {
      "id": "511187aa-886f-47ac-852c-265a57c5d258",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1180,
        600
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ba78c8c6-9919-4aeb-a31a-038efed110c2",
      "name": "情感分析",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        2200,
        820
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "98fabfbd-5056-4689-bb7e-f402601df3ff",
      "name": "评论",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        120
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c73a4bc3-ff82-47a5-9543-88e1e4296d4f",
      "name": "分割评论",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2380,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7c5c1a93-aa59-4c72-afa5-2b4a3db8ac96",
      "name": "保存评论",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2680,
        120
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "7429d0be-8e6b-4c7d-a675-37cfb7c5f8a6",
      "name": "多页面?",
      "type": "n8n-nodes-base.if",
      "position": [
        2300,
        380
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d9724597-4fc2-4260-a7fd-2879e9fc5b81",
      "name": "下一页令牌",
      "type": "n8n-nodes-base.set",
      "position": [
        2680,
        360
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "4a351a8a-0fe1-4754-9af7-b7e283483b93",
      "name": "获取评论",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1500,
        800
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "2834427f-b9b6-4c8b-b397-d8d9fc9e6bdf",
      "name": "获取API评论",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1820,
        380
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "d5eca980-83e2-4313-966a-9110452d0fc9",
      "name": "视频ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        380
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "e076838e-4b0a-4dc3-8992-542b195364ad",
      "name": "循环遍历评论",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1840,
        800
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "d5872dff-4d3e-477d-804c-6b91867000d4",
      "name": "更新情感分析",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2680,
        820
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "19e8680b-522f-4fc3-9344-1ce74b0b3c67",
      "name": "Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2160,
        1060
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "26f9f88d-94b7-425c-80c7-3fc1ff448240",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        120
      ],
      "parameters": {
        "content": "确保您的表名与实际知识库结构匹配"
      },
      "typeVersion": 1
    },
    {
      "id": "8f4cc894-8bbb-4706-a2a6-ef1546eca495",
      "name": "QuickChart",
      "type": "n8n-nodes-base.quickChart",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9ce04150-1ad5-40bd-89a8-cf8a5e1babdb",
  "connections": {
    "Comments": {
      "main": [
        [
          {
            "node": "Split comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ID Video": {
      "main": [
        [
          {
            "node": "Get API Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Multipage?": {
      "main": [
        [
          {
            "node": "nextPageToken",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get comments": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "Sentiment Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save comments": {
      "main": [
        []
      ]
    },
    "nextPageToken": {
      "main": [
        [
          {
            "node": "Get API Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split comments": {
      "main": [
        [
          {
            "node": "Save comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get API Comments": {
      "main": [
        [
          {
            "node": "Multipage?",
            "type": "main",
            "index": 0
          },
          {
            "node": "Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sentiment": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Comments": {
      "main": [
        [],
        [
          {
            "node": "Sentiment Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment Analysis": {
      "main": [
        [
          {
            "node": "Update sentiment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update sentiment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update sentiment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get comments",
            "type": "main",
            "index": 0
          },
          {
            "node": "ID Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

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

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

作者

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza

外部链接
在 n8n.io 查看

分享此工作流