{
  "name": "Categorise and label Gmail emails with GPT-4o and OpenAI",
  "nodes": [
    {
      "id": "dc9fb4ee-c544-4bd0-a959-4ce44258ade1",
      "name": "Categorize Email",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        784,
        128
      ]
    },
    {
      "id": "4a4ab82f-740a-4496-9436-e3e63129745a",
      "name": "Not Worthwhile",
      "type": "n8n-nodes-base.filter",
      "position": [
        1168,
        128
      ]
    },
    {
      "id": "75007181-40d7-480f-bd6f-d51c0c735117",
      "name": "Get Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1392,
        128
      ]
    },
    {
      "id": "de17d21c-de13-4cb5-b053-29b8b5117554",
      "name": "Add to folder",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1824,
        128
      ]
    },
    {
      "id": "5d5ba1b4-8c5e-4a4c-868d-a0b7de14ef95",
      "name": "Remove from Inbox",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1600,
        128
      ]
    },
    {
      "id": "b6f42d1a-b557-49df-99bb-3301f07400c9",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        560,
        128
      ]
    },
    {
      "id": "1a79dae4-ff6b-4feb-afd4-d7cc4eb56ae2",
      "name": "Get many labels",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1648,
        384
      ]
    },
    {
      "id": "b7c67a1e-6d1c-43d7-8c42-942086c76d3b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 536,
        "content": "## Categorise and label emails automatically with AI using Gmail and OpenAI\n\nThis workflow automatically categorises incoming emails using AI and applies Gmail labels to organize your inbox. Emails th"
      }
    },
    {
      "id": "204f04b1-59a6-4e7f-b331-f5699afc7ac9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        32
      ],
      "parameters": {
        "width": 576,
        "height": 288,
        "content": "### 📥 Step 1: Receive & Analyze\nNew emails trigger the workflow automatically. AI reads the content and decides which category fits best."
      }
    },
    {
      "id": "1bc7ace6-1b67-4a14-aedb-0f0c97e4a6c4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        32
      ],
      "parameters": {
        "width": 880,
        "height": 256,
        "content": "### 📋 Step 2: Filter & File\nEmails that don't need immediate attention are automatically moved out of inbox and organized with the correct label."
      }
    },
    {
      "id": "5951c932-864b-4b5c-9184-8ac976b1b619",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        320
      ],
      "parameters": {
        "width": 784,
        "height": 240,
        "content": "### ⚙️ Setup: Gmail Labels\n\n**Before running this workflow:**\n1. Create labels in Gmail for your categories\n2. Click 'Get many labels' node → Execute\n3. Copy the label IDs from the output\n4. Open 'Add"
      }
    },
    {
      "id": "98794dca-7144-493b-a65a-ee372cdaed65",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        336
      ],
      "parameters": {
        "width": 576,
        "height": 272,
        "content": "### ⚙️ Optional: Customize Categories\n\n**Want different email categories?**\nOpen 'Categorize Email' node → Edit the system message\n\n**You can:**\n- Add/remove categories from the list\n- Change the clas"
      }
    }
  ],
  "connections": {
    "Get Email": {
      "main": [
        [
          {
            "node": "Remove from Inbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Categorize Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Not Worthwhile": {
      "main": [
        [
          {
            "node": "Get Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Categorize Email": {
      "main": [
        [
          {
            "node": "Not Worthwhile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove from Inbox": {
      "main": [
        [
          {
            "node": "Add to folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}