Skip to main content

Generate & edit images with Gemini AI: storage & email delivery pipeline

Workflow preview

Workflow preview
100%
Generate & edit images with Gemini AI: storage & email delivery pipeline preview
Open on n8n.io

Important notice

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

1. Workflow Overview

AI Image Generator with Nano Banana: Automated Creation and Delivery For content creators, agencies, and SaaS developers who need automated AI image generation and editing with professional deliver...

Best for

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

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.googledrive, n8n-nodes-base.respondtowebhook, n8n-nodes-base.converttofile, n8n-nodes-base.code

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate & edit images with Gemini AI: storage & email delivery pipeline
Workflow name
Generate & edit images with Gemini AI: storage & email delivery pipeline

AI Image Generator with Nano Banana: Automated Creation and Delivery

For content creators, agencies, and SaaS developers who need automated AI image generation and editing with professional delivery workflows.

Overview

This template demonstrates intelligent workflow routing based on user input type, leveraging Google's Gemini 2.5 Flash image model for both generative and editing tasks. The workflow includes complete file handling, cloud storage integration, and professional email notification with shareable download links.

Architecture & Key Features

Intelligent Input Detection

  • Conditional logic automatically detects presence of uploaded image files
  • Routes requests to appropriate processing branch (text-only vs. image+text)
  • Single webhook endpoint serves both use cases without manual intervention

Dual Processing Modes

  • Text-to-Image Generation (Prompt Only): User submits natural language description and the system generates new images from scratch using Gemini 2.5 Flash
  • Image-to-Image Editing (Prompt + Image): User uploads reference image with text instructions for AI-powered editing while maintaining image context

Complete File Management Pipeline

  • Extracts and validates uploaded image data
  • Converts AI-generated base64 responses to binary files
  • Uploads to organized Google Drive folder structure
  • Generates public sharing links with reader permissions
  • Implements proper file naming conventions with timestamps

Professional Email Delivery System

  • Responsive HTML email template with gradient styling
  • Dynamic content injection (user names, download links)
  • 7-day expiration warnings for urgency
  • Built-in social sharing CTAs (Twitter, LinkedIn, WhatsApp)
  • Referral program messaging for viral growth
  • Mobile-optimized design

Production-Ready Features

  • API key authentication on webhook endpoint
  • Proper error handling throughout pipeline
  • Structured response format for webhook consumers
  • Success confirmations before file operations

Technical Implementation

Nodes Used

  • Webhook (with file upload support)
  • If (conditional routing)
  • Extract from File (base64 conversion)
  • Code (image formatting for AI)
  • HTTP Request (OpenRouter API calls)
  • Edit Fields (data transformation)
  • Convert to File (binary operations)
  • Google Drive (upload & share operations)
  • Email Send (HTML delivery)
  • Respond to Webhook

External Dependencies

  • OpenRouter API (Gemini 2.5 Flash image model)
  • Google Drive API credentials
  • SMTP server or email service

Workflow Logic Flow

  • Input Reception: Webhook receives form data with optional image file
  • Route Detection: Conditional checks for presence of binary image data
  • Processing Branch A (With Image): Extract base64 from uploaded file, format as data URL for AI model, send prompt + image to Gemini
  • Processing Branch B (Text Only): Send text prompt directly to Gemini and generate image from description
  • Universal Pipeline (Both Routes): Parse AI response, extract base64 image, convert to binary file format, upload to Google Drive with dynamic naming, generate shareable public link, send formatted email with download link, return success response to webhook caller

Use Cases

  • SaaS Image Tools: Backend API for image generation/editing services
  • Content Automation: Automated image creation for marketing campaigns
  • Client Delivery Systems: White-label image processing for agencies
  • E-commerce: Product image variations and mockups
  • Social Media Tools: Automated visual content generation
  • Design Services: Rapid prototyping and concept visualization

Customization Options

AI Model Flexibility

  • Swap Gemini for other vision-capable models
  • Adjust model parameters for different output styles
  • Implement multiple model options with user selection

Storage Alternatives

  • Replace Google Drive with S3, Dropbox, or other cloud storage
  • Implement local storage for self-hosted deployments
  • Add CDN integration for faster delivery

Email Template

  • Fully customizable HTML design
  • Add brand colors and logos
  • Modify social sharing options
  • Customize referral program messaging

Business Logic

  • Add usage tracking and analytics
  • Implement credit/subscription systems
  • Add watermarking for free tier users
  • Queue management for high-volume processing

Security Considerations

  • Webhook protected with API key authentication
  • File type validation on uploads
  • Proper permissions on Google Drive shares
  • Email validation before sending

Setup Requirements

  • OpenRouter account with Gemini 2.5 Flash access
  • Google Cloud project with Drive API enabled
  • Email sending credentials (SMTP or service)
  • n8n instance with webhook support
  • Public domain for webhook endpoint (production use)

Need Help?

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 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Edit Fields2

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

Block 3 - Nano 🍌: Prompt Only

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

Block 4 - If Image File Was Uploaded

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

Block 5 - Edit Fields

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

Block 6 - Share file

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

Block 7 - Upload file

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

Block 8 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 9 - Convert to File

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

Block 10 - Edit Fields1

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

Block 11 - Nano 🍌

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

Block 12 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Extract from File

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

Block 14 - Send email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 15 - Sticky Note2

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

Block 16 - Sticky Note3

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

Block 17 - Sticky Note1

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

Block 18 - Sticky Note5

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

Block 19 - Sticky Note10

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

Block 20 - Sticky Note11

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

3. Summary Table

Workflow Generate & edit images with Gemini AI: storage & email delivery pipeline
Complexity advanced
Nodes 20
Categories Content Creation, Multimodal AI
Author Gerald Denor
Published 03 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9216/9216.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 & edit images with Gemini AI: storage & email delivery pipeline do?

AI Image Generator with Nano Banana: Automated Creation and Delivery For content creators, agencies, and SaaS developers who need automated AI image generation and editing with professional deliver...

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.