AutomationFlowsAI & RAG › Text-to-image Generation with Flux Ai, Google Drive Storage & Sheets Logging

Text-to-image Generation with Flux Ai, Google Drive Storage & Sheets Logging

BySk developer @skdeveloper on n8n.io

Generate realistic, high-quality images from text prompts using the Flux AI Text-to-Image Generator API via RapidAPI, and seamlessly store the results in Google Drive and log them in Google Sheets — all automated using n8n.

Event trigger★★★★☆ complexity15 nodesForm TriggerHTTP RequestGoogle SheetsGoogle Drive
AI & RAG Trigger: Event Nodes: 15 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #5929 — we link there as the canonical source.

This workflow follows the Form Trigger → Google Drive 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 →

Download .json
{
  "nodes": [
    {
      "id": "5ce3fec1-830d-4814-aff0-c2fbe34aeb6e",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1280,
        40
      ],
      "parameters": {
        "options": {},
        "formTitle": "Text To Image Flux AI",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Prompt",
              "placeholder": "A photograph of a \"Mateen\" Sommer Edition energy drink can, suspended in mid-air against a cool, gradient backdrop. The sleek silver can prominently displays the vibrant \"Neo hair lotion\" flavor, adorned with dynamic blue and white graphics and heavily frosted with condensation. Surrounding the can is a swirling cloud of frosty vapor composed of irregularly shaped, shimmering ice cubes, illuminated by a focused spotlight that highlights the can's metallic sheen. Soft, diffused lighting emphasizes the crispness of the energy drink and creates a refreshing atmosphere, setting it against a backdrop shifting from deep indigo to a lighter sky blue.",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Add prompt to generate desired image"
      },
      "typeVersion": 2.2
    },
    {
      "id": "21190262-f358-4d1f-8341-f6e785aec8d0",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        -1060,
        40
      ],
      "parameters": {
        "url": "https://text-to-image-generator-flux.p.rapidapi.com/flux.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.Prompt }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "text-to-image-generator-flux.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bad3b411-7f24-42c9-8561-5ec659561c72",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -560,
        -120
      ],
      "parameters": {
        "jsCode": "const base64String = $input.first().json.image_base64;\nconsole.log(base64String);\n// If it includes a prefix like 'data:image/jpeg;base64,', split it\nconst cleanedBase64 = base64String.includes(\",\")\n  ? base64String.split(\",\")[1]\n  : base64String;\n\nreturn [\n  {\n    binary: {\n      data: {\n        data: Buffer.from(cleanedBase64, 'base64'),\n        mimeType: 'image/jpeg', // or image/png depending on the format\n        fileName: 'output.jpg'\n      }\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5d9f952e-88c4-4007-8c12-56e25b05194c",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -180,
        280
      ],
      "parameters": {
        "columns": {
          "value": {
            "Image": "={{ $binary.data.fileName }}",
            "Prompt": "={{ $('On form submission').item.json.Prompt }}",
            "Generated Date": "={{ $('On form submission').item.json.submittedAt }}"
          },
          "schema": [
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Generated Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Generated Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/19RkfJHHLt15sIwaeN5Fgrd4BuVTacA0_mYP-gPcBVao/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9bcc807e-7e28-425b-a721-10c238502fc0",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -240,
        -120
      ],
      "parameters": {
        "name": "=ok{{ $binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "0bd277e7-e5d5-4695-bd4c-656fc921aea1",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "205d9270-aa0e-4864-bbb6-c67206eda0a2",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2a72cd55-a8f1-4fe3-b632-d704afd4bce1",
      "name": "Google Sheets5",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -520,
        480
      ],
      "parameters": {
        "columns": {
          "value": {
            "Base64": "={{ $json.error }}",
            "Prompt": "={{ $json.Prompt }}"
          },
          "schema": [
            {
              "id": "Prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "drive path",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "drive path",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Generated Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Generated Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Base64",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Base64",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Prompt"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1mT6GkDE1_tcPzv6K1h9jHWyEVsg4d7Pj0UR1te3rGlg/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e5880625-4059-485e-a2ef-b0eed85992bb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2340,
        -520
      ],
      "parameters": {
        "width": 740,
        "height": 1020,
        "content": "# \ud83c\udfa8 AI Image Generator with Flux AI \n\nGenerate images from text prompts using **Flux AI Text-to-Image Generator API** and automatically store results in **Google Drive** and log them in **Google Sheets**.\n\n---\n\n## \ud83e\udde0 Workflow Overview\n- **Form Submission**: User inputs a text prompt.\n- **API Request**: Sends prompt to **Flux AI Text-to-Image Generator** via [RapidAPI](https://rapidapi.com/skdeveloper/api/text-to-image-generator-flux).\n- **Image Processing**: Converts base64 image into a binary file.\n- **Google Drive Upload**: Saves the generated image to Drive.\n- **Google Sheets Log**: Stores prompt, image name, and date in Sheets.\n- **Error Handling**: Captures errors and logs them in a fallback sheet.\n\n---\n\n## \u2705 Benefits\n- **Automated AI Image Generation** without coding.\n- **Cloud storage** on Google Drive.\n- **Error Logging** for easier troubleshooting.\n- **Real-time tracking** in Google Sheets.\n\n---\n\n## \ud83d\ude80 Challenges Solved\n- **No API knowledge required**: Simplifies image generation.\n- **Error detection**: Ensures no failed processes go unnoticed.\n- **Automated file storage**: Direct upload to Google Drive.\n\n---\n\n## \ud83d\udd17 API: [Flux AI Text-to-Image Generator](https://rapidapi.com/skdeveloper/api/text-to-image-generator-flux)\n- Fast, high-quality, text-to-image API.\n- **Generate images** with just a prompt.\n\n---"
      },
      "typeVersion": 1
    },
    {
      "id": "b59714dd-74ea-4c7a-819e-0d64c188a2f5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "### 1. \ud83d\udcdd On Form Submission\n- Accepts user input for a creative text prompt.\n- \ud83d\udd0d Example: \u201cA silver can with vapor and blue lightning background.\u201d\n- \ud83d\udca1 Benefit: No technical knowledge needed."
      },
      "typeVersion": 1
    },
    {
      "id": "6b953a64-3f26-4e7e-9580-947f4a7d503d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "### 2. \ud83c\udf10 HTTP Request \u2014 Flux AI API\n- Sends the prompt to the **[Flux AI Text-to-Image Generator API](https://rapidapi.com/skdeveloper/api/text-to-image-generator-flux)** via **RapidAPI**.\n- \ud83d\udce6 Returns an image encoded in base64.\n- \ud83d\udca1 Benefit: Seamless integration with cutting-edge image generation."
      },
      "typeVersion": 1
    },
    {
      "id": "50588ad0-9f4b-4e90-ab90-9e0ae8f83595",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -340
      ],
      "parameters": {
        "height": 380,
        "content": "### 3. \ud83e\uddea Code Node \u2014 Base64 Decoder\n- Converts the base64 image to a binary `.jpg` file.\n- \ud83d\udca1 Benefit: Readies the image for upload/download/sharing."
      },
      "typeVersion": 1
    },
    {
      "id": "9b412619-0589-4dbb-a601-8322bb571a6e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -320
      ],
      "parameters": {
        "height": 360,
        "content": "### 4. \ud83d\udcc1 Google Drive\n- Uploads the generated image to your Google Drive folder.\n- \ud83d\udca1 Benefit: Secure, sharable cloud storage.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b2913804-5555-4a30-b713-94236188a28e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        100
      ],
      "parameters": {
        "height": 340,
        "content": "### 5. \ud83d\udcca Google Sheets \u2014 Success Log\n- Appends a row with the original prompt, filename, and generation date.\n- \ud83d\udca1 Benefit: Tracks history of all generated images."
      },
      "typeVersion": 1
    },
    {
      "id": "7fd8d0b3-d6f2-445a-810b-558ed33e1084",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        200
      ],
      "parameters": {
        "height": 320,
        "content": "### 6. \u26a0\ufe0f IF Node \u2014 Error Detection\n- Checks if the image generation failed.\n- \ud83d\udca1 Benefit: Prevents workflow from halting and routes to error logging."
      },
      "typeVersion": 1
    },
    {
      "id": "25e8bc2c-bf70-452c-bd7d-45052d9f85d6",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        300
      ],
      "parameters": {
        "height": 340,
        "content": "### 7. \ud83d\udcc9 Google Sheets \u2014 Error Log\n- Logs failed prompts and error messages.\n- \ud83d\udca1 Benefit: Helps identify what went wrong (e.g. malformed prompt)."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Google Sheets5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Generate realistic, high-quality images from text prompts using the Flux AI Text-to-Image Generator API via RapidAPI, and seamlessly store the results in Google Drive and log them in Google Sheets — all automated using n8n.

Source: https://n8n.io/workflows/5929/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Understand your customers before you build for them. This workflow, Market Segmentation: Buyer Persona Pain Point Report, automates the grueling process of primary market research. By scraping real-wo

Form Trigger, Google Gemini, N8N Nodes Olostep +3
AI & RAG

This workflow turns a user-submitted form with country or animal names into a cinematic video with animated scenes and immersive ambient audio. Using GPT-4 for prompt generation, Dumpling AI for visua

Form Trigger, OpenAI, HTTP Request +2
AI & RAG

Automatically generates, designs, stores, and logs complete Instagram carousel posts. It transforms a simple text prompt into a full post with copy, visuals, rendered images, Google Drive storage, and

Google Drive, Form Trigger, OpenAI +3
AI & RAG

This n8n workflow automatically generates presentation-style "screen recording" videos with AI-generated slides and a talking head avatar overlay. You provide a topic and intention, and the workflow h

HTTP Request, N8N Nodes Veed, Google Drive +1
AI & RAG

Monitor Google Drive folder, parsing PDF, DOCX and image file into a destination folder, ready for further processing (e.g. RAG ingestion, translation, etc.) Keep processing log in Google Sheet and se

Google Drive Trigger, Google Drive, HTTP Request +2