{
  "name": "Auto-label Gmail emails using Gemini 2.5 Pro AI classification",
  "nodes": [
    {
      "id": "f5583750-3712-45ab-b80d-e6ef59e1e6dd",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -384,
        -80
      ]
    },
    {
      "id": "39fb0933-4c78-4209-aa47-4bc2b76aac83",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        416,
        -80
      ]
    },
    {
      "id": "4a2fcba6-5e5e-4fea-8a87-94f774a18e54",
      "name": "Add label to message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        976,
        -80
      ]
    },
    {
      "id": "4838c10e-bda2-4d72-ad5e-f50090ec4f9d",
      "name": "Get many labels",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -176,
        -80
      ]
    },
    {
      "id": "310a8233-f123-473b-90ad-0df5417c66e1",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        -80
      ]
    },
    {
      "id": "3c2c6444-2a70-414e-92fc-df97b3d2ca27",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        32,
        -80
      ]
    },
    {
      "id": "5d4dea5a-6117-416a-bbf3-5c9595e479dd",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        768,
        -80
      ]
    },
    {
      "id": "2691c250-40e4-41b8-9b5e-f553cd842a2f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -256
      ],
      "parameters": {
        "width": 496,
        "height": 480,
        "content": "## 📨 AI Gmail Auto-Labeler: How it Works\n\n#### Trigger:\nWatches for new unread emails.\n\n#### Label Sync:\nFetches all your current Gmail labels (label name + ID).\n\n#### AI Classification:\nSends each ne"
      }
    },
    {
      "id": "0409c111-441c-4ff5-99e6-39098ca775a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        -192
      ],
      "parameters": {
        "width": 464,
        "height": 336,
        "content": "## 🛠️ How to Use\n- Connect your Gmail and Gemini API credentials.\n- Customize your allowed Gmail labels in your mailbox (no need to update nodes).\n- AI will NEVER suggest a label not present in your G"
      }
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Add label to message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Get many labels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many labels": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}