{
  "name": "Classify cold email replies and notify via Telegram with OpenAI and Instantly",
  "nodes": [
    {
      "id": "f1a10001-0001-4000-a000-000000000001",
      "name": "Instantly Reply Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        224,
        416
      ]
    },
    {
      "id": "f1a10002-0002-4000-a000-000000000002",
      "name": "Respond 200 OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        448,
        416
      ]
    },
    {
      "id": "f1a10003-0003-4000-a000-000000000003",
      "name": "Validate Payload",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        416
      ]
    },
    {
      "id": "f1a10004-0004-4000-a000-000000000004",
      "name": "Extract Lead Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        320
      ]
    },
    {
      "id": "f1a10005-0005-4000-a000-000000000005",
      "name": "Stop - Invalid Payload",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        896,
        512
      ]
    },
    {
      "id": "f1a10006-0006-4000-a000-000000000006",
      "name": "Classify Reply - OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1120,
        320
      ]
    },
    {
      "id": "f1a10007-0007-4000-a000-000000000007",
      "name": "Parse Classification",
      "type": "n8n-nodes-base.set",
      "position": [
        1472,
        320
      ]
    },
    {
      "id": "f1a10008-0008-4000-a000-000000000008",
      "name": "Is HOT?",
      "type": "n8n-nodes-base.if",
      "position": [
        1696,
        320
      ]
    },
    {
      "id": "f1a10009-0009-4000-a000-000000000009",
      "name": "Is WARM?",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        416
      ]
    },
    {
      "id": "f1a10010-0010-4000-a000-000000000010",
      "name": "Telegram - HOT Lead",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2144,
        128
      ]
    },
    {
      "id": "f1a10011-0011-4000-a000-000000000011",
      "name": "Telegram - WARM Lead",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2144,
        320
      ]
    },
    {
      "id": "f1a10012-0012-4000-a000-000000000012",
      "name": "Telegram - COLD Lead",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2368,
        512
      ]
    },
    {
      "id": "f1a10013-0013-4000-a000-000000000013",
      "name": "Auto-Ack HOT Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2368,
        128
      ]
    },
    {
      "id": "f1a10014-0014-4000-a000-000000000014",
      "name": "Auto-Ack WARM Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2368,
        320
      ]
    },
    {
      "id": "f1a10015-0015-4000-a000-000000000015",
      "name": "Log Reply to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2624,
        320
      ]
    },
    {
      "id": "d0b12e38-005c-437d-ad7b-026e7484ab3f",
      "name": "Section - Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        208
      ],
      "parameters": {
        "width": 868,
        "height": 456,
        "content": "### Receive & validate\nInstantly sends a webhook on reply. Respond 200 immediately, validate the payload has an email and reply body, then normalize lead fields. Invalid payloads stop here."
      }
    },
    {
      "id": "907d68c4-c8d7-4231-aff2-7be691743c86",
      "name": "Section - Classify",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        208
      ],
      "parameters": {
        "width": 558,
        "height": 452,
        "content": "### Classify with AI\nSends lead data to GPT-4o-mini with classification criteria. Returns HOT, WARM, or COLD with reasoning and detected key signals."
      }
    },
    {
      "id": "bdeef9f4-68d8-4ae1-87c0-d94a52f71d46",
      "name": "Section - Route",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        32
      ],
      "parameters": {
        "width": 1212,
        "height": 636,
        "content": "### Route, notify & log\nRoutes by classification. Each tier gets a formatted Telegram alert. HOT and WARM leads receive an instant auto-ack email via Gmail. All replies are logged to Google Sheets."
      }
    },
    {
      "id": "d5fb109f-1375-4d0d-8a01-449cfd451734",
      "name": "Warning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        80
      ],
      "parameters": {
        "width": 436,
        "height": 120,
        "content": "**Dont Forget To** Replace YOUR_TELEGRAM_CHAT_ID in all three Telegram nodes and YOUR_GOOGLE_SHEET_ID in the Log Reply node. Configure the Instantly webhook to point to this workflow's URL."
      }
    },
    {
      "id": "75990737-a673-433c-a124-d0d6ca384cfd",
      "name": "Main Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -208
      ],
      "parameters": {
        "width": 660,
        "height": 868,
        "content": "## Classify Cold Email Replies and Notify via Telegram\n\nClassifies incoming cold email replies from Instantly as HOT, WARM, or COLD using OpenAI, sends Telegram notifications by priority, and auto-ack"
      }
    }
  ],
  "connections": {
    "Is HOT?": {
      "main": [
        [
          {
            "node": "Telegram - HOT Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Is WARM?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is WARM?": {
      "main": [
        [
          {
            "node": "Telegram - WARM Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram - COLD Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond 200 OK": {
      "main": [
        [
          {
            "node": "Validate Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Payload": {
      "main": [
        [
          {
            "node": "Extract Lead Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop - Invalid Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto-Ack HOT Gmail": {
      "main": [
        [
          {
            "node": "Log Reply to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto-Ack WARM Gmail": {
      "main": [
        [
          {
            "node": "Log Reply to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Lead Fields": {
      "main": [
        [
          {
            "node": "Classify Reply - OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - HOT Lead": {
      "main": [
        [
          {
            "node": "Auto-Ack HOT Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Classification": {
      "main": [
        [
          {
            "node": "Is HOT?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - COLD Lead": {
      "main": [
        [
          {
            "node": "Log Reply to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - WARM Lead": {
      "main": [
        [
          {
            "node": "Auto-Ack WARM Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Reply - OpenAI": {
      "main": [
        [
          {
            "node": "Parse Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instantly Reply Webhook": {
      "main": [
        [
          {
            "node": "Respond 200 OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}