{
  "name": "📩 Automated email management system with GPT-5, multi-agent AI & Pinecone DB",
  "nodes": [
    {
      "id": "6f7313b8-998e-4d95-acbf-d6bc15c7d732",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -512,
        -16
      ]
    },
    {
      "id": "81fe47ea-54df-4f75-8af8-cbe5fc97b9e3",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        208,
        1616
      ]
    },
    {
      "id": "758cc80b-aa48-43d0-b2ff-e681ddd48c49",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        432,
        -544
      ]
    },
    {
      "id": "f50f02b8-022b-4021-9f01-9e7a11ef15de",
      "name": "Reply Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        736,
        -896
      ]
    },
    {
      "id": "8a9e3306-aa3f-4acc-86cd-e9e891e94d8c",
      "name": "Customer Support Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        368,
        -896
      ]
    },
    {
      "id": "8d388b51-fc82-4ebd-8dd1-3fe18519d106",
      "name": "Finance Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        336,
        -80
      ]
    },
    {
      "id": "244affcf-3bda-4fc7-8e3c-2dcda53bc3cc",
      "name": "Leads Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        448,
        592
      ]
    },
    {
      "id": "625a8b76-8523-4ddf-a3e6-bc503034e20c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -1056
      ],
      "parameters": {
        "width": 1184,
        "height": 672,
        "content": "## Customer Support\n- Any queries related to questions on FAQ by customers or policies, warranty etc, will be routed here.\n- Setup pinecone vector database with documents that contain your FAQs and po"
      }
    },
    {
      "id": "2e49380c-20bf-4909-9507-37e1b653e05c",
      "name": "Internal Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        1264
      ]
    },
    {
      "id": "6c233cf9-212b-4e9e-bf88-fd8a38752f68",
      "name": "Label as Customer Support",
      "type": "n8n-nodes-base.gmail",
      "position": [
        960,
        -896
      ]
    },
    {
      "id": "cf82a1a4-b002-4235-82af-63f18942bd5b",
      "name": "Label as Finance",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        416,
        96
      ]
    },
    {
      "id": "02babaee-e872-45c8-b4e4-aab19c062b0d",
      "name": "Label as Sales Opportunities",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        416,
        816
      ]
    },
    {
      "id": "9dc5dbaa-9b5e-449f-8c3b-5f8c645ac779",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -368
      ],
      "parameters": {
        "width": 1184,
        "height": 656,
        "content": "## Finance Agent\n- Handles any email query finance-related. \n- The agent first labels the email as \"Finance\"\n- It then reviews the email to see if it is related to payments or invoices\n- The structure"
      }
    },
    {
      "id": "9d203fa1-a54c-42ef-9886-4163a3123314",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        304
      ],
      "parameters": {
        "width": 1184,
        "height": 800,
        "content": "## Sales/Leads Agent \n- Identifies any emails about sales opportunities. \n- The agent first labels the email as \"sales opportunities\"\n- Setup a pinecone vector database that contains data related to t"
      }
    },
    {
      "id": "024318eb-5e25-494b-a3c6-72256ca7382e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        1120
      ],
      "parameters": {
        "width": 1184,
        "height": 448,
        "content": "## Internal Agent \n- Any emails by team members will be routed here.\n- The agent will label it as \"internal\" and send a telegram message summarising its contents. **Note to input your personal ChatID "
      }
    },
    {
      "id": "0dfb0bbd-ab6c-4db6-97d2-e45983e996f2",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        608,
        944
      ]
    },
    {
      "id": "2f643199-bc20-4e8a-8a83-c8a4697f4514",
      "name": "Database of FAQs and Policies",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        448,
        -688
      ]
    },
    {
      "id": "ab484b41-257e-4fb5-aaf9-ab5c52e8f9d3",
      "name": "Needs Review?",
      "type": "n8n-nodes-base.if",
      "position": [
        848,
        592
      ]
    },
    {
      "id": "c858664a-5f23-49a3-9f5a-3248d11caf6f",
      "name": "GPT 4o mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        304,
        -688
      ]
    },
    {
      "id": "21182b0b-a8c3-4e2c-b55a-0a0fa640497c",
      "name": "GPT 4o mini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        256,
        96
      ]
    },
    {
      "id": "aed022a4-79e1-4233-96bb-464ccb6b103a",
      "name": "GPT 4o mini2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        256,
        816
      ]
    },
    {
      "id": "209217da-45df-4170-8876-bb2b39de9428",
      "name": "GPT 4o mini3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        400,
        1424
      ]
    },
    {
      "id": "80791e3c-3b1c-498d-a89c-074aa1b226b8",
      "name": "Inbox Router",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        -240,
        -64
      ]
    },
    {
      "id": "8913afc7-bd15-45f7-8d99-90c896220032",
      "name": "Route by Email Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        656,
        -80
      ]
    },
    {
      "id": "9bd4da70-dcc0-411b-94ad-d9b8e3776403",
      "name": "OutputFormat",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        560,
        96
      ]
    },
    {
      "id": "fb30770c-95fe-41d6-a4a4-78435f208df9",
      "name": "Notify Amount Received",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1120,
        -96
      ]
    },
    {
      "id": "db1f46b9-b2bc-4584-b08e-a15420128415",
      "name": "Notify Amount to Pay",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1120,
        80
      ]
    },
    {
      "id": "0fa94dfb-182d-4f29-bbd8-8e2d6f39948a",
      "name": "Email Draft",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1024,
        784
      ]
    },
    {
      "id": "6cf3269e-0d32-498a-b96b-47f1252ec252",
      "name": "Label as Internal",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        560,
        1424
      ]
    },
    {
      "id": "43d657f4-4164-47c7-8d9b-59ee5fe889ca",
      "name": "Send a message to user to review drafted reply",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1184,
        784
      ]
    },
    {
      "id": "0b3dbc39-ecb6-4a4c-8ddd-40c0c27ecab5",
      "name": "Send a message to user to review the email directly",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1184,
        576
      ]
    },
    {
      "id": "7b87e106-0a4c-49bd-a8f9-9d0cc9567e28",
      "name": "Output Format",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        848,
        816
      ]
    },
    {
      "id": "c75d94e7-c9aa-42c8-92fc-0d15296d621d",
      "name": "Output Format1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        720,
        1424
      ]
    },
    {
      "id": "09789837-6aa1-4043-87f0-1207e3a01bea",
      "name": "Send a summary of email and from who",
      "type": "n8n-nodes-base.telegram",
      "position": [
        896,
        1264
      ]
    },
    {
      "id": "d43d4957-6117-4516-b6eb-3ac6a57dd5a5",
      "name": "Send a message to Payments Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        912,
        80
      ]
    },
    {
      "id": "01ffc8d4-ddaa-464c-ba20-0ec626dcf85c",
      "name": "Send a message to Receivables Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        912,
        -96
      ]
    },
    {
      "id": "0779c8e1-600e-46d5-9b13-c35c55221f8a",
      "name": "Database of Business Services",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        560,
        816
      ]
    },
    {
      "id": "89ea2355-ee63-479a-a419-0a3d48d8217f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -368
      ],
      "parameters": {
        "width": 272,
        "height": 704,
        "content": "## Trigger\nWorkflow is triggered when an email comes in\n\n## Setup\n- Connect to your Gmail account using Gmail API"
      }
    },
    {
      "id": "c7f19fbe-bc82-49bf-a27d-910b342bd37a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -368
      ],
      "parameters": {
        "width": 320,
        "height": 704,
        "content": "## Inbox Router\nBased on incoming email's \"subject\", \"from\", and \"content\", GPT will route the email to the respective designated categories.\n\n## Setup\n- Select email \"body\", \"subject\" and \"from\" for "
      }
    },
    {
      "id": "e75aab89-507b-4272-b5f8-11caa17ae9be",
      "name": "GPT 5 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -208,
        208
      ]
    },
    {
      "id": "43ad74d1-c0d1-4324-8749-a68ced79faf6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -1136
      ],
      "parameters": {
        "width": 640,
        "height": 688,
        "content": "## Categorise and route emails with GPT 5\nThis workflow demonstrates how to use AI text classifier to classify incoming emails, and uses a multi-agent architecture to respond for each email category r"
      }
    }
  ],
  "connections": {
    "GPT 5 mini": {
      "ai_languageModel": [
        [
          {
            "node": "Inbox Router",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Email Draft": {
      "main": [
        [
          {
            "node": "Send a message to user to review drafted reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o mini": {
      "ai_languageModel": [
        [
          {
            "node": "Customer Support Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Leads Agent": {
      "main": [
        [
          {
            "node": "Needs Review?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply Email": {
      "main": [
        [
          {
            "node": "Label as Customer Support",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o mini1": {
      "ai_languageModel": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o mini2": {
      "ai_languageModel": [
        [
          {
            "node": "Leads Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4o mini3": {
      "ai_languageModel": [
        [
          {
            "node": "Internal Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Inbox Router": {
      "main": [
        [
          {
            "node": "Customer Support Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finance Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Leads Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Internal Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OutputFormat": {
      "ai_outputParser": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Finance Agent": {
      "main": [
        [
          {
            "node": "Route by Email Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Inbox Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs Review?": {
      "main": [
        [
          {
            "node": "Send a message to user to review the email directly",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Format": {
      "ai_outputParser": [
        [
          {
            "node": "Leads Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Internal Agent": {
      "main": [
        [
          {
            "node": "Send a summary of email and from who",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Format1": {
      "ai_outputParser": [
        [
          {
            "node": "Internal Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Label as Finance": {
      "ai_tool": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Database of FAQs and Policies",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Label as Internal": {
      "ai_tool": [
        [
          {
            "node": "Internal Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Database of Business Services",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Route by Email Type": {
      "main": [
        [
          {
            "node": "Send a message to Receivables Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message to Payments Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Customer Support Agent": {
      "main": [
        [
          {
            "node": "Reply Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Label as Sales Opportunities": {
      "ai_tool": [
        [
          {
            "node": "Leads Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Database of Business Services": {
      "ai_tool": [
        [
          {
            "node": "Leads Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Database of FAQs and Policies": {
      "ai_tool": [
        [
          {
            "node": "Customer Support Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send a message to Payments Team": {
      "main": [
        [
          {
            "node": "Notify Amount to Pay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message to Receivables Team": {
      "main": [
        [
          {
            "node": "Notify Amount Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}