Generate images with GPT-image-1 and store in Google Drive with cost tracking
Ready for 3.0What this workflow does
This AI workflow has 12 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Google Drive and Google Sheets. It also calls api.openai.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- HTTP Request: calls api.openai.com (POST)
- Split Out: splits a list into separate items
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Aggregate: combines items into one
- Edit Fields-file_name (Edit Fields (Set)): sets 2 fields: file_name, b64_json
- Google Sheets: append
- Convert to File: converts data to a file (to binary)
- Google Drive: uses Google Drive
- Edit Fields (Edit Fields (Set)): sets 4 fields: id, webViewLink, thumbnailLink…
- Google Sheets: append
Services it uses
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (10)
- Manual Trigger
n8n-nodes-base.manualTrigger - HTTP Request
n8n-nodes-base.httpRequest - Google Drive
n8n-nodes-base.googleDrive - Split Out
n8n-nodes-base.splitOut - Convert to File
n8n-nodes-base.convertToFile - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Aggregate
n8n-nodes-base.aggregate
From the author
How it works - Receive a chat input as an image prompt. - Call OpenAI's gpt-image-1 API to generate an image. - Split the returned images and process them one by one. - Upload each generated image to Google Drive. - Save image links and thumbnails to a Google…