DALL·E 2 Image Generator and Google Drive Uploader - n8n Workflow

Use this powerful n8n workflow to generate multiple variations of AI images via OpenAI DALL·E 2 and automatically upload the results to Google Drive. A perfect n8n template for content creators.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content Creators: Users who need multiple visual options for blog posts, social media, or marketing materials quickly. Agencies and Designers: Professionals looking to rapidly prototype image concepts using AI. n8n Automation Specialists: Individuals seeking advanced examples of looping and AI integration within an n8n workflow. Anyone Using OpenAI: Users wanting a seamless connection between the OpenAI API and cloud storage using an n8n node.

Overview

Generating high-quality, varied images is crucial for modern digital content. Manually running the same prompt multiple times and then downloading and uploading the results is time-consuming. This n8n workflow solves this problem by creating an automated pipeline.

This robust n8n template automatically duplicates a single image prompt, sends each variation to OpenAI's DALL·E 2 model, generates distinct images, and finally, uses the Google Drive n8n node to upload and organize the output. This reliable n8n workflow ensures consistent delivery and organization of your creative assets, drastically speeding up your content production cycle. Leveraging this specific n8n node configuration for AI image generation makes mass production straightforward.

How it Works

This automation starts with an n8n trigger and executes a controlled sequence of actions:


  1. Initialization: The n8n workflow is triggered manually, and a Set Image Prompt n8n node defines the base text prompt and a file name for the images.

  2. Duplication: A Code n8n node (Duplicate Rows) takes the single prompt item and duplicates it (e.g., three times), appending a unique run number to each copy. This enables the n8n workflow to request multiple distinct images from OpenAI using the same input prompt.

  3. Flow Control: The Loop Over Items n8n node (Split in Batches) ensures that each duplicated prompt is processed one at a time.

  4. AI Generation: The OpenAI Image Generation n8n node uses DALL·E 2 to create an image based on the prompt currently being processed in the loop.

  5. Storage: The final step uses the Google Drive n8n node to upload the generated image. The file name is dynamically created using the base name and the unique run number assigned earlier in the n8n workflow, ensuring no naming conflicts and easy organization in Google Drive.

Installation Guide

To deploy and utilize this powerful n8n template, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it directly into your n8n instance using the 'New' button and selecting 'Import from JSON'.

  2. Set up OpenAI Credentials:

Click on the Generate an image (OpenAI) n8n node.
Under 'Credentials', select 'Create New' or choose an existing OpenAI API key connection.
Ensure the credential setup is correct, connecting your OpenAI account to your n8n instance.

  1. Set up Google Drive Credentials:

Click on the Upload to Google Drive n8n node.
Select or create new Google Drive OAuth2 API credentials. You may need to enable the Google Drive API in your Google Cloud Console and configure the OAuth 2.0 redirect URI to match your n8n environment.

  1. Configure Parameters:

In the Set Image Prompt n8n node, update the Prompt value with your desired image description.
* In the Upload to Google Drive n8n node, select the specific Folder ID where you want the images to be saved.

  1. Activate and Test: Use the Start Workflow n8n trigger to manually execute the process and verify that images appear in your Google Drive folder. This completes your setup of this advanced n8n workflow.

Node Details

This n8n template relies on several key n8n node components working in sequence:

Start Workflow (Manual Trigger): The fundamental n8n trigger used to initiate the automation for testing and manual runs.
Set Image Prompt (Set n8n node): Stores the core variables: Prompt (The DALL·E request text) and Name (The base filename). This data is passed through the entire n8n workflow.
Duplicate Rows (Code n8n node): A custom JavaScript n8n node that transforms the single input into three distinct outputs, each tagged with a unique 'run' number (1, 2, 3) to facilitate varied image generation.
Loop Over Items (Split in Batches n8n node): Essential flow control. This n8n node forces the subsequent actions (image generation and upload) to process each of the three prompt variations individually.
Generate an image (OpenAI n8n node): The core AI action. It utilizes the dall-e-2 model and dynamically pulls the image prompt using an expression ={{ $json.Prompt }}. This n8n node handles the communication with the OpenAI API.
Upload to Google Drive (Google Drive n8n node): Handles the output storage. It's configured to upload the file received from the OpenAI n8n node. The file name parameter dynamically combines the base name and the run number to ensure uniqueness: ={{ $('Set Image Prompt').item.json.Name }} - {{ $('Duplicate Rows').item.json.run }}.

Related n8n Workflows

Free

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

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

Featured*