DEV Community

Cover image for N8N Workflow — Product Photo to Marketing Video, Automatically (Runway ML + OpenRouter)
Grewup
Grewup

Posted on

N8N Workflow — Product Photo to Marketing Video, Automatically (Runway ML + OpenRouter)

What this builds

A fully automated product marketing pipeline. You submit a product photo, title, and description through a form.

The workflow:

`1. Uploads the original image to Google Drive for storage

  1. Sends product details to an AI agent (OpenRouter) which generates a professional photography prompt
  2. Downloads the image as binary from Google Drive
  3. Uploads it to ImageBB to create a public URL
  4. Sends the public image URL + a video generation prompt to Runway ML gen-4-turbo
  5. Polls the render status until the video is complete
  6. Emails the customer the finished image URL and video link automatically`

Input: a basic product photo + title + description.

**Output: **a professional marketing video delivered to their inbox in under 15 minutes.

**Cost per video: **roughly $0.25 (Runway ML charge) plus minimal OpenRouter usage.

Architecture

`n8n Form Trigger (photo + title + description + email)
        ↓
Google Drive — upload original image (binary)
        ↓
AI Agent (OpenRouter) — generate professional photography prompt
        ↓
Google Drive — download image as binary
        ↓
HTTP Request → ImageBB API — upload image, get public URL
        ↓
HTTP Request → Runway ML API — image_to_video (gen-4-turbo)
        ↓
Wait 60s → HTTP GET → check task status → IF running → wait 5s → loop
        ↓ [loop until SUCCEEDED]
Gmail — send email with image URL + video URL`
Enter fullscreen mode Exit fullscreen mode

Step 1 — Form Trigger

Add an n8n Form Trigger node. Configure four fields:
Field 1 — Product Photo
Type: File upload
Required: Yes
Multiple: No
Name: product photo

Field 2 — Product Title
Type: Text
Required: Yes
Placeholder: your product name
Name: product title

Field 3 — Product Description
Type: Text
Required: Yes
Name: product description

Field 4 — Email Address
Type: Email
Required: Yes
Placeholder: name@example.com
Name: email

Form title: "Go to Market" — this becomes a client-facing intake form if you share the Production URL.
Click Execute Node to generate your form. Pin the test data after submitting once — this saves you re-filling the form at every subsequent node test.

Step 2 — Upload to Google Drive

Add a Google Drive node.
Operation: Upload File
File: {{ $('Form Trigger').first().binary['product photo'] }}
File name: {{ $('Form Trigger').first().json['product title'] }} (original)
Folder: product creatives
Create the "product creatives" folder in your Google Drive before connecting. The dynamic file naming means each upload is labelled with the product name so your Drive does not become a folder of unnamed files.

Step 3 — AI Agent (generate the photography prompt)

Add an AI Agent node. Connect OpenRouter credentials.
The raw product description from a form submission does not make a good image generation prompt. This node transforms it into professional photography language that Runway ML can use.
System prompt:
You are a world-class marketing strategist and expert text-to-image prompt engineer
specializing in hyper-realistic product photography prompts for AI image generation.

When given a product description, craft a detailed professional prompt that produces:

`- Hyper-realistic studio photography

  • Clean minimalistic aesthetic
  • Product as main subject with sharp detail and perfect lighting
  • Complementary background (soft gradient, light-colored, or pure white)
  • Professional lighting: softbox, studio lights, or natural soft shadows
  • High-end premium feel`

Output Format:

Write a single text-to-image prompt ready for direct input into an AI model.
Be direct and descriptive. No unnecessary repetition.

User message:

Product: {{ $('Form Trigger').first().json['product title'] }}
Description: {{ $('Form Trigger').first().json['product description'] }}
The agent output is the photography prompt string. Save it — you do not actually send it to an image generator in this workflow (Runway handles that). You will use it as context for the video generation prompt in Step 6.
Enter fullscreen mode Exit fullscreen mode

Step 4 — Download from Google Drive (as binary)

Add a second Google Drive node.

Operation: Download File
By: ID
File ID: {{ $('Upload to Google Drive').first().json.id }}
This converts the stored file back into binary data that can be processed by external APIs. You cannot send a Google Drive link to ImageBB — you need the actual binary.

Step 5 — Upload to ImageBB (create public URL)

Add an HTTP Request node.
Method: POST
URL: https://api.imgbb.com/1/upload?key=[YOUR_IMGBB_API_KEY]
Body type: Form Data
Fields:
image: [binary data from previous Google Drive node]
Get your free API key from imgbb.com → your account dashboard → API.
ImageBB returns a JSON response with multiple URL formats. Use data.url — the direct image URL without any HTML wrapping. This is what Runway ML requires.
javascript// The field you need from the response:
{{ $json.data.url }}

Step 6 — Generate video with Runway ML

Add an HTTP Request node.
Method: POST
URL: https://api.dev.runwayml.com/v1/image_to_video
Headers:
Authorization: Bearer [YOUR_RUNWAY_API_KEY]
x-runway-version: 2024-11-06
Content-Type: application/json

Body (JSON):

`{
  "model": "gen4_turbo",
  "promptImage": "{{ $('ImageBB Upload').first().json.data.url }}",
  "promptText": "Create a highly professional marketing video from the provided product photo. Simulate a smooth, realistic product rotation — slowly turning in place. Movement should be continuous, slow, and elegant — no sudden pans, jerks, or cuts. Always keep the entire product fully in frame, centered, and clearly visible. Avoid zooming in or cropping. Focus on a premium, clean, modern aesthetic suitable for commercial marketing. No flashy effects, transitions, or overlays.",
  "duration": 10,
  "ratio": "960:960"
}`
Enter fullscreen mode Exit fullscreen mode

Duration note: 10 seconds costs approximately $0.50 in Runway ML credits. 5 seconds costs approximately $0.25. For product demos, 10 seconds gives the rotation enough time to feel complete. For social media ads where shorter is better, use 5 seconds.
Ratio note: 960:960 (square) works across all platforms. If your client specifically needs 9:16 vertical for Reels/Shorts, change to "ratio": "720:1280".
The API returns a task_id immediately — the video is queued, not rendered.

Step 7 — Polling loop (wait for render)

Video generation with Runway ML takes 60–180 seconds. Build a polling loop.

Add a Wait node:

Wait: 60 seconds
Add an HTTP Request node to check status:
Method: GET
URL: https://api.dev.runwayml.com/v1/tasks/{{ $('Runway Generate').first().json.id }}
Headers:
Authorization: Bearer [YOUR_RUNWAY_API_KEY]
x-runway-version: 2024-11-06
Add an IF node:
Condition: {{ $json.status }} equals "RUNNING"
True → Wait 5 seconds → loop back to status check
False → continue to Gmail

When status equals "SUCCEEDED", the response includes an output array. The first element — output[0] — is the direct video URL.
If status equals "FAILED", add an error branch that sends an email notifying the client of the failure.

Step 8 — Send the email

Add a Gmail node. Connect via OAuth in n8n credentials.
To: {{ $('Form Trigger').first().json['email'] }}
Subject: Marketing Materials: {{ $('Form Trigger').first().json['product title'] }}
Type: HTML
Body:

`html<p>Hey,</p>

<p>Your marketing materials for <strong>{{ $('Form Trigger').first().json['product title'] }}</strong> are ready.</p>

<p><strong>Enhanced product image:</strong><br>
<a href="{{ $('ImageBB Upload').first().json.data.url }}">View image →</a></p>

<p><strong>Marketing video:</strong><br>
<a href="{{ $('Runway Status Check').first().json.output[0] }}">View video →</a></p>

<p>Both files are ready to download and use in your ads immediately.</p>

<p>Cheers,<br>
[Your name]</p>`
Enter fullscreen mode Exit fullscreen mode

What breaks

Runway ML returns 401: Your API key is wrong or your x-runway-version header is outdated. Check the current version string in Runway's API documentation — it updates periodically.
ImageBB returns 400: The image file is too large (ImageBB free tier has a 32MB limit) or the binary data is not being passed correctly. Verify the Google Drive download node is outputting binary data, not a file reference.

Status check loop never exits: Add a counter variable and a maximum iteration count (15 attempts). If the loop runs 15 times without a "SUCCEEDED" status, break to an error email. Runway rarely takes longer than 3 minutes — if it does, the task has likely failed silently.
Gmail authentication fails: Re-authorise the Gmail OAuth credential in n8n. Google OAuth tokens expire and need periodic refresh.

Extending this workflow

For agencies serving multiple clients, replace the Form Trigger with a webhook and build a simple intake page that clients access directly. Their submission triggers the workflow and they receive the video by email without any manual step from you.
For ecommerce stores with product catalogues, connect a Google Sheets trigger that iterates through product rows and generates a video for each SKU in batch mode.

The workflow JSON is at elevoras.com. Import directly into n8n and add your API keys.

What are you using this for? Drop your use case in the comments.

Top comments (0)