{
  "name": "Text-to-image generator with Google Sheets & Drive integration using Flux AI",
  "nodes": [
    {
      "id": "b3c3a883-4999-4b37-9f34-dc0d39e74900",
      "name": "Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -400,
        -480
      ]
    },
    {
      "id": "4d98ceae-2e2b-44cc-a885-ac9df6c8445c",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -160,
        -480
      ]
    },
    {
      "id": "64c9af39-3b1d-4095-b5df-c4a6010e8ba5",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1500,
        -160
      ]
    },
    {
      "id": "81fbbaf8-5f0d-42b1-bb96-dad3a61caf7b",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -600,
        -480
      ]
    },
    {
      "id": "1e7416e9-9331-4d13-b7ab-447aa37d7cdc",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        100,
        -460
      ]
    },
    {
      "id": "59f2d118-2bb7-46a2-8dde-95dff6d681fc",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        680,
        -200
      ]
    },
    {
      "id": "c5fbcba1-9b63-4493-8547-8c55698fa5ba",
      "name": "Google Sheets4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        -180
      ]
    },
    {
      "id": "647c344f-689a-40b5-a7ea-b1ec84b50866",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        -620
      ]
    },
    {
      "id": "7b99ef51-5c71-4a5a-8e2f-6bd86446c2b6",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        940,
        -580
      ]
    },
    {
      "id": "7def0479-c62e-4c9f-8001-03cafdea3c74",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        340,
        -500
      ]
    },
    {
      "id": "e6645ea0-8ec7-46a3-a04d-12fef706a03d",
      "name": "Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1080,
        -1100
      ]
    },
    {
      "id": "53711d81-9c16-49dd-917b-76d45730b8a7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1580,
        -1000
      ],
      "parameters": {
        "width": 780,
        "height": 1220,
        "content": "# Text To Image Flux AI Workflow\n\n## Short Description\nAutomates the generation of images from text prompts stored in a Google Sheet, processes the image data, uploads the images to Google Drive, and "
      }
    },
    {
      "id": "ed7d467c-34ad-42a4-89ce-de69187cf2f1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        -760
      ],
      "parameters": {
        "width": null,
        "height": 500,
        "content": "### 1. When clicking ‘Execute workflow’ (Manual Trigger)\n- **Type:** Manual trigger  \n- **Purpose:** Starts the workflow manually when you click “Execute workflow.”  \n- **Usage:** Initiates the entire"
      }
    },
    {
      "id": "ca2119ad-fb45-45a0-b3b2-dbbabdf42b35",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -760
      ],
      "parameters": {
        "width": null,
        "height": 500,
        "content": "### 2. Google Sheets2 (Read Prompts)\n- **Type:** Google Sheets node (read)  \n- **Purpose:** Reads the list of text prompts from a Google Sheet.  \n- **Usage:** Fetches data that drives the image genera"
      }
    },
    {
      "id": "f36a50d3-9610-46be-954d-8d4b691429dc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -760
      ],
      "parameters": {
        "width": null,
        "height": 500,
        "content": "### 3. Loop Over Items (Split in Batches)\n- **Type:** Split In Batches  \n- **Purpose:** Processes each prompt individually in manageable batches to avoid API overload.  \n- **Usage:** Allows sequential"
      }
    },
    {
      "id": "57b85cd9-1d1f-4f8c-8fca-ec1553183917",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -760
      ],
      "parameters": {
        "width": null,
        "height": 500,
        "content": "### 4. If2 (Check Prompt & Drive Path)\n- **Type:** If node (conditional check)  \n- **Purpose:** Checks if the prompt is present and the image has not already been generated (`drive path` is empty).  \n"
      }
    },
    {
      "id": "e9b2273a-643f-47eb-8e37-61418385a841",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -760
      ],
      "parameters": {
        "width": null,
        "height": 520,
        "content": "### 5. HTTP Request1 (Generate Image)\n- **Type:** HTTP Request (POST)  \n- **Purpose:** Sends the prompt to the Text To Image Flux AI API and receives a base64 encoded image.  \n- **Usage:** Calls the e"
      }
    },
    {
      "id": "2b66a488-d1d6-49f1-84d9-52919b0eb945",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -900
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "### 6. Code1 (Convert Base64 to Binary)\n- **Type:** Code (JavaScript)  \n- **Purpose:** Converts the base64 image string into a binary format suitable for upload.  \n- **Usage:** Prepares image data for"
      }
    },
    {
      "id": "b9a32ed9-dbc5-48d0-bd0f-cd5656c0c641",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -760
      ],
      "parameters": {
        "width": 380,
        "height": 320,
        "content": "### 7. Google Sheets1 (Append Image Data)\n- **Type:** Google Sheets node (append)  \n- **Purpose:** Appends the generated base64 image and timestamp back to the Google Sheet.  \n- **Usage:** Logs image "
      }
    },
    {
      "id": "22f66814-7f95-4a6f-ac46-4030ec422191",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        -1260
      ],
      "parameters": {
        "width": 440,
        "height": 320,
        "content": "### 8. Google Drive1 (Upload Image)\n- **Type:** Google Drive node (upload)  \n- **Purpose:** Uploads the generated image file to a specified Google Drive folder.  \n- **Usage:** Stores the generated ima"
      }
    },
    {
      "id": "97e072fe-1809-447f-9303-1d0fcda6b19c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        -420
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "### 9. Google Sheets4 (Update Errors)\n- **Type:** Google Sheets node (appendOrUpdate)  \n- **Purpose:** Updates the Google Sheet with error information if image generation fails.  \n- **Usage:** Tracks "
      }
    },
    {
      "id": "112e8ff7-e2b2-4294-bdbe-744e1d3b1160",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -380
      ],
      "parameters": {
        "width": null,
        "height": 380,
        "content": "### 10. Wait (Pause Between Batches)\n- **Type:** Wait node  \n- **Purpose:** Adds a 10-second pause between batches of processed prompts.  \n- **Usage:** Prevents hitting API rate limits or overloading "
      }
    },
    {
      "id": "add007b2-05f1-4515-9c18-69604382aee7",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -420
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "### 11. If1 (Error Handling)\n- **Type:** If node (error check)  \n- **Purpose:** Checks if the API response contains an error.  \n- **Usage:** Routes the flow to handle errors or continue successful pro"
      }
    }
  ],
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Google Sheets4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets4": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}