{
  "name": "Ai email triage & alert system with GPT-4 and Telegram notifications",
  "nodes": [
    {
      "id": "8cc3e6c4-0941-4420-ba54-b485cae10314",
      "name": "Add Label (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        600,
        2460
      ]
    },
    {
      "id": "5fa02fbf-5c96-4770-abd6-809ee9fa5e8c",
      "name": "Mark Unread (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        760,
        2460
      ]
    },
    {
      "id": "7845f03b-62c3-4a1c-9904-9c9bae60a1fc",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1000,
        2380
      ]
    },
    {
      "id": "b43d32c1-6eb3-437a-a737-395d81e9b7ae",
      "name": "Respond on Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1600,
        2220
      ]
    },
    {
      "id": "b1e29364-4766-40fa-a871-41619aff4fed",
      "name": "Remove Label (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        920,
        2460
      ]
    },
    {
      "id": "50dae1ef-1aa1-4064-a289-7bfb0d501dd8",
      "name": "Delete Email (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        440,
        2620
      ]
    },
    {
      "id": "1d54c418-452f-4dae-a6e1-63f81ce11b97",
      "name": "Mark Read (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        600,
        2620
      ]
    },
    {
      "id": "36a8d5d1-c670-464b-ba1a-d718a72f84df",
      "name": "Aggregate Input",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -560,
        2380
      ]
    },
    {
      "id": "24cebb27-9fd0-43c5-92b7-1e8d3b426aa5",
      "name": "IsTelegram?",
      "type": "n8n-nodes-base.if",
      "position": [
        1160,
        2320
      ]
    },
    {
      "id": "7692d5ff-42c7-4fc3-b3dd-1851b468a388",
      "name": "Set Webhook Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1380,
        2400
      ]
    },
    {
      "id": "d13cf6bb-eb91-4c3b-84e2-f5798396f8a3",
      "name": "Set Telegram Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1380,
        2220
      ]
    },
    {
      "id": "2a36756a-e127-412a-be32-862a730002fe",
      "name": "Request Complete",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1820,
        2120
      ]
    },
    {
      "id": "06c90a5c-9ca4-4bb2-b461-18e412343d6e",
      "name": "Workflow Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2040,
        2320
      ]
    },
    {
      "id": "08a11219-f0af-4a40-91bb-5aec30002916",
      "name": "Respond with Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1820,
        2320
      ]
    },
    {
      "id": "af176a7d-46ed-4bf5-90e6-d3e54fdc5951",
      "name": "Agent Error Handler",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1220,
        2640
      ]
    },
    {
      "id": "5c305f9c-43f7-4920-85cf-faa1fae0b855",
      "name": "Google Gemini (OmniClassifier)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -680,
        1560
      ]
    },
    {
      "id": "c98d289e-72ad-4055-b255-2b46c814b23b",
      "name": "New Email",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1440,
        1340
      ]
    },
    {
      "id": "b7a56fc9-12cb-40f1-ada7-4891cd596062",
      "name": "Set Email Details",
      "type": "n8n-nodes-base.set",
      "position": [
        -1220,
        1340
      ]
    },
    {
      "id": "a706b8bd-dbbf-4a93-a436-a22d9bdf586f",
      "name": "Add Promotional Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -400,
        40
      ]
    },
    {
      "id": "f1ee997e-a435-46e1-a26d-0d166cc6083b",
      "name": "Add Opportunity Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        1220
      ]
    },
    {
      "id": "9e5984e5-50f1-4f3f-af94-d92d3b195108",
      "name": "Add Action Required Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        1620
      ]
    },
    {
      "id": "ed78a2f7-578f-4bb7-9a43-e6e09621742d",
      "name": "Add Operations Admin Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        1020
      ]
    },
    {
      "id": "d80f6beb-adb1-4545-a018-cad9705f782c",
      "name": "Add Social Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -380,
        340
      ]
    },
    {
      "id": "891a2595-bce7-43d1-8920-99a1062a3a56",
      "name": "Add Newsletter Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -380,
        640
      ]
    },
    {
      "id": "bcd42c0c-97c4-41b2-9311-35e948e1cb34",
      "name": "Add Noise/Spam Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -400,
        -260
      ]
    },
    {
      "id": "54bdaada-bf48-43d0-928d-0b061348fa2a",
      "name": "Add Uncategorized Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        1840
      ]
    },
    {
      "id": "b2115151-c82e-43d1-b12c-c6041c6aa369",
      "name": "Add Client Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        1420
      ]
    },
    {
      "id": "f4d4cbe0-de80-4d75-811f-ac41a29ab73f",
      "name": "Google Gemini (Escalation)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        940,
        1340
      ]
    },
    {
      "id": "56d9e5d9-67be-4d20-a7b7-9468ea1fee38",
      "name": "Escalation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1260,
        1360
      ]
    },
    {
      "id": "dee5ca9d-b9cf-4359-a7e0-578b5f100e9f",
      "name": "Human Intervention Check",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1000,
        1040
      ]
    },
    {
      "id": "1efe2d4c-a2ee-41da-93c4-6c4bd4dd1807",
      "name": "Google Gemini (Priority)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -40,
        1800
      ]
    },
    {
      "id": "a76230ea-804a-4c9b-9858-27317bb127d8",
      "name": "Priority Check",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -60,
        1440
      ]
    },
    {
      "id": "f964d54b-a4cb-427d-bbf3-f2c804e2001c",
      "name": "Priority Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        360,
        1820
      ]
    },
    {
      "id": "0f196e20-f1d2-4216-b81a-b84f07537833",
      "name": "OpenAI Chat Model (Summary)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1640,
        1320
      ]
    },
    {
      "id": "2ccc6d11-5145-4a5a-8b91-0e69a4e57c95",
      "name": "Summary Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1940,
        1340
      ]
    },
    {
      "id": "00f5a282-16a2-4949-bae8-41be4846ea22",
      "name": "Context & Summary Agent",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1680,
        1040
      ]
    },
    {
      "id": "ab90b254-9b2d-413b-a426-0bf7ccbb2664",
      "name": "Send Priority Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2140,
        1200
      ]
    },
    {
      "id": "14f3fcdd-9908-4338-9476-00a4263afce9",
      "name": "Auto-fixing Newsletter Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        240,
        800
      ]
    },
    {
      "id": "a9cde5ea-750f-4a41-b9a2-8f250f36ce76",
      "name": "Newsletter Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        60,
        780
      ]
    },
    {
      "id": "29d537c2-3a61-4c36-8028-13cb85a1bd1c",
      "name": "Google Gemini (Newsletter)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -140,
        800
      ]
    },
    {
      "id": "a5a871ec-2353-4c92-bb66-8995f4d06e67",
      "name": "Newsletter Summarizer",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        280,
        640
      ]
    },
    {
      "id": "879d6608-1eed-4a9a-a6c0-da8b79aabb20",
      "name": "Priority Autofixing Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        80,
        1640
      ]
    },
    {
      "id": "f4a65096-4b7f-4bbb-8321-b7e83991460f",
      "name": "Escalate Autofixing Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1080,
        1220
      ]
    },
    {
      "id": "d77a64af-c083-4183-96af-9a02bc4e7d5e",
      "name": "Summary Autofixing Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1760,
        1220
      ]
    },
    {
      "id": "dcb8e154-7459-4579-b7ab-dedabf984b93",
      "name": "Priority Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        300,
        1440
      ]
    },
    {
      "id": "ab0b5ab3-add6-4ca2-b848-7c76963e56e9",
      "name": "Add High Priority Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        1180
      ]
    },
    {
      "id": "01fd8bbf-ee06-45a8-b28e-cb1d96dc0325",
      "name": "Add Medium Priority Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        700,
        1680
      ]
    },
    {
      "id": "b12d7e4d-355a-4db5-aabb-0a36232c4e9b",
      "name": "Add Low Priority Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        700,
        1860
      ]
    },
    {
      "id": "caa19a1a-249d-407a-8ca0-6ed0cf197e52",
      "name": "Add Processing Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1000,
        1340
      ]
    },
    {
      "id": "61d2e0a1-9d5a-4b3a-a31d-7080308b61b9",
      "name": "Alert Required?",
      "type": "n8n-nodes-base.if",
      "position": [
        1460,
        1200
      ]
    },
    {
      "id": "668757d0-aa84-46c8-99e1-e5bdfd79c13b",
      "name": "Remove Processing (Noise/Spam)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -80,
        -260
      ]
    },
    {
      "id": "c198fda5-34a9-4559-a30a-41c5e3c1fa7f",
      "name": "Send Summary to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1560,
        640
      ]
    },
    {
      "id": "4857593c-aeb9-40d1-b4f0-663514a44531",
      "name": "OmniClassifier",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        -780,
        1340
      ]
    },
    {
      "id": "7d326dfa-93b2-48df-80bc-2dedbdd0fc88",
      "name": "Remove Processing (Promotional)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -80,
        40
      ]
    },
    {
      "id": "c4607243-3b3b-4517-8814-ce3ed2d25360",
      "name": "Remove Processing (Social)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -60,
        340
      ]
    },
    {
      "id": "efe336ba-94d2-45cd-b777-46efe1c8f76f",
      "name": "Remove Processing (Newsletter)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        660,
        640
      ]
    },
    {
      "id": "157f194a-3e38-40b3-a107-69d7ee6ee3b4",
      "name": "Add Processed Label (Newsletter)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1000,
        640
      ]
    },
    {
      "id": "6af9a427-7597-4d7e-9f2c-39b70d6ed9b7",
      "name": "Add Processed Label (Social)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        280,
        340
      ]
    },
    {
      "id": "2180bf43-e06b-46d4-b9a4-8518e199a2d4",
      "name": "Add Processed Label (Promotional)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        280,
        40
      ]
    },
    {
      "id": "4041520c-bda7-4b1b-9536-61c2530263c7",
      "name": "Add Processed Label (Noise/Spam)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        220,
        -260
      ]
    },
    {
      "id": "30b51729-e089-4150-9240-79eb462feb7f",
      "name": "Delete Noise/Spam Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        700,
        -260
      ]
    },
    {
      "id": "e6fc2d1a-2b4a-43f7-95f3-5550e46cf2bb",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -140,
        640
      ]
    },
    {
      "id": "50aef6bb-4caf-4380-8c65-e29870b211c1",
      "name": "Remove Processing Label (Medium/Low)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1400,
        1760
      ]
    },
    {
      "id": "445c9b7f-7929-4ad1-8b5b-a6db46765fcc",
      "name": "Add Processed Label (Medium/Low)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1080,
        1760
      ]
    },
    {
      "id": "133fed4a-750f-4eb5-ae2a-e39048d3314a",
      "name": "Remove Processing Label (High)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2580,
        1200
      ]
    },
    {
      "id": "c4738b02-ecb1-48c3-a8cc-f017a1579172",
      "name": "Add Processed Label (High)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2360,
        1200
      ]
    },
    {
      "id": "a090c275-f6fa-4f81-b353-e58b36a95acc",
      "name": "Merge After Noise/Spam",
      "type": "n8n-nodes-base.noOp",
      "position": [
        980,
        -260
      ]
    },
    {
      "id": "d0951d62-93fc-4bf2-b8d2-8df663a8cb81",
      "name": "Merge After Promotions",
      "type": "n8n-nodes-base.noOp",
      "position": [
        620,
        40
      ]
    },
    {
      "id": "0340dc1a-4222-4328-af11-8e1e66146fd8",
      "name": "Merge After Social",
      "type": "n8n-nodes-base.noOp",
      "position": [
        620,
        340
      ]
    },
    {
      "id": "b0c1feae-9307-4a3e-8e8c-98cc9c2cd073",
      "name": "Merge After Newsletters",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1900,
        640
      ]
    },
    {
      "id": "6ac4758b-2a1e-4da1-bb75-6b1e63c55273",
      "name": "Merge After High Priority",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2800,
        1200
      ]
    },
    {
      "id": "9d5a5a45-1d45-4916-b6c6-0e974696344c",
      "name": "Merge After Medium/Low Priority",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1660,
        1760
      ]
    },
    {
      "id": "82af8343-d247-4fdf-8664-b10d3e9f0aab",
      "name": "OpenAI Chat Model (Agent)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -80,
        2460
      ]
    },
    {
      "id": "b65fbbc3-7a82-424a-b2a0-edb3c28e4230",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1000,
        2180
      ]
    },
    {
      "id": "dfb94d26-e435-4bfe-9a8e-be45d6b1aa36",
      "name": "Set Webhook Request",
      "type": "n8n-nodes-base.set",
      "position": [
        -780,
        2180
      ]
    },
    {
      "id": "88437f49-9e3d-4698-9055-c29d9ede543c",
      "name": "Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1000,
        2580
      ]
    },
    {
      "id": "38c14be8-860f-4127-b937-94970ee16a8f",
      "name": "Set Telegram Request",
      "type": "n8n-nodes-base.set",
      "position": [
        -780,
        2380
      ]
    },
    {
      "id": "c60584a9-99fe-466a-9e38-93fcfd37b35e",
      "name": "Set Workflow Request",
      "type": "n8n-nodes-base.set",
      "position": [
        -780,
        2580
      ]
    },
    {
      "id": "f1a2d628-7bf8-40d7-9190-169f088d1747",
      "name": "Postgres Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        -80,
        2620
      ]
    },
    {
      "id": "6a49e6e5-92e0-48d5-8993-2e2235f59c2d",
      "name": "Workflow Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        2060
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8ea3a497-b2a4-4ac3-a431-8d53a17676b5",
      "name": "Set Agent Input",
      "type": "n8n-nodes-base.set",
      "position": [
        -340,
        2380
      ]
    },
    {
      "id": "b7b53e20-0444-44f7-9697-e93bd7fdf1a5",
      "name": "AI Agent Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        2060
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "13d0c794-587b-421a-8f2f-11565269f77f",
      "name": "Response & Error Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        2060
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8febce31-7068-4097-9688-b636e93d0488",
      "name": "Error Handling Details",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        2580
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "71a7cf77-5acd-476f-b7d5-f271964a29dc",
      "name": "Email Ingestion Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        1240
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "89ac10f4-7e53-4172-aa27-774d040c2850",
      "name": "Noise/Spam Handling Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -360
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "122fd89d-5c43-419a-b5a1-92cd9ba496f1",
      "name": "Promotions Handling Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -40
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "82c0a24f-eb40-46c7-975c-4d65fedacfd7",
      "name": "Social Handling Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        260
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "14d56f8c-edbb-4397-9bc7-5a539fc0099c",
      "name": "Newsletter Handling Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        540
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "02ada1d4-8581-4d3b-9d11-74b07c9eb605",
      "name": "Add Summary to Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1220,
        640
      ]
    },
    {
      "id": "2f3ba673-406b-454e-99e2-ace258abb1b0",
      "name": "Priority Classification Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        1560
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d6d086e4-f5c4-4add-ae55-f5936668dbd1",
      "name": "Email Classification Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        1280
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b353ff8e-6e4e-43e2-8191-92d9e69ba7e2",
      "name": "High Priority Handling Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        900
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "61e4219d-577a-496d-a24f-c4b779f6b33e",
      "name": "Call Sub-Workflow",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        920,
        2620
      ]
    },
    {
      "id": "bc5d0518-ccd1-41e1-b67a-3e5ec27a1075",
      "name": "Create Draft  (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        120,
        2460
      ]
    },
    {
      "id": "5258365d-08a7-43c9-8889-16a97ebe88c3",
      "name": "Send Email (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        120,
        2620
      ]
    },
    {
      "id": "e21c69ce-99ce-47e8-99e9-d6bb166a9f0c",
      "name": "Get Emails (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        280,
        2620
      ]
    },
    {
      "id": "70cc1f33-9596-49de-b791-6f667160554e",
      "name": "Email Reply (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        280,
        2460
      ]
    },
    {
      "id": "49e5c216-cc92-4c12-b7ea-ec466e0ec48a",
      "name": "Get Labels (Tool)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        440,
        2460
      ]
    },
    {
      "id": "ef4d4bfc-b003-4f8d-8f99-d78b8860116c",
      "name": "Add Label (TooI)",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        760,
        2620
      ]
    },
    {
      "id": "df4c49cb-1211-41bf-972a-ef62560f163b",
      "name": "Master Email Coordinator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        360,
        2240
      ]
    },
    {
      "id": "bfd9e858-3354-4f43-850d-651258fd1cb3",
      "name": "Unsubscribe",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        -260
      ]
    },
    {
      "id": "6e168d4e-750b-4f59-b995-44527e5c681c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        920
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "185b8e80-5e10-4396-bdca-337e19c30b08",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        960
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "New Email": {
      "main": [
        [
          {
            "node": "Set Email Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IsTelegram?": {
      "main": [
        [
          {
            "node": "Set Telegram Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unsubscribe": {
      "main": [
        [
          {
            "node": "Delete Noise/Spam Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OmniClassifier": {
      "main": [
        [
          {
            "node": "Add Noise/Spam Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Promotional Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Social Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Newsletter Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Operations Admin Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Opportunity Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Client Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Action Required Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Uncategorized Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Priority Check": {
      "main": [
        [
          {
            "node": "Priority Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Input": {
      "main": [
        [
          {
            "node": "Set Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Alert Required?": {
      "main": [
        [
          {
            "node": "Context & Summary Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Processed Label (High)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Newsletter Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Memory": {
      "ai_memory": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Priority Switch": {
      "main": [
        [
          {
            "node": "Add High Priority Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Medium Priority Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Low Priority Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Agent Input": {
      "main": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Set Webhook Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Client Label": {
      "main": [
        [
          {
            "node": "Priority Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Label (TooI)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Add Label (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Add Social Label": {
      "main": [
        [
          {
            "node": "Remove Processing (Social)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Read (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Set Telegram Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Trigger": {
      "main": [
        [
          {
            "node": "Set Workflow Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Sub-Workflow": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Emails (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Labels (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send Email (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Email Details": {
      "main": [
        [
          {
            "node": "Add Processing Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Reply (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Mark Unread (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Respond with Error": {
      "main": [
        [
          {
            "node": "Workflow Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Email (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Remove Label (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Respond on Telegram": {
      "main": [
        [
          {
            "node": "Request Complete",
            "type": "main",
            "index": 0
          },
          {
            "node": "Respond with Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Priority Alert": {
      "main": [
        [
          {
            "node": "Add Processed Label (High)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Webhook Request": {
      "main": [
        [
          {
            "node": "Aggregate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Newsletter Label": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Noise/Spam Label": {
      "main": [
        [
          {
            "node": "Remove Processing (Noise/Spam)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processing Label": {
      "main": [
        [
          {
            "node": "OmniClassifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Draft  (Tool)": {
      "ai_tool": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Telegram Request": {
      "main": [
        [
          {
            "node": "Aggregate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Workflow Request": {
      "main": [
        [
          {
            "node": "Aggregate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Opportunity Label": {
      "main": [
        [
          {
            "node": "Priority Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Promotional Label": {
      "main": [
        [
          {
            "node": "Remove Processing (Promotional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Newsletter Summarizer": {
      "main": [
        [
          {
            "node": "Remove Processing (Newsletter)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Telegram Response": {
      "main": [
        [
          {
            "node": "Respond on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summary Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Summary Autofixing Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Add Low Priority Label": {
      "main": [
        [
          {
            "node": "Add Processed Label (Medium/Low)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Priority Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Priority Autofixing Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Add High Priority Label": {
      "main": [
        [
          {
            "node": "Human Intervention Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Summary to Airtable": {
      "main": [
        [
          {
            "node": "Send Summary to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Uncategorized Label": {
      "main": [
        [
          {
            "node": "Priority Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Context & Summary Agent": {
      "main": [
        [
          {
            "node": "Send Priority Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Noise/Spam Email": {
      "main": [
        [
          {
            "node": "Merge After Noise/Spam",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Escalate Autofixing Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini (Priority)": {
      "ai_languageModel": [
        [
          {
            "node": "Priority Autofixing Parser",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Priority Check",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Human Intervention Check": {
      "main": [
        [
          {
            "node": "Alert Required?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Master Email Coordinator": {
      "main": [
        [
          {
            "node": "IsTelegram?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Agent Error Handler",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Newsletter Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Newsletter Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Send Summary to Telegram": {
      "main": [
        [
          {
            "node": "Merge After Newsletters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Action Required Label": {
      "main": [
        [
          {
            "node": "Priority Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Medium Priority Label": {
      "main": [
        [
          {
            "node": "Add Processed Label (Medium/Low)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model (Agent)": {
      "ai_languageModel": [
        [
          {
            "node": "Master Email Coordinator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summary Autofixing Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Context & Summary Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Add Operations Admin Label": {
      "main": [
        [
          {
            "node": "Priority Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (High)": {
      "main": [
        [
          {
            "node": "Remove Processing Label (High)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalate Autofixing Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Human Intervention Check",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini (Escalation)": {
      "ai_languageModel": [
        [
          {
            "node": "Human Intervention Check",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Escalate Autofixing Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini (Newsletter)": {
      "ai_languageModel": [
        [
          {
            "node": "Newsletter Summarizer",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Auto-fixing Newsletter Parser",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Priority Autofixing Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Priority Check",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing (Social)": {
      "main": [
        [
          {
            "node": "Add Processed Label (Social)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model (Summary)": {
      "ai_languageModel": [
        [
          {
            "node": "Context & Summary Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Summary Autofixing Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (Social)": {
      "main": [
        [
          {
            "node": "Merge After Social",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Newsletter Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Newsletter Summarizer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini (OmniClassifier)": {
      "ai_languageModel": [
        [
          {
            "node": "OmniClassifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing (Newsletter)": {
      "main": [
        [
          {
            "node": "Add Processed Label (Newsletter)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing (Noise/Spam)": {
      "main": [
        [
          {
            "node": "Add Processed Label (Noise/Spam)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing Label (High)": {
      "main": [
        [
          {
            "node": "Merge After High Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing (Promotional)": {
      "main": [
        [
          {
            "node": "Add Processed Label (Promotional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (Medium/Low)": {
      "main": [
        [
          {
            "node": "Remove Processing Label (Medium/Low)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (Newsletter)": {
      "main": [
        [
          {
            "node": "Add Summary to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (Noise/Spam)": {
      "main": [
        [
          {
            "node": "Unsubscribe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Processed Label (Promotional)": {
      "main": [
        [
          {
            "node": "Merge After Promotions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Processing Label (Medium/Low)": {
      "main": [
        [
          {
            "node": "Merge After Medium/Low Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}