{
  "name": "Categorize and label incoming Gmail emails automatically with GPT-4o mini",
  "nodes": [
    {
      "id": "43213c04-af84-46b3-95a1-e1ed1112f988",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -260,
        1640
      ]
    },
    {
      "id": "65924fac-5776-4e4f-928a-d1180e730a9c",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        300,
        1880
      ]
    },
    {
      "id": "887dac9a-7bae-4797-8967-1114660c194a",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        560,
        1880
      ]
    },
    {
      "id": "fa913085-1c4f-4d61-938c-9bbf24fe9e69",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        1380
      ],
      "parameters": {
        "width": 560,
        "height": 700,
        "content": "## 1. Gmail Trigger + Label Checker\n[Read more about Gmail Trigger node Editing](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.gmailtrigger/?utm_source=n8n_app&utm_medium=node_"
      }
    },
    {
      "id": "a9c899ef-a4f5-4947-9d9b-5d579ae58827",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        1380
      ],
      "parameters": {
        "width": 620,
        "height": 1100,
        "content": "##  Sort Gmail messages by category with AI \n\n## 👥 Who's it for  \nThis workflow is perfect for individuals or teams who receive a high volume of emails 📥 and want to automatically organize them into G"
      }
    },
    {
      "id": "0415122e-6746-408c-a4eb-5d128c80a921",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        1380
      ],
      "parameters": {
        "width": 560,
        "height": 700,
        "content": "## 2. AI Agent (GPT-4o mini + Output Parser)\n[Read more about the AI Agent node editing](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/?utm_source=n8n_app"
      }
    },
    {
      "id": "446e3625-8388-44f6-b04e-2d2483f1d4d5",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        1380
      ],
      "parameters": {
        "width": 760,
        "height": 1300,
        "content": "## 3. Apply labels based on AI output\n[Read more about Switch node editing](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch/?utm_source=n8n_app&utm_medium=node_settings_modal"
      }
    },
    {
      "id": "4b4a928d-5305-40e5-a040-8a2e8787cf30",
      "name": "Give a Label AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        1640
      ]
    },
    {
      "id": "5301b42e-ba3c-4f3c-8f84-e4f9ee4ca724",
      "name": "Label Checker Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -40,
        1640
      ]
    },
    {
      "id": "3ccb8cd6-a329-4507-8158-cbc81b2d31da",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        840,
        1940
      ]
    },
    {
      "id": "70f0255c-de96-44a0-bcd0-748c9f6e4fe4",
      "name": "Work",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1560
      ]
    },
    {
      "id": "525f3f9f-9bc7-40f1-b6a5-8c3edd75025f",
      "name": "Personal",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1720
      ]
    },
    {
      "id": "84059ca7-f0cb-4582-bfb7-75f2678c1dae",
      "name": "Finance",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1880
      ]
    },
    {
      "id": "eb7f8180-c834-4f2a-b102-7e5bbacaca3b",
      "name": "Shopping",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1160,
        2020
      ]
    },
    {
      "id": "12ba969b-d0aa-475c-ab5e-e4151f8df96e",
      "name": "travel",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2140
      ]
    },
    {
      "id": "41bebc40-ba6a-448e-8e28-d74b9ed73de6",
      "name": "Newsletters",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2320
      ]
    },
    {
      "id": "9b3690d5-419c-4b4f-9e86-8720a94818d9",
      "name": "Others",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2500
      ]
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Work",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Personal",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finance",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Shopping",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "travel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Newsletters",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Others",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Label Checker Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Give a Label AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Label Checker Filter": {
      "main": [
        [
          {
            "node": "Give a Label AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Give a Label AI Agent": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Give a Label AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}