8
n8n 中文网amn8n.com

AI YouTube 评论分析器

高级

这是一个AI, Marketing领域的自动化工作流,包含 18 个节点。主要使用 If, Set, Code, Gmail, Limit 等节点,结合人工智能技术实现智能自动化。 使用 GPT-4o 进行 YouTube 评论分析并通过 Gmail 发送自动邮件报告

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ilZOxWFc5OLPkBYp",
  "meta": {
    "instanceId": "18c9b77a7db94bab09d77f4a9c44dd94853695bba1618cb7bc3c4bc412c07c1e"
  },
  "name": "AI YouTube 评论分析器",
  "tags": [],
  "nodes": [
    {
      "id": "d895e576-7471-403a-ba97-063db41a6027",
      "name": "工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        420
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "77450348-ad41-4c98-a79c-e9a397534385",
      "name": "触发器文档",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        160
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "305ec2f6-9839-4270-a67f-cbd2d98f8f80",
      "name": "YouTube API 部分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        140
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "562dee9f-97e1-461b-9f08-762f01d77c2a",
      "name": "AI 分析文档",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        1180
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "72b01eba-4f3b-402c-a0b6-1e14f5d86ac2",
      "name": "邮件与状态更新",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        1180
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "39e71ccf-2905-4cb7-8fb0-02e5e320910c",
      "name": "数据处理说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        1180
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1f55320c-0470-40ab-bd96-f18d7e384a3b",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "notes": "Limits processing to 1 item at a time to prevent API overload",
      "position": [
        540,
        520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "926fcced-64ae-439c-a663-cff6471ce926",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "Uses OpenAI GPT-4o to analyze comments and generate insights. Customize the prompt for different analysis needs.",
      "position": [
        360,
        800
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "fe5ce345-896c-44bd-a27a-30f833b011ce",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "notes": "Filters rows to process only videos with 'Pending' status",
      "position": [
        320,
        520
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d9414e63-9564-415c-9132-9684f449e9a1",
      "name": "设置视频详情",
      "type": "n8n-nodes-base.set",
      "notes": "Prepares video ID and sets max comments limit (100)",
      "position": [
        760,
        520
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "8ce5e890-a245-4f0b-a861-d6a1af3184b1",
      "name": "获取 YouTube 视频详情",
      "type": "n8n-nodes-base.youTube",
      "notes": "Fetches video metadata including title, channel name, and other details",
      "position": [
        980,
        520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f38cb402-9f39-4da3-8290-97798a86b615",
      "name": "获取 YouTube 视频评论",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Retrieves top 100 comments ordered by relevance using YouTube API",
      "position": [
        1220,
        520
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "f4b8ddfb-60d2-4a66-bdb0-a628b1c31a69",
      "name": "准备评论数据",
      "type": "n8n-nodes-base.code",
      "notes": "Processes raw comments: extracts text, calculates stats, performs basic sentiment analysis, limits to 50 comments for AI",
      "position": [
        120,
        800
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4659e605-f59a-401f-90d4-3bcb3e94f9e4",
      "name": "准备邮件 HTML 内容",
      "type": "n8n-nodes-base.code",
      "notes": "Converts AI analysis into formatted HTML email with statistics, insights, and professional styling",
      "position": [
        760,
        800
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4b9ee8c6-6d4b-41c7-a2bd-ef5e5ecb1079",
      "name": "Gmail 账户配置",
      "type": "n8n-nodes-base.gmail",
      "notes": "Sends formatted analysis report via Gmail. Update SENDER_EMAIL_ADDRESS with actual recipient",
      "position": [
        1000,
        800
      ],
      "webhookId": "90b8f9ad-4226-42a0-971b-7fa9f5f190bd",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "f764fdc1-b75b-4eff-a8d7-5c72381f8fb3",
      "name": "在 Google Sheets 中更新状态",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Updates video status to 'Mail Sent' to prevent duplicate processing",
      "position": [
        1220,
        800
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "7de238eb-bf67-4c47-afda-4677baba3e22",
      "name": "从 Google Sheets 中选取视频 ID",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "notes": "Triggers on new YouTube videos added to spreadsheet. Polls every minute for changes",
      "position": [
        100,
        520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fceffdda-d2b9-4986-bb1b-77959f9a1bc9",
      "name": "Azure OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        400,
        1000
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3c2e2e01-3984-440e-96b3-be2cf56cf2ad",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Set Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Prepare HTML for Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Video Details": {
      "main": [
        [
          {
            "node": "Get Youtube Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Comments Data": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare HTML for Email": {
      "main": [
        [
          {
            "node": "Gmail Account Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Youtube Video Details": {
      "main": [
        [
          {
            "node": "Get Youtube Video Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Youtube Video Comments": {
      "main": [
        [
          {
            "node": "Prepare Comments Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Account Configuration": {
      "main": [
        [
          {
            "node": "Update Status on Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick Video Ids from Google sheet": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人工智能, 营销

需要付费吗?

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

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

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

作者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部链接
在 n8n.io 查看

分享此工作流