{
  "name": "Generate images with GPT-image-1 and store in Google Drive with cost tracking",
  "nodes": [
    {
      "id": "7d78d4e3-cbb3-4f32-82d9-73c9d7f6c892",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -480,
        -245
      ]
    },
    {
      "id": "b32b61bb-c837-4697-9742-a1bb2854b628",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -260,
        -120
      ]
    },
    {
      "id": "0ead70d0-9e3b-4f19-afee-b5d4a7b532e9",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        860,
        -20
      ]
    },
    {
      "id": "a76c4340-9f34-49d1-a831-1ba4515933ee",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -40,
        -120
      ]
    },
    {
      "id": "c8090e15-b9b9-4999-89f0-97d45e6176d6",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        640,
        -20
      ]
    },
    {
      "id": "692a71fb-6fe3-4728-a588-f9283f5ab968",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        200,
        -20
      ]
    },
    {
      "id": "dfa88c15-4d38-4670-9c5a-4e52a9ce9d33",
      "name": "Edit Fields-file_name",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        -20
      ]
    },
    {
      "id": "c34c1a91-2601-4750-8134-d31cf377c349",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1080,
        -20
      ]
    },
    {
      "id": "6bd8f7dc-1006-4d7f-b3eb-0a3aaa1b9a84",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        -20
      ]
    },
    {
      "id": "8ee28143-d9e7-4d14-929f-c9b6592c366e",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -480,
        -45
      ]
    },
    {
      "id": "1e687fde-8465-4490-8738-c9832904f2b5",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        700,
        -400
      ]
    },
    {
      "id": "5e1f6dd3-6c1a-4838-86c7-2a3c0cf05c3d",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        480,
        -400
      ]
    },
    {
      "id": "f14edb71-0778-40dc-9f2d-4cfc72b8a351",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -600
      ],
      "parameters": {
        "width": 340,
        "height": 240,
        "content": "## Created by darrell_tw_ \n\nAn engineer now focus on AI and Automation\n\n### contact me with following:\n[X](https://x.com/darrell_tw_)\n[Threads](https://www.threads.net/@darrell_tw_)\n[Instagram](https:"
      }
    },
    {
      "id": "6bbe2346-287b-491d-bf20-a76d39a6e297",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -340
      ],
      "parameters": {
        "width": 660,
        "height": 480,
        "content": "## Use Chat to input prompts for image generation"
      }
    },
    {
      "id": "8dd6607a-16cf-424d-902a-04c43e68f424",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -200
      ],
      "parameters": {
        "width": 1260,
        "height": 420,
        "content": "## Process image array data with Loop\nRegardless of single or multiple images\nThey will be in the data[] array\nJust use Loop to process them\n\nImages will be uploaded to Drive and saved as a row in the"
      }
    },
    {
      "id": "f8d0819a-e38a-4f7a-aa79-594ebca465a0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -480
      ],
      "parameters": {
        "width": 480,
        "height": 260,
        "content": "## After processing, save Cost to Sheet"
      }
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields-file_name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields-file_name": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}