Skip to main content

Generate AI product ad images from Google Sheets using Fal.ai and OpenAI

Workflow preview

Workflow preview
100%
Generate AI product ad images from Google Sheets using Fal.ai and OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

️ Note: All sensitive credentials should be set via n8n Credentials or environment variables. Do not hardcode API keys in nodes. Who’s it for Marketers, creators, and automation builders who want ...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.splitout, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jaruphat J..

Original n8n.io source

1.1 Workflow description

Title
Generate AI product ad images from Google Sheets using Fal.ai and OpenAI
Workflow name
Generate AI product ad images from Google Sheets using Fal.ai and OpenAI

⚠️ Note: All sensitive credentials should be set via n8n Credentials or environment variables. Do not hardcode API keys in nodes.


Who’s it for

Marketers, creators, and automation builders who want to generate UGC-style ad images automatically from a Google Sheet. Ideal for e‑commerce SKUs, agencies, or teams that need many variations quickly.


What it does (Overview)

This template turns a spreadsheet row into ad images ready for campaigns.

  • Zone 1 — Create Ad Image: Reads product rows, downloads image, analyzes it, generates prompts, appends results back into Google Sheet.
  • Zone 2 — Create Image (Fal nano‑banana): Generates ad image variations, polls Fal.ai API until done, uploads to Drive, and updates sheet with output URLs.

Requirements

  • Fal.ai API key (env: FAL_KEY)
  • Google Sheets / Google Drive OAuth2 credentials
  • OpenAI (Vision/Chat) for image analysis
  • A Google Sheet with columns for product and output
  • Google Drive files set to Anyone with link → Viewer so APIs can fetch them

How to set up

  1. Credentials: Add Google Sheets + Google Drive (OAuth2), Fal.ai (Header Auth with Authorization: Key {{$env.FAL_KEY}}), and OpenAI.
  2. Google Sheet: Create sheets with the following headers.

Sheet: product

product_id | product_name | product_image_url | product_description | campaign | brand_notes | constraints | num_variations | aspect_ratio | model_target | status

Sheet: ad_image

scene_ref | product_name | prompt | status | output_url
  1. Import the workflow: Use the provided JSON. Confirm node credentials resolve.
  2. Run: Start with Zone 0 to verify prompt-only flow, then test Zone 1 for image generation.

Zone 1 — Create Ad Image (Prompt-only)

Reads product row, normalizes Drive link, analyzes image, generates structured ad prompts, appends to ad_image sheet.


Zone 2 — Create Image (Fal nano‑banana)

Reads product row, converts Drive link, generates image(s) with Fal nano‑banana, polls until complete, uploads to Drive, updates sheet.


Node settings (high‑level)

Drive Link Parser (Set)

{{ (() => {
  const u = $json.product || '';
  const q = u.match(/[?&]id=([\-\w]{25,})/);
  const d = u.match(/\/d\/([\-\w]{25,})/);
  const any = u.match(/[\-\w]{25,}/);
  const id = q?.[1] || d?.[1] || (any ? any[0] : '');
  return id ? 'https://drive.google.com/uc?export=view&id=' + id : '';
})() }}

How to customize the workflow

  • Adjust AI prompts to change ad style (luxury, cozy, techy).
  • Change aspect ratio for TikTok/IG/Shorts (9:16, 1:1, 16:9).
  • Extend Sheet schema for campaign labels, audiences, hashtags.
  • Add distribution (Slack/LINE/Telegram) after Drive upload.

Troubleshooting

  • JSON parameter needs to be valid JSON → Ensure expressions return objects, not strings.
  • 403 on images → Make Drive files public (Viewer) and convert links.
  • Job never completes → Check status_url, retry with *-fast models or off‑peak times.

Template metadata

  • Uses: Google Sheets, Google Drive, HTTP Request, Wait/If/Switch, Code, OpenAI Vision/Chat, Fal.ai models (nano‑banana)

Visuals

Workflow Diagram

Example Product Image

Product Image - nano Banana

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - Analyze image

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 4 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 5 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 8 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 11 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Get image status

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Call Fal.ai API (nannoBanana)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 15 - Upload file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 16 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 18 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Get the image1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 21 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate AI product ad images from Google Sheets using Fal.ai and OpenAI
Complexity advanced
Nodes 22
Categories Content Creation, Multimodal AI
Author Jaruphat J.
Published 23 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8859/8859.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate AI product ad images from Google Sheets using Fal.ai and OpenAI do?

️ Note: All sensitive credentials should be set via n8n Credentials or environment variables. Do not hardcode API keys in nodes. Who’s it for Marketers, creators, and automation builders who want ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.