🎬 Automated UGC video generator with Gemini images and SORA 2

⚡ 1,396 views · 🎬 Content Creation & Video

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

image.png This workflow automates the creation of user-generated-content-style product videos by combining Gemini’s image generation with OpenAI’s SORA 2 video generation. It accepts webhook requests with product descriptions, generates images and videos, stores them in Google Drive, and logs all outputs to Google Sheets for easy tracking.

Main Use Cases

How it works

The workflow operates as a webhook-triggered process, organized into these stages:

  1. Webhook Trigger & Input

    • Accepts POST requests to the /create-ugc-video endpoint.
    • Required payload includes: product prompt, video prompt, Gemini API key, and OpenAI API key.
  2. Image Generation (Gemini)

    • Sends the product prompt to Google’s Gemini 2.5 Flash Image model.
    • Generates a product image based on the description provided.
  3. Data Extraction

    • Code node extracts the base64 image data from Gemini’s response.
    • Preserves all prompts and API keys for subsequent steps.
  4. Video Generation (SORA 2)

    • Sends the video prompt to OpenAI’s SORA 2 API.
    • Initiates video generation with specifications: 720x1280 resolution, 8 seconds duration.
    • Returns a video generation job ID for polling.
  5. Video Status Polling

    • Continuously checks video generation status via OpenAI API.
    • If status is “completed”: proceeds to download.
    • If status is still processing: waits 1 minute and retries (polling loop).
  6. Video Download & Storage

    • Downloads the completed video file from OpenAI.
    • Uploads the MP4 file to Google Drive (root folder).
    • Generates a shareable Google Drive link.
  7. Logging to Google Sheets

    • Records all generation details in a tracking spreadsheet:
      • Product description
      • Video URL (Google Drive link)
      • Generation status
      • Timestamp

Summary Flow:

Webhook Request → Generate Product Image (Gemini) → Extract Image Data → Generate Video (SORA 2) → Poll Status → If Complete: Download Video → Upload to Google Drive → Log to Google Sheets → Return Response

If Not Complete: Wait 1 Minute → Poll Status Again

Benefits:


Created by Daniel Shashko

đź”— Nodes Used

Google Sheets, HTTP Request, Webhook, Google Drive

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup