This workflow corresponds to n8n.io template #7222 — we link there as the canonical source.
This workflow follows the Google Drive → OpenAI recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "8ddca1c1-52d0-45cb-907c-370ebeb83d51",
"name": "Generate an image",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
580,
1160
],
"parameters": {
"model": "dall-e-2",
"prompt": "={{ $json.Prompt }}",
"options": {},
"resource": "image"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "ac845ad4-c1ff-4453-8f10-db73ada7cdb4",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
140,
1040
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "bf507544-ab85-4085-ac56-d045300416be",
"name": "Start Workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-720,
1200
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0fef42ed-00c4-4423-b47d-d4c07fba67c4",
"name": "Set Image Prompt",
"type": "n8n-nodes-base.set",
"position": [
-540,
1180
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "5f36bc2b-9acb-4159-b9c3-98a6f9650787",
"name": "Prompt",
"type": "string",
"value": "Make an image of an attractive woman standing in new york city"
},
{
"id": "e5823995-d822-4f59-b580-c9efaabc465c",
"name": "Name",
"type": "string",
"value": "woman-nyc"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ec758170-36d8-44c8-b811-92ba4e79e03f",
"name": "Upload to Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
520,
920
],
"parameters": {
"name": "={{ $('Set Image Prompt').item.json.Name }} - {{ $('Duplicate Rows').item.json.run }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1TnDibwPPPUm3VbmETiqWDVhtaUTLJ6mn",
"cachedResultUrl": "https://drive.google.com/drive/folders/1TnDibwPPPUm3VbmETiqWDVhtaUTLJ6mn",
"cachedResultName": "n8n workflows"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "59bc4b98-3b8c-46fb-8d19-b374031b0753",
"name": "Duplicate Rows",
"type": "n8n-nodes-base.code",
"position": [
-300,
1180
],
"parameters": {
"jsCode": "const original = items[0].json;\n\nreturn [\n { json: { ...original, run: 1 } },\n { json: { ...original, run: 2 } },\n { json: { ...original, run: 3 } },\n];\n"
},
"typeVersion": 2
},
{
"id": "d527b2bd-4e45-4c57-83d2-20906e8d331d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
-80
],
"parameters": {
"color": 3,
"width": 800,
"height": 1480,
"content": "\n## Step-by-Step Setup Instructions\n\n### 1. Prepare Your API Keys\n- **OpenAI API Key** \n 1. Sign up or log in at https://platform.openai.com/ \n 2. Go to **API Keys** and create a new one. \n 3. Copy and store this securely \u2014 you'll need it in n8n.\n\n- **Google Drive API** \n 1. Go to https://console.cloud.google.com/ \n 2. Create a project and enable **Google Drive API**. \n 3. Create OAuth 2.0 credentials and set the redirect URI to your n8n OAuth redirect (found in your n8n Google Drive node setup). \n 4. Connect your Google account when adding credentials in n8n.\n\n---\n\n### 2. Workflow Nodes Overview\n1. **Manual Trigger** \u2013 Starts the workflow manually. \n2. **Set Image Prompt** \u2013 Stores the prompt text and base file name (e.g., \u201cMake an image of an attractive woman standing in New York City\u201d). \n3. **Duplicate Rows (Code Node)** \u2013 Creates multiple \"runs\" of the same prompt for variation. \n4. **Loop Over Items** \u2013 Processes each variation one at a time. \n5. **Generate an image (OpenAI DALL\u00b7E 2)** \u2013 Sends the prompt to OpenAI and retrieves an image. \n6. **Upload to Google Drive** \u2013 Saves each generated image to your chosen Google Drive folder.\n\n---\n\n### 3. Building the Workflow in n8n\n\n#### Step 1 \u2014 Manual Trigger\nAdd a **Manual Trigger** node to start the workflow manually when testing.\n\n#### Step 2 \u2014 Set Image Prompt\nAdd a **Set** node with two fields: \n- `Prompt` \u2192 The image description text. \n- `Name` \u2192 The base name for the saved file. \n\nExample: \n| Name | Value |\n|--------|---------------------------------------------------------------|\n| Prompt | Make an image of an attractive woman standing in New York City |\n| Name | woman-nyc |\n\n#### Step 3 \u2014 Duplicate Rows (Code Node)\nUse this JavaScript to create three copies of the prompt (run 1, run 2, run 3):\n```javascript\nconst original = items[0].json;\n\nreturn [\n { json: { ...original, run: 1 } },\n { json: { ...original, run: 2 } },\n { json: { ...original, run: 3 } },\n];"
},
"typeVersion": 1
},
{
"id": "20820668-9612-47e2-9bda-0928f2391ea0",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
20,
-80
],
"parameters": {
"color": 5,
"width": 800,
"height": 1480,
"content": "#### Step 4 \u2014 Loop Over Items\nInsert a **Split in Batches** node and set the batch size to `1`. This ensures each prompt variation runs through the image generation process individually. Connect this node so it runs after the **Duplicate Rows** node.\n\n#### Step 5 \u2014 Generate Image\nAdd the **OpenAI Image Generation** node and configure it as follows:\n- **Model**: `dall-e-2`\n- **Prompt**: `={{ $json.Prompt }}`\n- Leave other options at their defaults unless you want to specify image size or style.\n- Connect your **OpenAI API** credentials created in Step 1.\n\nThis node will send the current prompt in the batch to OpenAI's DALL\u00b7E 2 model and return an AI-generated image.\n\n#### Step 6 \u2014 Upload to Google Drive\nAdd a **Google Drive** node and configure it to store the generated image:\n- **File Name**: \n `={{ $('Set Image Prompt').item.json.Name }} - {{ $('Duplicate Rows').item.json.run }}`\n- **Folder ID**: Select the target Google Drive folder where images should be saved.\n- Connect your **Google Drive OAuth2 API** credentials.\n\nThe node will upload each generated image to your chosen Google Drive location, with a unique filename for each variation.\n\n---\n\n### Running the Workflow\n1. Execute the workflow manually.\n2. The process will:\n - Loop through each prompt variation.\n - Generate an image using OpenAI DALL\u00b7E 2.\n - Upload the image to Google Drive with a unique name.\n3. You will find all generated images in the selected Google Drive folder.\n\n---\n\n### Customization Tips\n- Change the number of variations by editing the **Duplicate Rows** code.\n- Adjust the prompt dynamically from other data sources like Google Sheets, webhooks, or forms.\n- Schedule the workflow to run at specific times or trigger it via an API call.\n\n---\n"
},
"typeVersion": 1
},
{
"id": "56f4ecd2-8c37-4744-b7bb-c5d1cd51c37a",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
-220
],
"parameters": {
"width": 1600,
"height": 100,
"content": "**Need more help?** \nWebsite: https://ynteractive.com \nEmail: robert@ynteractive.com"
},
"typeVersion": 1
}
],
"connections": {
"Duplicate Rows": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Start Workflow": {
"main": [
[
{
"node": "Set Image Prompt",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "Upload to Google Drive",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate an image",
"type": "main",
"index": 0
}
]
]
},
"Set Image Prompt": {
"main": [
[
{
"node": "Duplicate Rows",
"type": "main",
"index": 0
}
]
]
},
"Generate an image": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleDriveOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This n8n workflow automates the process of generating multiple AI-created images from a single prompt using OpenAI's DALL·E 2, then uploads the results directly to a Google Drive folder. It includes a loop to produce several image variations for the same prompt, making it ideal…
Source: https://n8n.io/workflows/7222/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
The Problem That it Solves
Scrape ads – Pulls Facebook Ad Library data for "ai automation" keywords using Apify Filter & sort – Filters ads by page likes (>1,000) and separates into videos, images, and text ads Analyze creat
This workflow converts emailed timesheets into structured invoice rows in Google Sheets and stores them in the correct Google Drive folder structure.
Voice Note -> Veo 3 AD. Uses telegramTrigger, telegram, openAi, httpRequest. Event-driven trigger; 49 nodes.
Goal: This workflow demonstrates the full fluidX THE EYE integration — starting a live session, inviting both the customer (via SMS) and the service agent (via email), and then accessing the media (ph