template-demo-chatgpt-image-1-with-drive-and-sheet copy
This workflow automatically generates high-quality images by receiving user text prompts and calling the AI image generation interface, then uploads the images to cloud storage. All generated image links, thumbnails, and prompts are structured and recorded in a spreadsheet for easier management and analysis. Additionally, it provides information on token usage and cost estimates, supports batch processing, and enhances the efficiency of creative design and content creation, making it suitable for various applications that require converting text into images.

Workflow Name
template-demo-chatgpt-image-1-with-drive-and-sheet copy
Key Features and Highlights
This workflow automatically generates images based on chat input text prompts by invoking OpenAI’s image generation API (gpt-image-1 model). The generated image files are uploaded to Google Drive. Meanwhile, image URLs, thumbnails, and detailed generation prompts are systematically recorded in Google Sheets for easy management and review. Additionally, the workflow tracks token usage and estimates costs incurred during the generation process, providing comprehensive monitoring of generation expenses.
Core Problems Addressed
- Automates the conversion of text prompts into high-quality images, eliminating the need for manual API calls to AI image generation services.
- Automatically saves generated images to the cloud (Google Drive), ensuring secure storage and convenient access.
- Structurally logs generation data and cost information into Google Sheets, facilitating subsequent analysis and management.
- Supports batch image processing with compatibility for looping over multiple generated images, offering flexibility and efficiency.
Use Cases
- Creative design teams automating the generation of inspirational visuals to boost productivity.
- Content creators rapidly producing and centrally managing images based on textual content.
- AI image generation services archiving data and controlling costs.
- Any scenario requiring automatic conversion of text descriptions into images with storage and archival capabilities.
Main Workflow Steps
- Listen for chat input and receive user text prompts via the Langchain Chat Trigger node.
- Call OpenAI’s image generation API using the HTTP Request node, sending the text prompt to obtain image data.
- Process the returned array of images (supporting single or multiple images) using Split Out and Loop Over Items nodes.
- Convert the Base64-encoded images into file format using the Convert to File node.
- Upload the image files to a specified Google Drive folder.
- Generate accessible image URLs and thumbnail links, then write this information along with the prompt into Google Sheets.
- Aggregate token usage data during generation, calculate estimated costs, and save these details to a separate Google Sheets spreadsheet for cost monitoring.
Involved Systems and Services
- OpenAI (Image Generation API)
- Google Drive (Image File Storage)
- Google Sheets (Data and Cost Logging)
- Langchain Chat Trigger (Chat Input Trigger)
- n8n Workflow Automation Platform
Target Users and Value
- AI developers and automation engineers: Provides a turnkey example for image generation and management, facilitating secondary development and integration.
- Content creators and designers: Enables rapid visual content creation, saving design time.
- Business operators: Monitors AI service usage and costs to optimize resource allocation.
- Educators and researchers: Conveniently acquire and manage text-based image data to support teaching and experiments.
This workflow integrates advanced AI image generation with G Suite services, empowering users to automate the transformation from text to image and manage assets efficiently. It is a powerful tool for AI-assisted creation and digital asset management.