{
  "name": "Generate YouTube thumbnails via Telegram using BrowserAct and Gemini (Nano Banana Pro)",
  "nodes": [
    {
      "id": "4d771058-69a2-4029-96b4-3aad2030f553",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -592,
        800
      ]
    },
    {
      "id": "0aaaf0b4-c685-4f37-87a9-6879d6f15de6",
      "name": "Run a workflow",
      "type": "n8n-nodes-browseract.browserAct",
      "position": [
        832,
        656
      ]
    },
    {
      "id": "24e4a175-ac58-439a-b6cf-05d4879ba4b8",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1824,
        784
      ]
    },
    {
      "id": "39264cdb-12e2-4e4f-b379-76b63abc7a50",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1600,
        656
      ]
    },
    {
      "id": "e8e96675-e3f1-4d8b-9475-1616f25c2410",
      "name": "Generate an image",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        608,
        -64
      ]
    },
    {
      "id": "fb0bc311-8769-4f24-a898-2fecf0daf4dc",
      "name": "Validate user input",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -688,
        576
      ]
    },
    {
      "id": "337ea7dd-021e-4563-8db9-3fbd39f06b83",
      "name": "Inform user",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        480
      ]
    },
    {
      "id": "aa9d3916-7ffd-4827-9d23-d17ba556e58d",
      "name": "Generate Image Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        256,
        -64
      ]
    },
    {
      "id": "70d5a36f-d331-4bf4-8a83-8333f7df241a",
      "name": "Get Keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -368,
        80
      ]
    },
    {
      "id": "e1ce75d2-8fc0-4ebf-98e3-e3ef3072f792",
      "name": "Get Images Details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -208,
        80
      ]
    },
    {
      "id": "a6cb8724-922d-440b-9241-e0229e377026",
      "name": "Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        368,
        128
      ]
    },
    {
      "id": "e223ac61-624a-4f25-874f-aa760a76a727",
      "name": "Google Gemini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        208,
        128
      ]
    },
    {
      "id": "412a7d55-0c3c-4741-bc56-64d3da9d276f",
      "name": "User Sends Message to Bot",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1168,
        368
      ]
    },
    {
      "id": "4d9aac81-bdc2-4937-bf73-1f320af181ba",
      "name": "Check for Query Callback",
      "type": "n8n-nodes-base.switch",
      "position": [
        -912,
        368
      ]
    },
    {
      "id": "e7c7723d-4b94-4d1c-a592-dffb65704da9",
      "name": "Check For Input Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        -224,
        560
      ]
    },
    {
      "id": "74e5e3ca-6f01-4895-9713-397558d62d87",
      "name": "Save Sheet ID and Keyword",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        368
      ]
    },
    {
      "id": "1713c697-9fe4-491e-ae74-430afea55f00",
      "name": "Save Image Descriptions to Database",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2144,
        656
      ]
    },
    {
      "id": "f587c36a-9e9a-4595-a9d3-d2178bcfbf0a",
      "name": "Await Continuation Approval",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1872,
        480
      ]
    },
    {
      "id": "ea3d0cc0-602e-4aca-b23f-7f20710b29c9",
      "name": "Splitting Image Items",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        656
      ]
    },
    {
      "id": "7f1f9701-9ad6-4a8a-81b3-db9442aacfaf",
      "name": "Filter Low-Quality Images",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        656
      ]
    },
    {
      "id": "14d0d22d-ab6b-48e1-8194-3cf23edea9ee",
      "name": "Analyze Image Content",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1824,
        656
      ]
    },
    {
      "id": "0a69d38e-0c3d-4f7a-b80d-3fedd0f0e59c",
      "name": "Answer the User",
      "type": "n8n-nodes-base.telegram",
      "position": [
        480,
        1152
      ]
    },
    {
      "id": "ca0dee61-0138-4e4a-a7af-ab21a9a2da0a",
      "name": "Chat with User",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        112,
        1152
      ]
    },
    {
      "id": "2f40312a-783a-4b89-b344-1da60dbe3a9b",
      "name": "Validate input",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -736,
        816
      ]
    },
    {
      "id": "1af27ee3-eed5-407f-8676-21b9008a6a8c",
      "name": "Chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        112,
        1312
      ]
    },
    {
      "id": "b664143b-81f0-442d-8088-62d1a5ed8512",
      "name": "Wait for Google Sheet Creation",
      "type": "n8n-nodes-base.wait",
      "position": [
        352,
        496
      ]
    },
    {
      "id": "dc947ab4-423c-44b6-ad84-334cf8301543",
      "name": "Send Thumbnail Back to Bot",
      "type": "n8n-nodes-base.telegram",
      "position": [
        848,
        -64
      ]
    },
    {
      "id": "96480ff3-c4e0-4b96-a58f-8f09308cb9ce",
      "name": "Check If User Wants to Continue",
      "type": "n8n-nodes-base.if",
      "position": [
        -592,
        96
      ]
    },
    {
      "id": "edb44cbc-12df-40ea-8fd7-1ed8c035a44f",
      "name": "Aggregate Google Sheets data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -48,
        80
      ]
    },
    {
      "id": "73f7e177-f974-486b-9d75-09dd53bd5712",
      "name": "Create Database sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        64,
        640
      ]
    },
    {
      "id": "628eba2c-6c5f-40ed-a3ec-6e2951fd1f1d",
      "name": "Clear Database sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        640,
        656
      ]
    },
    {
      "id": "007f73e8-1174-4c17-b2e3-18524648b5d5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        320
      ],
      "parameters": {
        "width": 400,
        "height": 224,
        "content": "### 📊 Google Sheets Requirements\n\n**Spreadsheet Name:**\nThumbnail Data base\n\n**Sheet Name:**\nDatabase\n\n**Required Columns:**\n* Keyword\n* Current Workflow Sheet ID"
      }
    },
    {
      "id": "02396726-3d1c-47c5-99fb-4b89770092e0",
      "name": "Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -64
      ],
      "parameters": {
        "width": 420,
        "height": 560,
        "content": "## ⚡ Workflow Overview & Setup\n\n**Summary:** An advanced AI Thumbnail Artist that scrapes YouTube trends, analyzes visual hooks, and generates high-CTR thumbnails. It features an **interactive approva"
      }
    },
    {
      "id": "1f737dd1-529b-467f-b575-d0ada29c9ae1",
      "name": "Step 1 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        944
      ],
      "parameters": {
        "width": 968,
        "height": 108,
        "content": "### 🧠 Step 1: Intent Analysis\n\nThe workflow intercepts text messages to classify user intent. If a video topic is detected, it prepares a new database entry in Google Sheets to track the session and i"
      }
    },
    {
      "id": "7b0734db-fac7-4293-a321-a2df8dd174e7",
      "name": "Step 2 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        896
      ],
      "parameters": {
        "width": 2200,
        "height": 80,
        "content": "### 🕵️ Step 2: Visual Research\n\nBrowserAct scrapes YouTube for the given keyword. The workflow then uses AI to analyze the visual composition of top-performing thumbnails, saving these \"visual hooks\" "
      }
    },
    {
      "id": "814a31d3-417e-4bba-b478-54936bf9005e",
      "name": "Step 3 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        384
      ],
      "parameters": {
        "width": 808,
        "height": 80,
        "content": "### ⏸️ Step 3: Human-in-the-Loop\n\nTo prevent wasted API credits, the workflow pauses and sends a Telegram message with an interactive button. It waits for the user to explicitly click \"Yes, Continue\" "
      }
    },
    {
      "id": "dba877e1-9364-4cac-87e9-3a9c730c20ab",
      "name": "Step 4 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -192
      ],
      "parameters": {
        "width": 1664,
        "height": 96,
        "content": "### 🎨 Step 4: Callback & Generation\n\nWhen the button is clicked, this branch activates. It retrieves the saved visual research from Google Sheets, feeds it into the \"Apex Architect\" AI to create a cin"
      }
    },
    {
      "id": "bcb05ff4-b5f4-4a87-ac67-481b5e1f7564",
      "name": "Step 4 Explanation1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        1424
      ],
      "parameters": {
        "width": 564,
        "height": 96,
        "content": "### 💬 Step 2-2: Conversational Fallback\n\nProcesses user input to define \"Video Topics\" or handle casual chat using specific HTML formatting."
      }
    },
    {
      "id": "de30678f-2e8d-4e11-a508-88068b85540f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -64
      ],
      "parameters": {
        "width": 528,
        "height": 304,
        "content": "@[youtube](m0N91nN4ElA)"
      }
    }
  ],
  "connections": {
    "Chat": {
      "ai_languageModel": [
        [
          {
            "node": "Chat with User",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Keywords": {
      "main": [
        [
          {
            "node": "Get Images Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat with User": {
      "main": [
        [
          {
            "node": "Answer the User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Image Prompt",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Run a workflow": {
      "main": [
        [
          {
            "node": "Splitting Image Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate input": {
      "ai_languageModel": [
        [
          {
            "node": "Validate user input",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Await Continuation Approval",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Analyze Image Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an image": {
      "main": [
        [
          {
            "node": "Send Thumbnail Back to Bot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Image Prompt",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get Images Details": {
      "main": [
        [
          {
            "node": "Aggregate Google Sheets data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate user input": {
      "main": [
        [
          {
            "node": "Check For Input Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check For Input Type": {
      "main": [
        [
          {
            "node": "Create Database sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Inform user",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chat with User",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chat with User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear Database sheet": {
      "main": [
        [
          {
            "node": "Run a workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image Content": {
      "main": [
        [
          {
            "node": "Save Image Descriptions to Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Database sheet": {
      "main": [
        [
          {
            "node": "Wait for Google Sheet Creation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clear Database sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Prompt": {
      "main": [
        [
          {
            "node": "Generate an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Image Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Splitting Image Items": {
      "main": [
        [
          {
            "node": "Filter Low-Quality Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Query Callback": {
      "main": [
        [
          {
            "node": "Check If User Wants to Continue",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Validate user input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Validate user input",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Filter Low-Quality Images": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User Sends Message to Bot": {
      "main": [
        [
          {
            "node": "Check for Query Callback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Google Sheets data": {
      "main": [
        [
          {
            "node": "Generate Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Google Sheet Creation": {
      "main": [
        [
          {
            "node": "Clear Database sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Sheet ID and Keyword",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If User Wants to Continue": {
      "main": [
        [
          {
            "node": "Get Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Image Descriptions to Database": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}