ChatGPTSalesRevenue growthAI score · 73/100AI-assisted edit · no obvious prompt-injection riskn8n.io

Generate UGC Ads from Google Sheets with Fal.ai Models (nano-banana, WAN2.2, Veo3) in n8n

Read a Google Sheet row → generate ad image (Gemini / nano-banana) → analyze image and expand scene → generate 5–8s video (Veo3 / WAN2.2) → upload to Drive and write link back

ExperiencedStepsWorkflowPromptTip
Who
Marketers, creators, and automation builders who need bulk UGC-style ad assets
You get
Automatically produce ad images or 5–8s short videos from spreadsheet rows, save to Google Drive, and write URLs back to the sheet
You need
n8n · google-sheets · google-drive

Constraints

Prerequisites: n8n instance; Google Sheets / Google Drive OAuth2 credentials; Fal.ai API key (env var FAL_KEY); OpenAI / OpenRouter credentials. The Google Sheet needs columns: product | presenter | prompt | img_url | video_url. Drive files must be set to Anyone with link → Viewer. Start with Zone 0 to verify the image-only flow, then test Zone 1 + Zone 2 for the full image-to-video pipeline.

What they did

Author jaruphatj published this workflow on the n8n official template gallery, offering three branches that can run independently or in series: Zone 0 generates static ad images with Gemini; Zone 1 generates images with Fal.ai nano-banana and analyzes them with gpt-4o; Zone 2 uses an AI Agent to expand scene descriptions, then calls Fal.ai Veo3 (or WAN2.2) to produce 5–8s videos, finally saving to Google Drive and updating the Sheet.

How it went

Author report (author_report): the template turns spreadsheet rows into ad images and short videos, supporting batch generation. The template has 4808 views on n8n.io.

Worth knowing

1. Not tested by this site (reproduction=not_tested); verify all node credentials and expressions yourself. 2. The AI Agent prompt asks for plain text, but the downstream Structured Output Parser enforces JSON schema—there is a known format tension; autoFix may not cover all cases, so test with a sample first. 3. The WAN2.2 node is disabled by default; enable manually and confirm parameters and billing. 4. Zone 0's wait20sec node has amount=10 (seconds), not 20—follow the parameter value. 5. setBase64data parses `choices[0].message.images[0].image_url.url`; if OpenRouter changes response structure, this will break. 6. Drive files must be set to Anyone with link → Viewer, otherwise image/video generation steps will 403. 7. Video generation can take significant time; queues may form during peak hours—retry with *-fast models or off-peak times.

n8n workflow template

Structure checked · Not run-tested

Use “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

  • Get Data1 node: connect Google Sheets OAuth2 credentials.
  • CreateImagebyOpernRouter (gemini-2.5-flash-image-preview:free) node: connect HTTP Header Auth credentials.
  • uploadImagetoGdrive node: connect Google Drive OAuth2 credentials.
  • updateImageURL node: connect Google Sheets OAuth2 credentials.
  • HTTP Request node: connect HTTP Header Auth credentials.
  • uploadImagetoGdrive1 node: connect Google Drive OAuth2 credentials.
  • updateVideoURL node: connect Google Sheets OAuth2 credentials.
  • Call Fal.ai API (WAN2.2) node: connect HTTP Header Auth credentials.
  • Analyze image node: connect OpenAI API credentials.
  • Get the image node: connect HTTP Header Auth credentials.
  • Get image status node: connect HTTP Header Auth credentials.
  • Call Fal.ai API (nannoBanana) node: connect HTTP Header Auth credentials.
  • Get Data node: connect Google Sheets OAuth2 credentials.
  • Get the video node: connect HTTP Header Auth credentials.
  • Get the video status node: connect HTTP Header Auth credentials.
  • OpenAI Chat Model1 node: connect OpenAI API credentials.
  • Veo3 node: connect HTTP Header Auth credentials.

Configuration to replace

  • Source template is n8n public workflow #8205 (~36 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

  1. Zone 0: Generate ad image (Gemini / OpenRouter path)

    After importing the template into n8n, run the Zone 0 image-only branch first. It reads the Gemini tab in Google Sheets, filtering rows where img_url is empty. A Set node converts Drive share links to direct links (`uc?export=view&id=`). Then an HTTP Request node calls OpenRouter with model `google/gemini-2.5-flash-image-preview:free`, passing the prompt and product image URL to generate an image. After a 10-second wait, a Code node splits the returned data URI into base64, mimeType, and fileName. Convert to File turns it into binary, uploads to a Google Drive folder, and finally writes the image link back to the Gemini sheet's img_url column.

  2. Zone 1: Generate image and analyze (Fal nano-banana + OpenAI Vision)

    Run the Zone 1 branch: read the nanoBanana tab for rows with empty video_url. Use a Set node to convert Drive links to direct links. POST to `https://queue.fal.run/fal-ai/nano-banana/edit` via HTTP Request with prompt, image_urls, num_images=1, output_format=jpeg. Obtain status_url and poll: query status → If check for COMPLETED → if not, Wait 10s and retry. Once done, fetch the result image URL via `requests/{request_id}`. Feed that image into the OpenAI Vision node (model chatgpt-4o-latest) for analysis, requesting JSON output with brand, color scheme, font, visible text, product type, or character info.

    Execution prompt · Source text。OpenAI Vision node (Analyze image) text field

    Analyze the image: is it a product, a character, or both?
    
    If product → return JSON:
      brand_name: (brand if visible/inferable)
      color_scheme:
        - hex: (HEX of main colors)
          name: (color name)
      font_style: (if visible)
      visible_text: |
        (all legible text exactly)
      product_type: (type of product)
      visual_description: (1–2 sentences about subject)
    
    If character → return JSON:
      character_name: (if known/inferable)
      color_scheme:
        - hex: (HEX of main colors on outfit/character)
          name: (color name)
      outfit_style: (clothes/accessories)
      visual_description: (1–2 sentences about subject)
    
    Output JSON only.
  3. Zone 2-1: Expand video scene description (AI Agent)

    Pass the Zone 1 image analysis into the AI Agent node 'Describe Each Scene for Video'. It connects to an OpenAI Chat Model (gpt-4o) and a Structured Output Parser, expanding the analysis into a 5-second UGC-style video scene. The agent prompt requests plain text in five sections: Characters, Scene Background, Camera Movement, Movement in Scene, Sound Design. However, the downstream Structured Output Parser enforces a JSON schema (characters array, scene_description, camera_movement, object_movements, sound_effects). When building, note that the agent's text output will be parsed against this schema; format mismatches may trigger autoFix or errors. Test with a sample first.

    Execution prompt · Source text。AI Agent node (Describe Each Scene for Video) text field

    =You are a Video Scene Prompt Generator for Veo3. 
    Your job is to take the scene input below and expand it into a detailed 5-second video description, following these rules:
    
    1. Use the scene input as the core reference. Do not remove or alter product names, logos, or visible text from the reference image.
    2. Expand the description into a natural, realistic **UGC-style video scene**. The output must feel authentic, casual, and human-made (like a phone video).
    3. Break down the scene into these sections:
       - Characters: List all characters in the scene with age, attire, appearance, posture, emotion, and what they are doing.
       - Scene Background: Describe the environment in detail (location, lighting, colors, props, atmosphere, time of day).
       - Camera Movement: Describe how the camera moves (handheld, selfie, panning, zooming, tilt, etc.), as if filmed on a smartphone.
       - Movement in Scene: Show how the character(s) and product interact or move naturally in the 5-second clip.
       - Sound Design: Suggest casual voice/dialogue (under 150 characters, natural & authentic tone), plus ambient sounds or background noise that fit the scene.
    
    4. The **dialogue** should sound natural, short, and conversational (like talking to a friend), not scripted or commercial. 
    5. Keep everything **photorealistic** and authentic, not overly polished or cinematic. Emphasize realism and relatability.
    
    Scene Input (from previous step):
    {{ $json.content }}
    
    Return your answer in **plain text** exactly in the following structure (no JSON, no extra commentary):
    
    Characters:
    - ...
    - ...
    
    Scene Background: ...
    Camera Movement: ...
    Movement in Scene: ...
    Sound Design: ...
  4. Zone 2-2: Generate video (Veo3 main path)

    Use the Veo3 HTTP Request node to POST to `https://queue.fal.run/fal-ai/veo3/image-to-video`. The request body concatenates Structured Output Parser fields: characters[0].description + scene_description + camera_movement + object_movements + sound_effects as prompt; image_url from the Zone 1 result image; duration fixed at 8s; generate_audio=true; resolution=720p. After submission, obtain status_url and enter a polling loop similar to Zone 1: Wait → Get video status → Switch on COMPLETED/IN_PROGRESS/IN_QUEUE → once completed, Get the video to download the MP4.

  5. Zone 2-3: Upload video and write back to sheet (with WAN2.2 optional path)

    After downloading the video via HTTP Request, upload the binary to Google Drive (can use the same folder as images), then write the video link back to the nanoBanana sheet's video_url column, matching on product. WAN2.2 is an optional fallback path: the node 'Call Fal.ai API (WAN2.2)' is disabled by default; when enabled, it POSTs to `https://queue.fal.run/fal-ai/wan/v2.2-a14b/image-to-video` with parameters including prompt (wrapped in XML with characters/scene_description/camera_movement/object_movements), num_frames=81, frames_per_second=18, resolution=720p, aspect_ratio=auto, num_inference_steps=27, enable_safety_checker=true, enable_prompt_expansion=false, acceleration=regular, guidance_scale=3.5, guidance_scale_2=3.5, shift=5, interpolator_model=film, num_interpolated_frames=1, adjust_fps_for_interpolation=true, and image_url. This path serves as an alternative to Veo3; switch based on output quality and cost.

Prompt you can copy

Reference prompt · Editorial suggestion。Setup assistant starter: confirm n8n credentials (googleSheetsOAuth2Api, googleDriveOAuth2Api, httpHeaderAuth, openAiApi) and env var FAL_KEY are configured; Sheet and Drive permissions are enabled; then import workflow JSON and test Zone by Zone

This block is the prompt. Ads are never placed here.

Test in order Zone 0 → Zone 1 → Zone 2; for Zone 2 verify Veo3 first before enabling WAN2.2; watch for format tension between AI Agent plain-text output and Structured Output Parser

Source

Generate UGC ads from Google Sheets with Fal.ai models (nano-banana, WAN2.2, Veo3) · jaruphatj · n8n.io · 2025-09-03

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related