{
  "name": "Text-to-image generation with Flux AI, Google Drive storage & sheets logging",
  "nodes": [
    {
      "id": "5ce3fec1-830d-4814-aff0-c2fbe34aeb6e",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1280,
        40
      ]
    },
    {
      "id": "21190262-f358-4d1f-8341-f6e785aec8d0",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1060,
        40
      ]
    },
    {
      "id": "bad3b411-7f24-42c9-8561-5ec659561c72",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -560,
        -120
      ]
    },
    {
      "id": "5d9f952e-88c4-4007-8c12-56e25b05194c",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -180,
        280
      ]
    },
    {
      "id": "9bcc807e-7e28-425b-a721-10c238502fc0",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -240,
        -120
      ]
    },
    {
      "id": "0bd277e7-e5d5-4695-bd4c-656fc921aea1",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        400
      ]
    },
    {
      "id": "2a72cd55-a8f1-4fe3-b632-d704afd4bce1",
      "name": "Google Sheets5",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -520,
        480
      ]
    },
    {
      "id": "e5880625-4059-485e-a2ef-b0eed85992bb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2340,
        -520
      ],
      "parameters": {
        "width": 740,
        "height": 1020,
        "content": "# 🎨 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 Sheet"
      }
    },
    {
      "id": "b59714dd-74ea-4c7a-819e-0d64c188a2f5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -160
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "### 1. 📝 On Form Submission\n- Accepts user input for a creative text prompt.\n- 🔍 Example: “A silver can with vapor and blue lightning background.”\n- 💡 Benefit: No technical knowledge needed."
      }
    },
    {
      "id": "6b953a64-3f26-4e7e-9580-947f4a7d503d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -160
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "### 2. 🌐 HTTP Request — 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- 📦 Returns"
      }
    },
    {
      "id": "50588ad0-9f4b-4e90-ab90-9e0ae8f83595",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -340
      ],
      "parameters": {
        "width": null,
        "height": 380,
        "content": "### 3. 🧪 Code Node — Base64 Decoder\n- Converts the base64 image to a binary `.jpg` file.\n- 💡 Benefit: Readies the image for upload/download/sharing."
      }
    },
    {
      "id": "9b412619-0589-4dbb-a601-8322bb571a6e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "### 4. 📁 Google Drive\n- Uploads the generated image to your Google Drive folder.\n- 💡 Benefit: Secure, sharable cloud storage.\n"
      }
    },
    {
      "id": "b2913804-5555-4a30-b713-94236188a28e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        100
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "### 5. 📊 Google Sheets — Success Log\n- Appends a row with the original prompt, filename, and generation date.\n- 💡 Benefit: Tracks history of all generated images."
      }
    },
    {
      "id": "7fd8d0b3-d6f2-445a-810b-558ed33e1084",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        200
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "### 6. ⚠️ IF Node — Error Detection\n- Checks if the image generation failed.\n- 💡 Benefit: Prevents workflow from halting and routes to error logging."
      }
    },
    {
      "id": "25e8bc2c-bf70-452c-bd7d-45052d9f85d6",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        300
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "### 7. 📉 Google Sheets — Error Log\n- Logs failed prompts and error messages.\n- 💡 Benefit: Helps identify what went wrong (e.g. malformed prompt)."
      }
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}