{
  "name": "Automated product ad image creation with OpenAI, Gemini & Google Workspace",
  "nodes": [
    {
      "id": "16c2ca1d-8986-4533-9bf2-aba9fd0efe61",
      "name": "download_influencer_image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        960,
        320
      ]
    },
    {
      "id": "9def7a44-23bb-4735-b363-901ac7191efb",
      "name": "upload_image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1040,
        736
      ]
    },
    {
      "id": "42e5857c-b566-4ebd-9bc5-ef5cb900e3ce",
      "name": "Analyze image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -64,
        736
      ]
    },
    {
      "id": "cf18eb77-e961-4d4f-b7c4-bd6ac81e1751",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -112,
        320
      ]
    },
    {
      "id": "ddd3fd77-5079-4c58-9bc1-cdb6862eb4f4",
      "name": "Download Product Image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        336,
        320
      ]
    },
    {
      "id": "5a328387-8506-4e53-8347-7f76fcf0df38",
      "name": "Convert Binary to Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        672,
        320
      ]
    },
    {
      "id": "f30a0657-152a-4233-888c-3a71fc965bb4",
      "name": "Get the Raw",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        112,
        320
      ]
    },
    {
      "id": "8121809f-b1ec-49e7-bca3-5e1ee95b1b3b",
      "name": "influencer_image_Convert_to_Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1200,
        320
      ]
    },
    {
      "id": "b4e31c1d-29d1-4214-80cb-bc9133b72a7b",
      "name": "Image Generation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        736
      ]
    },
    {
      "id": "cce44841-176e-48f5-9196-3abf2f284cca",
      "name": "base64 cleanup",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        736
      ]
    },
    {
      "id": "c91456d5-1e1f-4c70-90bf-94da0f9bfb46",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        672,
        736
      ]
    },
    {
      "id": "cbc50b85-4b16-4aca-b26b-f5f7ba764c2b",
      "name": "Update Spreadsheet with Results",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1264,
        736
      ]
    },
    {
      "id": "52545f4b-1a5c-4e4a-b9ed-f5a1788f536f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        96
      ],
      "parameters": {
        "width": 1696,
        "height": 448,
        "content": "## Step 1: Trigger & Data Preparation\n- **Schedule Trigger** → Runs daily at a defined interval.  \n- **Google Sheets (Get Row)** → Fetch product + model image URLs for today's date.  \n- **Google Drive"
      }
    },
    {
      "id": "b80eff1b-cdca-4679-bad1-646f0c3033eb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        560
      ],
      "parameters": {
        "width": 1008,
        "height": 368,
        "content": "## Step 2: AI Analysis & Image Generation\n- **OpenAI (Analyze Image)** → Generate an ad-focused description (lighting, styling, background, mood).  \n- **HTTP Request (OpenRouter Gemini)** → Combine pr"
      }
    },
    {
      "id": "1a744b30-6ca9-45fb-b1b6-a5bb612302ba",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        560
      ],
      "parameters": {
        "width": 672,
        "height": 368,
        "content": "## Step 3: Save & Update\n- **Google Drive (Upload Image)** → Save the generated ad image in the correct folder.  \n- **Google Sheets (Append / Update Row)** → Store the Google Drive link + mark status "
      }
    }
  ],
  "connections": {
    "Get the Raw": {
      "main": [
        [
          {
            "node": "Download Product Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "upload_image": {
      "main": [
        [
          {
            "node": "Update Spreadsheet with Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "Image Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "base64 cleanup": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "upload_image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Generation": {
      "main": [
        [
          {
            "node": "base64 cleanup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get the Raw",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Binary to Text": {
      "main": [
        [
          {
            "node": "download_influencer_image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Product Image": {
      "main": [
        [
          {
            "node": "Convert Binary to Text",
            "type": "main",
            "index": 0
          },
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "download_influencer_image": {
      "main": [
        [
          {
            "node": "influencer_image_Convert_to_Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "influencer_image_Convert_to_Text": {
      "main": [
        [
          {
            "node": "Image Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}