n8n UGC 广告工厂:从表格输入到 AI 视频自动拼接的完整流水线
在 n8n 中搭建四阶段自动化流水线:Google Sheets 输入 → AI 生成参考图 → 脚本拆分为 8 秒场景 → VEO3 视频片段生成 → fal.ai FFmpeg 拼接输出最终视频
- 给谁
- 需要批量生成 UGC 风格视频广告、且已使用 n8n 与 Google Workspace 的营销团队或自动化工程师
- 你会得到
- 在 Google Sheets 填写脚本与角色描述后,自动获得可下载的完整拼接视频链接
- 你需要
- n8n · google-sheets · google-drive
硬约束
前置条件:n8n 实例(建议自托管或企业版)、Google Sheets OAuth2 凭证、Kie API 密钥(Nano Banana + VEO3)、OpenRouter 密钥(调用 Claude Opus)、OpenAI 密钥(gpt-4o-mini 图像分析)、fal.ai 密钥(FFmpeg 拼接)。需在 Google Sheets 创建两个工作表:Videos(活动级)与 Video Data(场景级),列名须与模板节点映射完全一致。输出格式为 Google Drive 共享链接。费用取决于各 API 调用量,模板未提供具体定价。
他们做了什么
作者 ghufranbarcha 在 n8n 官方模板库发布了该工作流,展示了一个端到端的 UGC 视频广告自动化流水线。模板从 Google Sheets 读取脚本与角色描述,通过 Kie Nano Banana 生成参考图像,经 gpt-4o-mini 分析视觉一致性后,由 Claude Opus 将脚本拆分为 8 秒场景,再使用 Kie VEO3 逐场景生成视频片段,最终通过 fal.ai FFmpeg 拼接为完整视频,全程状态回写 Sheets。
效果如何
作者报告该模板可实现「从表格输入到完整视频」的全自动流程,支持场景级重试与错误日志(author_report)。模板在 n8n.io 上被浏览 1905 次(截至采集日)。由于本站未实际运行,具体成功率、生成时长与费用未验证。
值得知道
1. 模型配置注意:图像分析节点显式使用 gpt-4o-mini,脚本生成节点通过 OpenRouter 调用 anthropic/claude-opus-4.5;描述中提到的 'Claude-4o-mini' 应为作者笔误,实际节点配置为 gpt-4o-mini。 2. 凭证需求:除 Google Sheets OAuth2 外,Kie、OpenRouter、OpenAI、fal.ai 均需通过 HTTP Header Auth 配置,模板中使用了 genericCredentialType。 3. 表结构敏感:Videos 与 Video Data 的列名、LAUNCH CREATION / LAUNCH 状态值必须与节点映射完全一致,否则更新失败。 4. 轮询与等待:图像生成与视频片段生成均使用 Wait 节点(默认 60s/10min)+ HTTP 轮询,实际耗时取决于 Kie 与 VEO3 队列。 5. 重试机制:单个场景失败可在 Video Data 表设置 LAUNCH=Redo,15 分钟定时触发会重新处理;Videos 表失败需重新设置 LAUNCH CREATION=Create。 6. 拼接前置条件:Code 节点校验 totalItems >= totalScenes 后才进入 fal.ai 拼接,避免片段不全导致输出异常。 7. 费用未知:Kie、VEO3、fal.ai、OpenRouter、OpenAI 均按调用计费,模板未提供成本估算。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- googleSheets 节点:绑定Google Sheets OAuth2 凭证。
- httpRequest 节点:绑定相关 HTTP / API 密钥(按节点 Header 或 Query 配置)。
- openAi 节点:绑定OpenAI API 凭证。
- googleDrive 节点:绑定Google Drive OAuth2 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #14316(约 61 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
准备输入:在 Google Sheets 创建视频任务
在 Videos 表新增一行,填写 SCRIPT(脚本全文)、CHARACTER/SETTING DESCRIPTION(角色/场景描述)、ASPECT RATIO(如 9:16)。将 LAUNCH CREATION 设为 Create。模板通过 Schedule Trigger(每 30 分钟)或 Execute Workflow Trigger 读取新行。
生成参考图像并上传 Drive
n8n 读取 Create 行后,Nano Banana Prompt Agent 根据角色描述生成 Nano Banana Pro API 的 JSON 提示词,调用 Kie API (nano-banana-2) 生成图像。工作流轮询任务状态,成功后下载图像、上传至 Google Drive 并开启任何人可读共享,获得 IMAGE URL。
运行提示词 · 来源原文。Nano Banana Prompt Agent 节点的 text 输入字段(n8n AI Agent 节点用户消息)
=Character Description: {{ $('Input').item.json.character_description }} Video Script image reference: {{ $('Input').item.json.demo_script }} Aspect_ratio: {{ $json.aspect_ratio }} Generate the complete JSON for Nano Banana Pro API.运行提示词 · 来源原文。Nano Banana Prompt Agent 节点的 systemMessage 字段(n8n AI Agent 节点系统消息)
=You are an expert at crafting photorealistic AI image prompts for authentic UGC (User Generated Content) videos. TASK: Convert the user's character description and setting into a complete Nano Banana Pro API JSON body that generates an ultra-realistic raw mobile selfie photo. Use input details to ger STRUCTURED PROMPT ELEMENTS (include ALL in your prompt string): 1. CAMERA & COMPOSITION: - "iPhone 15 Pro front camera selfie" - "9:16/169 vertical/Horizontal portrait orientation" - "close-up/Medium close up head and shoulders shot" - "35mm lens look, f/2.0 aperture" - "EXTREME shallow depth of field, heavy soft bokeh background" (CRITICAL: The background must be blurred into soft shapes to hide details for later video generation, regardless of the setting) 2. SETTING & POSTURE (Analyze user input and adapt dynamically): - IF CAR: "Subject sitting in driver's seat of a car, phone positioned like a dash-mount or held casually, car interior and window, character looking toward camera." - IF WALKING (Indoors/Outdoors): "Subject walking, holding camera at arm's length (vlog style), dynamic posture, background elements completely blurred to conceal movement. " - IF ROOM (Bedroom, Office, Bathroom): "Casual indoor environment, relaxed posture (sitting or standing), character looking toward camera." - IF OTHER: Apply natural UGC-style framing appropriate for the requested environment. 3. LIGHTING (critical for realism): - "Natural soft window light" OR "soft diffused daylight" - "Subtle rim light, no harsh shadows" - AVOID: "studio lighting", "flash", "ring light" 4. SUBJECT REALISM (anti-AI detection): - "Realistic skin texture with visible pores, subtle skin imperfections" - "Authentic facial expression, mid-conversation, natural hair" 5. IMPORTANT: - No iphone or mobile should be visible in the video. OUTPUT: Return ONLY valid JSON (no markdown, no explanation): { "prompt": "[Comprehensive prompt combining all elements above with the user's character description]", "model": "nano_banana_pro", "aspectRatio": "9:16", "resolution": "2k" }图像分析与场景脚本拆分
使用 gpt-4o-mini 分析已上传的参考图像,提取视觉一致性细节。随后通过 OpenRouter 调用 Claude Opus,将完整脚本拆分为多个约 8 秒的场景,每个场景包含 script、visual_description、movement、duration_seconds 等字段,输出结构化 JSON。
运行提示词 · 来源原文。Analyze UGC Image3 节点的 text 字段(OpenAI 图像分析节点)
Analyze this UGC image in detail. Describe the subject's appearance (age, ethnicity, hair, clothing), setting, lighting, mood, and composition. Focus on details needed for video generation consistency.
运行提示词 · 来源原文。Generate Scene Scripts3 节点的 text 输入字段(n8n AI Agent 节点用户消息)
=Image Prompt: {{ $('Workflow Configuration3').item.json.character_description }} Generated Image Analysis: {{ $json['0'].content[0].text }} User Script: {{ $('Workflow Configuration3').item.json.demo_script }} Create video scenes from this script.运行提示词 · 来源原文。Generate Scene Scripts3 节点的 systemMessage 字段(n8n AI Agent 节点系统消息)
=You are an expert Creative Director and Scriptwriter for AI-generated "talking photo" video sequences. CRITICAL GOAL Your task is to take a reference image analysis and user instructions (script/requirements) and turn them into a structured series of video scenes. VISUAL CONSISTENCY (Non-negotiable) 1. The entire video is generated from ONE static reference image. 2. The `visual_description` for EVERY scene must be IDENTICAL. 3. Use the provided image analysis to create a concise (max 300 characters) static visual description. Add: "iPhone UGC style, slightly grainy, authentic speaking gestures". SCENE GENERATION LOGIC 1. Split the script into logical segments of approximately 20 - 27 words (roughly 8 seconds of speech). 2. Output a JSON object containing a "scenes" array. SCENE STRUCTURE RULES Each object in the `scenes` array must include: - `scene_number`: Sequential integer starting at 1. - `script`: The spoken text for that specific 8-second segment. - `visual_description`: The identical string described above. - `duration_seconds`: Always 8. DYNAMIC MOVEMENT LOGIC (Crucial for Video AI): Analyze the setting from the image analysis and assign the appropriate `movement` string for EVERY scene: - IF CAR INTERIOR: "natural head movements while talking, slight camera vibration from car idling, blurred scenery passing subtly in the windows." - IF WALKING (Outdoors/Indoors): "continuous forward walking motion, subject holding camera vlog-style, natural camera bounce matching footsteps, heavily blurred background passing by smoothly." - IF STATIC ROOM (Bedroom/Office/Couch): "natural subtle body movement, slight handheld camera drift, expressive facial gestures, static blurred background." - IF OTHER: Deduce the natural physics of the scene (is the camera static or moving? is the background static or moving?) and write a brief, cohesive motion prompt. SCRIPT RULES FOR AUTHENTICITY: - Don't include pauses: "And I couldn't believe it" - Conversational tone, not salesy - NO stage directions like [smiles] or [nods] in the script text. OUTPUT: Return ONLY valid JSON: { "scenes": [ { "scene_number": 1, "script": "The spoken text...", "visual_description": "Static description of the person...", "audio_description": "No background noice", "movement": "Dynamic motion instructions based on the identified environment...", "duration_seconds": 8 } ] }逐场景生成视频片段并轮询状态
每个场景被写入 Video Data 表后,工作流调用 Kie VEO3 API 为每个场景生成视频片段(使用 FIRST_AND_LAST_FRAMES_2_VIDEO 模式)。通过 HTTP Request + Wait 节点轮询任务状态,成功后将片段上传至 Google Drive 并更新对应行的 VIDEO CLIP LINK 与 LAUNCH 状态为 Completed;失败则记录 Error。
拼接最终视频并回写链接
当所有场景状态为 Completed 后,Code 节点校验完整性,Sort 节点按 SCENE NO 排序,Aggregate 汇总片段链接,调用 fal.ai (ffmpeg-api/merge-videos) 拼接为最终视频。拼接完成后上传 Drive 并共享,将 VIDEO LINK 与 VIDEO VIEW LINK 回写至 Videos 表,LAUNCH CREATION 设为 Completed。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,协助用户理解模板结构、确认凭证与表结构,并规划测试
这一段是提示词,页面不会在这里插入广告。
你是一个熟悉 n8n 与 AI 视频自动化流水线的搭建助手。用户希望复现或理解「UGC Ads Factory」模板。请根据以下信息协助用户: 1) 确认前置条件(n8n 实例、Google Sheets OAuth2、Kie/OpenRouter/OpenAI/fal.ai 凭证); 2) 解释 Videos / Video Data 两表的列名与状态流转(Create → Processing → Completed/Failed); 3) 如需修改,提示用户调整 folderId、sheetName、model 参数与轮询间隔; 4) 提醒用户:节点内提示词为英文原文,修改时需保持 JSON 输出格式; 5) 建议先用单条测试数据验证 Kie 图像生成与 VEO3 片段生成,再启用定时触发。
将本提示词交给 AI 搭建助手,用于指导用户完成 n8n 模板导入、凭证配置与首次测试。
来源
Ads Factory: Generate Unlimited Length UGC AI Video Pipeline · ghufranbarcha · n8n.io · 2026-03-25
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。