{
  "name": "Smart Gmail Labeling Automation with Text Classifier and GPT-5",
  "nodes": [
    {
      "id": "ebb9a336-a28d-4896-b997-46c9fa963127",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        280,
        400
      ]
    },
    {
      "id": "f3099bfa-ff5d-42ea-88db-f4ac5206b21b",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        720,
        420
      ]
    },
    {
      "id": "d05201ee-55d4-4e27-b31e-6c588ee224ae",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        940,
        640
      ]
    },
    {
      "id": "1503f20c-7b39-4b47-8d80-ffcafea8d004",
      "name": "Add Label (High Priority)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        260
      ]
    },
    {
      "id": "1cf7e5f2-d95d-4716-92b8-25fb873c5279",
      "name": "Add Label (Personal)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        460
      ]
    },
    {
      "id": "c6bf0b6d-07b8-4db6-a23c-e016e922ae6a",
      "name": "Add Label (Promotions)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        680
      ]
    },
    {
      "id": "96a7c0e2-8cbc-4b6f-bad4-890c22f49c41",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        320
      ],
      "parameters": {
        "width": 400,
        "height": 300,
        "content": "## SETUP REQUIRED\n\nWorkflow Configurations:\n- Update the Text Classifier and adjust the labels based on your use case.\n- Add/Remove the Gmail addLabels node to match your use case.\n\nRequired Credentia"
      }
    },
    {
      "id": "356a4f13-5e7e-4867-ae9d-e7b668fc000d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        960
      ],
      "parameters": {
        "width": 680,
        "height": 400,
        "content": "## 📋 WORKFLOW PROCESS OVERVIEW\n\nStep 1: ⏰ Schedule Trigger executes the workflow every 5 minutes automatically\nStep 2: 📨 Gmail Fetch retrieves up to 10 recent emails from the last 5 minutes using Gmai"
      }
    },
    {
      "id": "caac34f4-9c3f-498c-851e-0f3c8aa47b59",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        660
      ],
      "parameters": {
        "width": 680,
        "height": 280,
        "content": "## 📧 Smart Gmail Labeling Automation with Text Classifier and GPT-5\n\nWhat This Template Does:\n\n- Runs every 5 minutes to automatically fetch recent emails from your Gmail inbox\n- Retrieves up to 10 em"
      }
    },
    {
      "id": "59f3ef25-86a1-4353-b52a-17ef8437d014",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        80
      ],
      "parameters": {
        "width": 280,
        "height": 860,
        "content": "## Add Label Nodes\n\nAdd Label Nodes based on your use case. For example, if you have 5 labels, then you can add 5 nodes and adjust the label names on each node.\n"
      }
    },
    {
      "id": "90022931-b5a3-459f-8007-0828ef195cc3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        280
      ],
      "parameters": {
        "width": 320,
        "height": 320,
        "content": "## Label Classifier\n\nAdjust the categories based on your use case. Also, add a description to each category for maximum results.\n"
      }
    },
    {
      "id": "f73aa2ef-317d-44bf-a04c-7cc40a823328",
      "name": "Label Classifier",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        960,
        460
      ]
    },
    {
      "id": "c27d9b65-e31a-483e-beba-70af54e287fd",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "width": 320,
        "height": 320,
        "content": "## Gmail - Get Emails\n\nGet all messages received within the last 5 minutes.  \nYou can adjust the time range and the email limit here.\n"
      }
    },
    {
      "id": "4b8a92f1-4894-43cd-a647-7efebd253e64",
      "name": "Gmail - Get Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        480,
        400
      ]
    },
    {
      "id": "f8aeeec3-e0d7-44a9-ad67-6c2735a63a6e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        120
      ],
      "parameters": {
        "width": 380,
        "height": 760,
        "content": "# 👋 Hi, I’m Billy\n![My Photo](https://i.ibb.co/Gvn63Bzc/Billy-Christi-AI-Automation.jpg)\nI help businesses build **n8n workflows** & **AI automation projects**.  \nNeed help with n8n or AI Automation p"
      }
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Label Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Label Classifier": {
      "main": [
        [
          {
            "node": "Add Label (High Priority)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Label (Personal)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Label (Promotions)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Gmail - Get Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Label Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - Get Emails": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Label (Personal)": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Label (Promotions)": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Label (High Priority)": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}