n8n UGC Ads Factory: Automated AI Video Pipeline from Spreadsheet to Stitched Output
Build a four-stage n8n automation: Google Sheets input → AI reference image → script split into 8-second scenes → VEO3 clip generation → fal.ai FFmpeg final stitch
- Who
- Marketing teams or automation engineers already using n8n and Google Workspace who need batch UGC-style video ads
- You get
- Fill a Google Sheet with script and character description, then receive a downloadable stitched video link automatically
- You need
- n8n · google-sheets · google-drive
Constraints
Prerequisites: n8n instance (self-hosted or enterprise recommended), Google Sheets OAuth2 credential, Kie API key (Nano Banana + VEO3), OpenRouter key (Claude Opus), OpenAI key (gpt-4o-mini image analysis), fal.ai key (FFmpeg stitching). Create two tabs in Google Sheets: Videos (campaign-level) and Video Data (scene-level); column headers must exactly match the workflow node mappings. Output is Google Drive shared links. Costs depend on API usage; no pricing estimate is provided in the template.
What they did
Author ghufranbarcha published this workflow on the n8n official template gallery, demonstrating an end-to-end UGC video ad automation pipeline. The template reads script and character description from Google Sheets, generates a reference image via Kie Nano Banana, analyzes visual consistency with gpt-4o-mini, splits the script into 8-second scenes with Claude Opus, generates per-scene clips with Kie VEO3, and stitches the final video with fal.ai FFmpeg, writing status back to Sheets throughout.
How it went
The author reports the template enables a fully automated "spreadsheet-to-final-video" flow with per-scene retry and error logging (author_report). The template had 1,905 views on n8n.io as of the fetch date. Actual success rate, generation latency, and costs were not verified by this site.
Worth knowing
1. Model configuration note: the image analysis node explicitly uses gpt-4o-mini; the script generation node calls anthropic/claude-opus-4.5 via OpenRouter. The description's mention of 'Claude-4o-mini' appears to be a typo by the author; actual node config uses gpt-4o-mini. 2. Credential requirements: besides Google Sheets OAuth2, Kie, OpenRouter, OpenAI, and fal.ai all require HTTP Header Auth via genericCredentialType in the template. 3. Sheet structure sensitivity: column names in Videos and Video Data, and status values LAUNCH CREATION / LAUNCH, must exactly match node mappings or updates will fail. 4. Polling and waits: both image generation and clip generation use Wait nodes (default 60s/10min) plus HTTP polling; actual duration depends on Kie and VEO3 queue depth. 5. Retry mechanism: individual scene failures can be retried by setting LAUNCH=Redo in Video Data (15-minute trigger); Videos tab failures require resetting LAUNCH CREATION=Create. 6. Stitching precondition: a Code node verifies totalItems >= totalScenes before invoking fal.ai, preventing incomplete-clip stitching. 7. Costs unknown: Kie, VEO3, fal.ai, OpenRouter, and OpenAI are all usage-based; the template provides no cost estimate.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- googleSheets node: connect Google Sheets OAuth2 credentials.
- httpRequest node: connect HTTP/API keys per node headers or query params.
- openAi node: connect OpenAI API credentials.
- googleDrive node: connect Google Drive OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #14316 (~61 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Prepare input: create a video task in Google Sheets
Add a row in the Videos tab with SCRIPT (full script text), CHARACTER/SETTING DESCRIPTION, and ASPECT RATIO (e.g., 9:16). Set LAUNCH CREATION to Create. The template reads new rows via Schedule Trigger (every 30 minutes) or Execute Workflow Trigger.
Generate reference image and upload to Drive
After reading a Create row, the Nano Banana Prompt Agent builds a JSON prompt for the Nano Banana Pro API and calls Kie API (nano-banana-2) to generate the image. The workflow polls task status, then downloads the image, uploads it to Google Drive with anyone-reader sharing, and stores the IMAGE URL.
Execution prompt · Source text。Nano Banana Prompt Agent node text input field (n8n AI Agent node user message)
=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.Execution prompt · Source text。Nano Banana Prompt Agent node systemMessage field (n8n AI Agent node system message)
=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" }Image analysis and scene script splitting
The uploaded reference image is analyzed by gpt-4o-mini for visual consistency details. Then Claude Opus via OpenRouter splits the full script into multiple ~8-second scenes, each containing script, visual_description, movement, duration_seconds, etc., output as structured JSON.
Execution prompt · Source text。Analyze UGC Image3 node text field (OpenAI image analysis node)
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.
Execution prompt · Source text。Generate Scene Scripts3 node text input field (n8n AI Agent node user message)
=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.Execution prompt · Source text。Generate Scene Scripts3 node systemMessage field (n8n AI Agent node system message)
=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 } ] }Per-scene video clip generation with status polling
After scenes are written to the Video Data tab, the workflow calls Kie VEO3 API for each scene (FIRST_AND_LAST_FRAMES_2_VIDEO mode). It polls task status via HTTP Request + Wait nodes. On success, the clip is uploaded to Google Drive and the row is updated with VIDEO CLIP LINK and LAUNCH=Completed; on failure, Error is logged.
Stitch final video and write back links
Once all scenes are Completed, a Code node verifies completeness (totalItems >= totalScenes), a Sort node orders by SCENE NO, an Aggregate node collects clip links, and fal.ai (ffmpeg-api/merge-videos) stitches the final video. After stitching, the video is uploaded to Drive and shared, and VIDEO LINK / VIDEO VIEW LINK are written back to the Videos tab with LAUNCH CREATION=Completed.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to a setup assistant to help the user understand template structure, confirm credentials and sheet structure, and plan testing
This block is the prompt. Ads are never placed here.
You are a setup assistant familiar with n8n and AI video automation pipelines. The user wants to replicate or understand the "UGC Ads Factory" template. Help them with: 1) Confirm prerequisites (n8n instance, Google Sheets OAuth2, Kie/OpenRouter/OpenAI/fal.ai credentials); 2) Explain the Videos / Video Data tab structure and status flow (Create → Processing → Completed/Failed); 3) If modifications are needed, prompt the user to adjust folderId, sheetName, model parameters, and polling intervals; 4) Remind the user that node prompts are in English source text; maintain JSON output format when editing; 5) Suggest testing with a single row first to validate Kie image generation and VEO3 clip generation before enabling scheduled triggers.
Feed this prompt to an AI setup assistant to guide users through n8n template import, credential configuration, and first test.
Source
Ads Factory: Generate Unlimited Length UGC AI Video Pipeline · ghufranbarcha · n8n.io · 2026-03-25
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.