用 n8n 自动生成短视频:OpenAI 脚本 + Veo 3 视频 + Gmail 分发
输入:每日定时触发 + 自定义主题提示词;处理:AI 生成脚本→视频提示词→Veo 3 渲染→轮询等待→下载;输出:带社媒文案的邮件附件
- 给谁
- 需要在 n8n 中搭建每日自动化短视频工作流的内容运营者或开发者
- 你会得到
- 每天自动生成一段 8 秒 AI 视频及配套社媒文案,通过邮件发送
硬约束
前置条件:可访问的 n8n 实例;已配置的 openAiApi 凭证(用于三个 OpenAI 节点);已配置的 gmailOAuth2 凭证(用于发送邮件);Google Generative Language API key(用于 Veo 3 视频生成与状态查询)。费用:OpenAI API 按 token 计费,Veo 3 按 Google API 定价,n8n 自托管或云实例按方案计费。边界:模板默认脚本为财经新闻,修改主题需编辑 Generate News Script 节点的 prompt;Veo 3 视频生成为异步长时任务,需轮询状态;视频固定 8 秒、16:9 比例。
他们做了什么
作者 itechnotion 在 n8n 模板库发布了该工作流,展示了一个四阶段自动化流程:每日定时触发后,由 gpt-4.1-mini 生成财经新闻口播脚本,同时并行生成 Veo 3 视频画面提示词和社媒发布文案;随后通过 Google Generative Language API 调用 Veo 3 异步生成 8 秒 16:9 视频,经 30 秒等待和状态轮询后下载成品,最终通过 Gmail 将视频附件与文案发送给指定邮箱。
效果如何
来源报告该模板可实现「每日自动生成任何细分领域的 AI 短视频」并「省去手动编辑和等待时间」(author_report)。模板在 n8n.io 上显示为已发布状态,view 数 1364 次。
值得知道
模板默认脚本领域为财经新闻,若用于营销、教育、产品更新等其他主题,必须手动修改 Generate News Script 节点的 prompt。Veo 3 视频生成依赖 Google Generative Language API,需单独申请 API key 并关注其预览版可用性与定价。Gmail 节点使用 OAuth2 凭证,需提前完成 Google Cloud 控制台授权配置。工作流中的 If 循环依赖 $json.done 布尔字段,若 Google API 响应结构变更,轮询逻辑可能失效。本站未实测该工作流的导入与执行(reproduction=not_tested)。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- Send a message 节点:绑定Gmail OAuth2 凭证。
- Social Media Description 节点:绑定OpenAI API 凭证。
- Generate News Script 节点:绑定OpenAI API 凭证。
- Generate Veo3 Prompt 节点:绑定OpenAI API 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #8626(约 14 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
设置每日定时触发器
在 n8n 工作流中添加 Schedule Trigger 节点,配置为每日自动运行一次。该节点将作为整个工作流的入口。
配置三个 OpenAI 内容生成节点
依次添加并配置以下三个 OpenAI 节点,模型均选择 gpt-4.1-mini(来源默认值,可更换为 gpt-4.1 或 gpt-4)。三个节点从 Generate News Script 并行输出: 1. Generate News Script:生成 8 秒口播脚本。将节点 prompt 替换为你所在领域的主题(默认财经新闻)。 2. Generate Veo3 Prompt:接收脚本输出,生成给 Veo 3 的视频画面描述提示词。 3. Social Media Description:接收同一脚本,生成 LinkedIn/Instagram/YouTube 的发布文案。 注意:如需非财经主题,必须修改 Generate News Script 的 system prompt 中的领域描述。
运行提示词 · 来源原文。Generate News Script 节点的 messages.values[0].content 字段
={ "prompt": "You are a financial news assistant. Create an 8-second spoken-style script that delivers the latest globally trending stock market and trading news. Focus on the most impactful and recent global market movements such as major index shifts (S&P 500, Nasdaq, Dow Jones, FTSE, Nikkei), commodities (oil, gold), forex, or crypto. The script should be concise, engaging, and easy for a general audience to understand. Keep the tone urgent and informative, suitable for a quick news reel. Limit output to 3-4 short sentences, no bullet points." }运行提示词 · 来源原文。Generate Veo3 Prompt 节点的 messages.values[0].content 字段
={ "prompt": "You are a video prompt generator for Veo 3. Convert the following financial news script into a clear, descriptive video generation prompt. The goal is to help Veo 3 create an engaging 8-second news-style video. Translate the spoken script into visuals: describe a professional news anchor, newsroom or studio setting, relevant background visuals (stock tickers, charts, global maps, trading floors), and overall mood (urgent, professional, engaging). Ensure the prompt is cinematic, easy for Veo 3 to understand, and matches the script's content and tone. Do not repeat the script text, only describe the visuals and style. Here is the script:{{ $json.message.content }} " }运行提示词 · 来源原文。Social Media Description 节点的 messages.values[0].content 字段
={ "prompt": "You are a social media content assistant. Take the following 8-second financial news script and create an engaging, SEO-friendly social media description suitable for LinkedIn, Instagram, and YouTube. The description should summarize the key points of the script, be concise, and written in a professional yet approachable tone. Include relevant hashtags for finance, stock market, and trading trends. Make it attention-grabbing to encourage viewers to watch the video. Keep the description between 50-150 words. Here is the script: {{ $json.message.content }}" }调用 Veo 3 生成视频并轮询状态
添加 HTTP Request 节点(Create Video),方法为 POST,URL 指向 Google Generative Language API 的 veo-3.0-fast-generate-preview:predictLongRunning 端点,JSON body 中传入上一步生成的视频提示词,参数 aspectRatio 固定为 16:9。随后添加 Wait 节点等待 30 秒,再添加 Status HTTP Request 节点查询生成状态(URL 使用 {{ $json.name }} 拼接),最后添加 If 节点判断 $json.done 是否为 true:若为 false,则循环回到 Wait 节点继续等待。
运行提示词 · 来源原文。Create Video 节点的 jsonBody 字段(specifyBody=json)
={ "instances": [ { "prompt":{{ $json.message.content }} } ], "parameters": { "aspectRatio": "16:9" } }下载视频并通过 Gmail 发送
添加 Download Video HTTP Request 节点,URL 设为 {{ $json.response.generateVideoResponse.generatedSamples[0].video.uri }},用于获取最终视频文件。再添加 Gmail 节点(Send a message),配置收件人地址、主题「The video is ready to share on social media.」,正文引用 Social Media Description 节点的输出(Description:{{ $json.message.content }}),并在 attachmentsUi.attachmentsBinary 中附加下载的视频文件。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你是一个 n8n 工作流搭建助手。用户希望复现一个自动生成短视频并通过邮件分发的工作流。请先确认用户已具备:1)n8n 实例访问权限;2)openAiApi 凭证;3)gmailOAuth2 凭证;4)Google Generative Language API key。然后引导用户按以下顺序操作:导入 workflow JSON → 检查并替换凭证 ID → 修改 Generate News Script 的 prompt 以匹配目标领域 → 配置 Gmail 收件人地址 → 测试单次执行。
此提示词用于启动工作流复现对话,不是节点运行指令。节点内的实际执行提示词已在步骤中列出。
来源
Create short-form AI videos for any topic using OpenAI, Veo 3 & Gmail · itechnotion · n8n.io · 2025-09-16
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。