n8n 自动为 YouTube 视频生成 SEO 标签并推送 Slack 通知
每周定时拉取频道新视频 → AI 分析标题与描述生成 15–20 个 SEO 标签 → 自动回写 YouTube 并通知团队
- 给谁
- 定期发布视频的 YouTube 创作者、频道管理员、营销团队,以及管理多频道的代理机构
- 你会得到
- 自动生成并应用 SEO 友好的标签,提升视频可发现性,同时通过 Slack 通知团队
硬约束
前置条件:可访问的 n8n 实例;Google Cloud 项目并已启用 YouTube Data API v3;Slack 工作区及 Bot Token;OpenAI API 密钥。所需凭证类型:openAiApi、youTubeOAuth2Api、slackOAuth2Api。可选:telegramApi(Telegram 节点当前为禁用状态)。注意:模板中「Get all videos uploaded last week」节点的 publishedAfter 实际配置为 {{ $today.minus(1,'days') }}(1 天),与描述中的「过去 7 天」不一致;Update video 节点硬编码 categoryId=28 与 regionCode=VN。
他们做了什么
模板作者 trungtran 在 n8n 上构建了一个工作流:每周自动拉取指定 YouTube 频道的新视频,通过 OpenAI GPT 模型分析视频标题、描述和频道名称生成 15–20 个 SEO 标签,再经由 YouTube Data API 将标签写回视频元数据,并通过 Slack 向团队发送包含视频标题、ID 和应用标签的确认消息。
效果如何
该模板作为 n8n 官方模板发布(n8n_id=7881),截至采集时已有 864 次查看(author_report)。来源未提供具体的频道增长数据或 A/B 测试结果。
值得知道
1. 模板中「Get all videos uploaded last week」节点的 publishedAfter 实际配置为 {{ $today.minus(1,'days') }}(1 天),与描述文案中的「过去 7 天」不一致,复现时需按需求调整。2. Update video 节点硬编码 categoryId=28(科学与技术)和 regionCode=VN,非越南地区频道需修改。3. Telegram 节点(Alternative channel to inform)当前为 disabled=true,作为 Slack 的备用通知通道,需 telegramApi 凭证。4. YouTube 标签更新为写入操作,消耗 API 配额;来源建议避免无变更重复写入,大量视频时增加 1–2 秒/条的节流。5. 来源建议增加安全校验:对 Agent 输出做逗号分割、去重、去空、长度限制,并可设置品牌关键词白名单/黑名单。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- OpenAI Chat Model 节点:绑定OpenAI API 凭证。
- Get all videos uploaded last week 节点:绑定YouTube OAuth2 凭证。
- Get video detail 节点:绑定YouTube OAuth2 凭证。
- Update video with AI generated tags 节点:绑定YouTube OAuth2 凭证。
- Inform via slack message 节点:绑定Slack OAuth2 凭证。
- Alternative channel to inform 节点:绑定Telegram API 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #7881(约 19 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
配置凭证与频道信息
在 n8n 中配置三项凭证:1) YouTube OAuth2:在 Google Cloud 创建项目,启用 YouTube Data API v3,配置 OAuth 客户端,授权管理频道的 Google 账号,添加凭证并授予 youtube.readonly 与 youtube/youtube.force-ssl 范围;2) Slack OAuth2:创建或复用 Slack App,安装到工作区并获取 Bot Token,添加 slackOAuth2Api 凭证,需 chat:write 范围;3) OpenAI API:添加 openAiApi 凭证。随后在工作流起始处设置频道 ID(Set Channel Information 节点,字段名 Channel_Id)。
设置定时触发与视频拉取
配置 Weekly Schedule Trigger 节点:选择每周运行的日期与时间(如周一 09:00)。配置「Get all videos uploaded last week」节点:resource=video,returnAll=true,filters.channelId 映射为 {{ $json.Channel_Id }},filters.publishedAfter 当前模板值为 {{ $today.minus(1,'days') }}(来源实际配置,如需 7 天请自行调整),options.order=date。
获取视频详情并送入 AI Agent
「Get video detail」节点:resource=video,operation=get,videoId 映射为 {{ $json.id.videoId }}(来自上一步的视频列表)。此节点输出视频的 snippet.title、snippet.description、snippet.channelTitle,通过主连线传入 Youtube Video Auto Tagging Agent。
AI 生成 SEO 标签
Youtube Video Auto Tagging Agent 节点使用 OpenAI Chat Model(模型可选 gpt-4.1-mini / gpt-4.1 / gpt-4)。该节点为 Agent 类型(typeVersion=2.1),promptType=define。需将视频详情字段映射到提示词变量:snippet.title → 视频标题,snippet.description → 视频描述,snippet.channelTitle → 频道名称。
运行提示词 · 来源原文。Youtube Video Auto Tagging Agent 节点的 Options > System Message 字段
You are an expert YouTube SEO strategist. Your goal is to generate a list of highly relevant, diverse, and SEO-friendly tags for a YouTube video based on its title, description, and channel name. The tags should: - Improve discoverability and ranking on YouTube search and recommendations - Cover both specific keywords (directly related to the video) and broader categories (general niche) - Include variations (short-tail and long-tail keywords) - Avoid duplicates, irrelevant terms, or hashtags (#) - Be limited to 15–20 tags, formatted as a clean comma-separated list - Prioritize high-search-intent keywords that align with the channel’s theme
运行提示词 · 来源原文。Youtube Video Auto Tagging Agent 节点的 Text 字段(User Prompt)
=Here is my YouTube video information: Title: {{ $json.snippet.title }} Description: {{ $json.snippet.description }} Channel Name: {{ $json.snippet.channelTitle }} Please analyze this information and provide me with the most relevant and SEO-friendly tags (15–20, comma-separated). Focus on tags that increase reach, match viewer search intent, and balance between trending keywords and niche keywords.回写标签到 YouTube 并发送 Slack 通知
「Update video with AI generated tags」节点:resource=video,operation=update,videoId 映射为 {{ $('Get video detail').item.json.id }},title 保持原标题,updateFields.tags 映射为 {{ $json.output }}(Agent 输出的标签字符串),updateFields.description 保持原描述。注意该节点硬编码 categoryId=28 与 regionCode=VN,按需修改。随后「Inform via slack message」节点发送确认通知。
运行提示词 · 来源原文。Inform via slack message 节点的 Text 字段
=The video ”{{ $json.snippet.title }} - {{ $json.id }}” has been auto-tagged successfully with the following tags: {{ $('Youtube Video Auto Tagging Agent').item.json.output }}
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限,再逐步指导节点配置与提示词粘贴
这一段是提示词,页面不会在这里插入广告。
你是一个 n8n 工作流搭建助手。用户想要复现「自动为 YouTube 视频生成 SEO 标签并推送 Slack 通知」的模板。请先确认用户已具备:1) n8n 实例访问权限;2) Google Cloud 项目及 YouTube Data API v3 已启用;3) Slack 工作区管理员权限可创建 App;4) OpenAI API 密钥。然后按步骤指导凭证配置、节点参数映射、提示词粘贴位置,并提醒检查 publishedAfter 日期范围与 regionCode 设置。
使用此启动词前,请准备好 YouTube 频道 ID、Google Cloud OAuth 客户端凭据、Slack Bot Token 和 OpenAI API 密钥。
来源
Automate YouTube video SEO tagging with GPT and Slack notifications · trungtran · n8n.io · 2025-08-26
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。