AI Image Generation, Google Drive Storage, and Sheets Logging - n8n Workflow

Use this powerful n8n workflow to generate 'Image to Image' AI art via the Sora GPT API, automatically convert base64 output, store files in Google Drive, and log all generation activity in Google Sheets. Perfect for scaling content creation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content Creators and Marketers needing high-volume, automated AI image production.

  • Technical users seeking robust n8n templates for integrating specialized APIs like Sora GPT.

  • Businesses that require centralized tracking and organization of generated digital assets.

  • Developers looking for a pre-built n8n node structure for handling base64 binary conversions.

Overview

Managing AI-generated content often requires multiple manual steps: creation, file handling, storage, and logging. This sophisticated n8n workflow solves these problems by providing an end-to-end automation solution. It starts with a simple form submission and leverages a powerful GPT AI service to generate images based on a combination of a text prompt and a reference image URL. The n8n node configuration ensures the API output (often a base64 string) is correctly converted into a usable file. The final steps integrate seamlessly with Google services, storing the image in Google Drive for accessibility and recording metadata in Google Sheets for auditing. This n8n template significantly reduces manual effort and streamlines your creative pipeline.

How it Works

The entire process is initiated by an n8n trigger and flows through several highly specialized n8n node components:


  1. Trigger and Input: The n8n workflow begins with the 'On form submission' n8n trigger, which collects a user-defined prompt and a source image URL via a public form.

  2. AI Image Generation: An HTTP Request n8n node takes the form data and securely sends it to the Sora GPT Image API endpoint (via RapidAPI), requesting a 1024x1024 image based on the prompt and source URL.

  3. Base64 Conversion: The API returns the image as a base64 string. The dedicated 'Code' n8n node processes this string, stripping any prefixes, decoding the base64 data, and converting it into a proper binary image file (JPEG).

  4. Cloud Storage: The resulting binary file is immediately passed to the Google Drive n8n node, which uploads the image file to a designated folder using service account authentication, ensuring secure and consistent storage.

  5. Data Logging: Finally, the Google Sheets n8n node appends a new row to a specified spreadsheet. This log includes the original prompt, the file name of the generated image (captured from the previous Google Drive n8n node output), and the exact submission date/time captured by the initial n8n trigger.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance using the 'Import Workflow' function.

  2. Configure the n8n Trigger: Activate the 'On form submission' n8n node to generate a unique webhook URL for your form.

  3. RapidAPI Credentials: Edit the 'HTTP Request' n8n node. Replace the placeholder 'your key' in the 'x-rapidapi-key' header parameter with your actual RapidAPI key required to access the Sora GPT Image service.

  4. Google Credentials: This n8n workflow uses Google Service Account authentication for secure access.

- Set up a Google Service Account credential in n8n.
- Configure the 'Google Drive' n8n node and the 'Google Sheets' n8n node with this credential.
- Specify the target Google Sheets URL/Document ID and Sheet Name, and the Google Drive Folder ID where you wish to store the images.

Node Details

This n8n workflow leverages several key n8n node components:

On form submission (n8n-nodes-base.formTrigger): The primary n8n trigger. It listens for submissions containing 'Prompt' (textarea) and 'Image url' (text), both set as required fields. It provides the initial data payload for the entire n8n workflow.
HTTP Request (n8n-nodes-base.httpRequest): Sends a POST request to the Sora GPT API. Function: Triggers the AI image generation process. Key Configuration: Uses expressions to dynamically pass the Prompt (={{ $json.Prompt }}) and Image URL (={{ $json['Image url'] }}) from the trigger. Requires x-rapidapi-host and x-rapidapi-key in headers.
Code (n8n-nodes-base.code): A custom n8n node for data processing. Function: Converts the base64 encoded image data returned by the API into a usable binary image file (JPEG). Key Configuration: Custom JavaScript logic utilizing Buffer.from(cleanedBase64, 'base64') to create the binary data object.
Google Drive (n8n-nodes-base.googleDrive): A core cloud storage n8n node. Function: Uploads the generated binary image file to a specified Google Drive folder. Key Configuration: File name is dynamically set using an expression (={{ $binary.data.fileName }}).


  • Google Sheets (n8n-nodes-base.googleSheets): The logging n8n node. Function: Appends a row to the configured spreadsheet. Key Configuration: Mapped columns include 'Prompt' (retrieved from the starting n8n trigger), 'Image' (retrieved as the file name from the Google Drive n8n node), and 'Generated Date' (submission timestamp).

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Sk developer
Sk developer

Featured*