{
  "name": "Automatic email categorization & labeling in Zoho Mail with GPT-4o-mini",
  "nodes": [
    {
      "id": "c5597735-99ba-476c-9204-23fddc8a3a3a",
      "name": "Get Access token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -416,
        432
      ]
    },
    {
      "id": "7b17ac20-46c8-4a51-a410-ae257c5c9d4f",
      "name": "Set Account ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -640,
        432
      ]
    },
    {
      "id": "5a682928-06fe-4679-8526-5fe98809b28b",
      "name": "Get labels",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -192,
        432
      ]
    },
    {
      "id": "bb0fe829-cb35-4ad6-ad00-1e432357534d",
      "name": "Text Classifier",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        256,
        432
      ]
    },
    {
      "id": "ac7f7ec0-f932-457a-809d-deb96c63838c",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        328,
        784
      ]
    },
    {
      "id": "d8fff84b-ebce-4f17-a849-888d5d7270e4",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        832,
        288
      ]
    },
    {
      "id": "0dcc2d49-bc01-4bba-bb4f-71d0e3267406",
      "name": "Incoming Email",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -864,
        432
      ]
    },
    {
      "id": "00c546e6-331f-4f63-8011-4d955055b892",
      "name": "Add Label to the email",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1056,
        336
      ]
    },
    {
      "id": "759d2539-06db-4b17-b41b-e58bc4452e4f",
      "name": "Set Support Category",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        -48
      ]
    },
    {
      "id": "8881eaf8-fda9-40e3-b24b-042f976374cd",
      "name": "Set Billing & Finance Category",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        528
      ]
    },
    {
      "id": "3c96af0d-2a5d-4340-b01c-5ad602582a75",
      "name": "Set Account Management Category",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        336
      ]
    },
    {
      "id": "503ee1a0-1633-41d4-ad93-8b60280e221a",
      "name": "Set HR & Recruitment Category",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        720
      ]
    },
    {
      "id": "75e03d2f-07d8-4776-bd8d-bc268f29e395",
      "name": "Set Leads Category",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        144
      ]
    },
    {
      "id": "f9f1e5ca-fc94-4bbb-ba75-ace833b6912c",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        608,
        912
      ]
    },
    {
      "id": "565deaa1-d8ff-4ea7-83b7-9e12f3a6770f",
      "name": "Label name to ID map",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        432
      ]
    },
    {
      "id": "a5562339-b5bc-4a1d-b65d-2f0a7a5707dc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -64
      ],
      "parameters": {
        "width": 672,
        "height": 1088,
        "content": "\n## Try It Out!\n\n### This n8n template demonstrates how to use AI to automatically classify and organize incoming emails in **Zoho Mail** by applying the correct label (e.g., Support, Billing, HR, etc"
      }
    },
    {
      "id": "c49472ef-313e-44a0-910a-a23cf8b80fa9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        256
      ],
      "parameters": {
        "width": 764,
        "height": 376,
        "content": "## Output\n![](https://ik.imagekit.io/tscnqj8zf/Zoho_email_labelling.png?updatedAt=1756894481455)"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Add Label to the email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get labels": {
      "main": [
        [
          {
            "node": "Label name to ID map",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Incoming Email": {
      "main": [
        [
          {
            "node": "Set Account ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Account ID": {
      "main": [
        [
          {
            "node": "Get Access token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Classifier": {
      "main": [
        [
          {
            "node": "Set Support Category",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Leads Category",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Account Management Category",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Billing & Finance Category",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set HR & Recruitment Category",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Access token": {
      "main": [
        [
          {
            "node": "Get labels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Leads Category": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Label name to ID map": {
      "main": [
        [
          {
            "node": "Text Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Support Category": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Text Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Add Label to the email": {
      "main": [
        []
      ]
    },
    "Set HR & Recruitment Category": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Set Billing & Finance Category": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Set Account Management Category": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    }
  }
}