{
  "name": "Send GPT-4 Telegram polls to multiple groups with Google Sheets analytics",
  "nodes": [
    {
      "id": "fa145afe-a1a4-434d-8f5a-b1c7d4f20611",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1952,
        96
      ],
      "parameters": {
        "width": 780,
        "height": 1068,
        "content": "## AI-Powered Telegram Poll Automation with Analytics & Multi-Group Deploy\n\nAn enterprise-grade n8n workflow that leverages OpenAI GPT-4 to generate contextually relevant poll questions and automatica"
      }
    },
    {
      "id": "aa0ff31a-4f92-4d56-87bb-76540c5068e9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        464
      ],
      "parameters": {
        "width": 616,
        "height": 328,
        "content": "## 1. Schedule & Topic Selection"
      }
    },
    {
      "id": "ad144a6e-38fe-4324-98c7-11123bcef653",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        288
      ],
      "parameters": {
        "width": 508,
        "height": 684,
        "content": "## 2. GPT-4 Generation & Validation"
      }
    },
    {
      "id": "67b5ec41-9e25-43cb-9f3c-da19f39f5f12",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        256
      ],
      "parameters": {
        "width": 608,
        "height": 732,
        "content": "## 3. Multi-Group Telegram Deploy"
      }
    },
    {
      "id": "1d51d614-e5d9-4c25-a645-30a500a35196",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        256
      ],
      "parameters": {
        "width": 1260,
        "height": 844,
        "content": "## 4. Analytics, Admin Alert, Error Handling & Queue Update"
      }
    },
    {
      "id": "6484390c-3bcd-4add-b054-5d90b6d605f2",
      "name": "Poll Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1040,
        624
      ]
    },
    {
      "id": "63567ee5-4e7e-4084-9fb5-b9b3023ee45b",
      "name": "Load Topic Queue from Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -816,
        624
      ]
    },
    {
      "id": "cf38c882-0451-4ca0-9d2d-1e782e387e5d",
      "name": "Select Highest Priority Topic",
      "type": "n8n-nodes-base.code",
      "position": [
        -592,
        624
      ]
    },
    {
      "id": "38a3ef73-cf36-4dd3-bf06-fb365f0483b7",
      "name": "Load Telegram Group Registry",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -304,
        480
      ]
    },
    {
      "id": "b8393df3-941e-4f14-9916-8f1b7e051f3b",
      "name": "GPT-4 Poll Question Generation",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -368,
        784
      ]
    },
    {
      "id": "f3cd5065-b0c3-401e-b876-02338da5648c",
      "name": "GPT-4o Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -288,
        1008
      ]
    },
    {
      "id": "8bf39649-2878-4623-8084-8638f5f50e2f",
      "name": "Validate Poll Quality and Safety",
      "type": "n8n-nodes-base.code",
      "position": [
        -16,
        624
      ]
    },
    {
      "id": "67e59347-0de0-4d99-85c8-f100b0d27b75",
      "name": "Split Groups for Parallel Deploy",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        208,
        624
      ]
    },
    {
      "id": "3702e66e-2a9e-43e4-bb16-4f57a8ffe6ad",
      "name": "Send Poll to Telegram Group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        432,
        528
      ]
    },
    {
      "id": "57b627c6-f71e-48da-8e03-118534bd898b",
      "name": "Send Context Message with Hashtags",
      "type": "n8n-nodes-base.telegram",
      "position": [
        432,
        720
      ]
    },
    {
      "id": "4f5bc2dd-2792-4db9-94f0-c6401468060e",
      "name": "Collect Deploy Result Per Group",
      "type": "n8n-nodes-base.code",
      "position": [
        656,
        624
      ]
    },
    {
      "id": "e8d6bc92-30e5-4add-a1ca-f11d7d209212",
      "name": "Merge All Group Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        880,
        624
      ]
    },
    {
      "id": "ac913e0b-4054-4e08-97f6-6b3b49ae8b91",
      "name": "Build Analytics Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        624
      ]
    },
    {
      "id": "b334e64f-dadc-4bd8-8761-7b3377ecca35",
      "name": "Log Analytics to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1328,
        336
      ]
    },
    {
      "id": "8f589c91-05f1-4806-8e59-3d8fb3b88700",
      "name": "Send Admin Telegram Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1328,
        528
      ]
    },
    {
      "id": "596f8666-0e28-492b-b776-d69a1d7b7798",
      "name": "Send Error Alert Email on Failures",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1328,
        720
      ]
    },
    {
      "id": "f5275907-79c8-4012-94c8-295a5917d6fd",
      "name": "Update Topic Queue — Mark Used",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1328,
        912
      ]
    },
    {
      "id": "42fb3d31-c6c5-4e09-8f0b-41c57e34579f",
      "name": "Build Final Deployment Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1552,
        624
      ]
    }
  ],
  "connections": {
    "GPT-4o Model": {
      "ai_languageModel": [
        [
          {
            "node": "GPT-4 Poll Question Generation",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Poll Schedule Trigger": {
      "main": [
        [
          {
            "node": "Load Topic Queue from Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Analytics Summary": {
      "main": [
        [
          {
            "node": "Log Analytics to Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Admin Telegram Notification",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Error Alert Email on Failures",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Topic Queue — Mark Used",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Group Results": {
      "main": [
        [
          {
            "node": "Build Analytics Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Poll to Telegram Group": {
      "main": [
        [
          {
            "node": "Collect Deploy Result Per Group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Telegram Group Registry": {
      "main": [
        [
          {
            "node": "Validate Poll Quality and Safety",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Topic Queue from Sheets": {
      "main": [
        [
          {
            "node": "Select Highest Priority Topic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Highest Priority Topic": {
      "main": [
        [
          {
            "node": "Load Telegram Group Registry",
            "type": "main",
            "index": 0
          },
          {
            "node": "GPT-4 Poll Question Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Poll Question Generation": {
      "main": [
        [
          {
            "node": "Validate Poll Quality and Safety",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Analytics to Google Sheets": {
      "main": [
        [
          {
            "node": "Build Final Deployment Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Deploy Result Per Group": {
      "main": [
        [
          {
            "node": "Merge All Group Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Admin Telegram Notification": {
      "main": [
        [
          {
            "node": "Build Final Deployment Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Groups for Parallel Deploy": {
      "main": [
        [
          {
            "node": "Send Poll to Telegram Group",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Context Message with Hashtags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Topic Queue — Mark Used": {
      "main": [
        [
          {
            "node": "Build Final Deployment Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Poll Quality and Safety": {
      "main": [
        [
          {
            "node": "Split Groups for Parallel Deploy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Context Message with Hashtags": {
      "main": [
        [
          {
            "node": "Collect Deploy Result Per Group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Error Alert Email on Failures": {
      "main": [
        [
          {
            "node": "Build Final Deployment Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}