AI Product Ad Image Generator from Spreadsheet Data using Fal.ai - n8n Workflow

Automate product ad image creation using a powerful n8n workflow. Reads instructions from Google Sheets, generates specific visual prompts using OpenAI, and synthesizes images via Fal.ai.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • E-commerce managers needing rapid A/B testing visuals without manual design.

  • Marketing agencies handling high volumes of product campaigns.

  • Content creators looking for sophisticated n8n templates integrating generative AI and complex logic.

  • Users seeking to leverage the power of the OpenAI n8n node for advanced prompt engineering.

Overview

This advanced n8n workflow addresses the challenge of scaling creative asset generation for product marketing. Instead of manually crafting prompts and running individual generations, you define all parameters—product name, source image URL, desired number of variations, and campaign theme (e.g., 'Halloween', 'Black Friday')—directly in a Google Sheet. The automation seamlessly integrates a powerful AI Agent (via OpenAI) to analyze the existing product image, refine campaign-specific visual prompts, and then uses Fal.ai for the actual Image-to-Image synthesis. The entire process, from the manual n8n trigger firing to the final image being saved to Google Drive and the output URL being recorded in the sheet, is fully automated. This is one of the most powerful n8n templates available for accelerating creative asset production.

How it Works

The operation of this n8n workflow follows a structured, multi-step AI process:


  1. Trigger and Data Retrieval: The execution starts with the manual n8n trigger. A Google Sheets n8n node fetches product rows marked for creation (status: Create), gathering all necessary inputs like the product image URL, product description, and campaign notes.

  2. Image Analysis: The downloaded image is passed to an OpenAI n8n node which uses GPT-4o-mini to analyze the product and generate structured marketing insights (features, style, target audience). This analysis is crucial for contextual prompt design.

  3. Prompt Engineering: The specialized AI Agent n8n node uses the image analysis, product data, and campaign constraints to produce a precise number of visually distinct, production-ready image prompts in a structured JSON format. It ensures compliance with the target model and aspect ratio defined in the sheet.

  4. Prompt Splitting and Logging: The workflow uses the Split Out n8n node to handle each generated prompt variation separately. The new prompts are immediately logged into a dedicated tracking sheet using the Google Sheets n8n node, setting their initial status to 'Ready'.

  5. Image Synthesis Initiation: An HTTP Request n8n node submits the unique prompt and the product image URL to the Fal.ai API, initiating an asynchronous Image-to-Image generation job.

  6. Polling and Waiting: The n8n workflow enters a polling loop managed by the If n8n node and Wait n8n node. This mechanism repeatedly checks the Fal.ai request status using another HTTP Request n8n node until the generation status returns 'COMPLETED'.

  7. Finalization: Once complete, the final generated image is downloaded, uploaded to Google Drive, and the final output URL is updated back into the Google Sheet using the Update row in sheet Google Sheets n8n node, successfully completing this n8n workflow for that specific variation.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON code and import it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Google Sheets Credentials: Create or update credentials for the Google Sheets n8n node. Ensure the connected account has read access to your main product input sheet and write access to the secondary ad tracking sheet.

  3. Google Drive Credentials: Set up credentials for the Google Drive n8n node. Ensure the account has permission to download the source product images and upload the final generated images to the specified output folder.

  4. OpenAI Credentials: Configure your OpenAI API Key for the Langchain OpenAI n8n node and the AI Agent n8n node. This powers the sophisticated prompt generation.

  5. Fal.ai Credentials: Set up HTTP Header Authentication credentials for the Fal.ai API. These credentials must be configured for all relevant HTTP Request n8n node instances (Call Fal.ai API, Get image status, Get the image1, HTTP Request). The Fal.ai API key is essential for successful image synthesis.

  6. Customize Sheets: Adapt the Document ID and Sheet Names within the Google Sheets n8n node to match your specific spreadsheet structure. Ensure the input sheet contains the necessary columns like productimageurl, productname, numvariations, and status.

Node Details


  • When clicking ‘Execute workflow’ (Manual Trigger n8n node): Serves as the immediate n8n trigger to manually start processing the queue of products waiting for image generation.

  • Get row(s) in sheet (Google Sheets n8n node): Fetches product data from the sheet, specifically filtering for rows where the status column is 'Create'.

  • Analyze image (Langchain OpenAI n8n node): Utilizes GPT-4o-mini to receive the product image and generate structured marketing insights, used as context for the AI Agent.

  • AI Agent (Langchain Agent n8n node): The core prompt engineer. This sophisticated n8n node reads all product and campaign parameters and generates exactly N distinct image prompts based on complex system instructions, outputting strict JSON.

  • Split Out (Core Logic n8n node): Transforms the single JSON object containing N prompts into N individual items, allowing the subsequent generation steps to run sequentially for each variation.

  • Call Fal.ai API (nannoBanana) (HTTP Request n8n node): Initiates the image generation process by posting the generated prompt and source image URL to the Fal.ai API endpoint.

  • If (Core Logic n8n node): Checks the status returned by the polling request to determine if the generation is 'COMPLETED', directing the n8n workflow to either download the result or wait and poll again.

  • Upload file (Google Drive n8n node): Handles the storage of the final synthesized ad image files in the specified Google Drive output folder.

  • Update row in sheet (Google Sheets n8n node): Final step in the n8n workflow, updating the tracking sheet with the 'Complete' status and the permanent link to the generated image.

Related n8n Workflows

Free

Nodes: 13 Nodes
Updated: December 26 2025
View all
Created by

Project Manager who passionate about Automation & AI and continuously explore innovative ways to improve business processes through intelligent workflow automation. Let’s connect and automate the future!

Featured*