{
  "name": "Automatically Classify Zoho Desk Support Tickets using Gemini AI",
  "nodes": [
    {
      "id": "f34db366-b13a-43ac-8d4e-a52e3a7243dd",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -432,
        -256
      ]
    },
    {
      "id": "e2386bfd-2803-4f40-8744-0c86aecfb167",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1200,
        -96
      ]
    },
    {
      "id": "fe6a1452-471c-4e2b-8c64-7d32e35bb33b",
      "name": "Filter classification = null",
      "type": "n8n-nodes-base.code",
      "position": [
        496,
        -256
      ]
    },
    {
      "id": "4153b802-af64-4ec1-b55e-2dcd41a8f038",
      "name": "Get threads",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        -256
      ]
    },
    {
      "id": "f41d94a5-3070-4874-a72d-2ff28af6e4ca",
      "name": "Get first thread",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        944,
        -256
      ]
    },
    {
      "id": "dba88e6c-e555-42d6-b0b6-b02c2f5ef977",
      "name": "Classify",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1168,
        -256
      ]
    },
    {
      "id": "b14e73ba-0046-4395-9e26-f80014a3332a",
      "name": "Update Ticket",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1600,
        -256
      ]
    },
    {
      "id": "62d15c70-77fb-4947-a808-29e0c366e957",
      "name": "Fetch All Tickets",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        -256
      ]
    },
    {
      "id": "4e551054-ffb2-4d4b-ba37-3b24045c9971",
      "name": "Split Tickets",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        272,
        -256
      ]
    },
    {
      "id": "8e29f267-2cae-4429-8914-a58487d45840",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -784
      ],
      "parameters": {
        "width": 368,
        "height": 480,
        "content": "## 🎯 WORKFLOW PURPOSE\n\nAutomatically classifies Zoho Desk tickets using AI based on their title and content.\nProcesses all unclassified tickets in batches.\n"
      }
    },
    {
      "id": "4b6d79df-3535-4d37-b959-64f5642817eb",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -784
      ],
      "parameters": {
        "width": 368,
        "height": 480,
        "content": "## 📥 FETCH TICKETS WITH PAGINATION\n- Retrieves 100 tickets per page\n- Automatically paginates through ALL results\n- Sorted by creation time\n\n## 🔐 OAUTH2 SETUP\nSetting up OAuth2 with Zoho can be tricky"
      }
    },
    {
      "id": "a019181e-7023-4002-b106-2635cf4ccf3d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -784
      ],
      "parameters": {
        "width": 320,
        "height": 480,
        "content": "## 🔍 FILTER LOGIC\nOnly processes tickets where 'classification' is empty/null.\nPrevents re-processing already classified tickets.\n\n## 💡 ALTERNATIVE APPROACH\nYou can filter directly in the API using qu"
      }
    },
    {
      "id": "33dbe4e2-6f94-41f9-bc39-2b57c3df728e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -784
      ],
      "parameters": {
        "width": 368,
        "height": 480,
        "content": "## 🤖 AI CLASSIFICATION CATEGORIES\n• Content\n• Contract\n• Invoice\n• Featured Products\n• Affiliate-Partner\n• Bug\n• Feature\n• Other\n\n## ✏️ CUSTOMIZE FOR YOUR USE CASE\nChange these categories to match you"
      }
    },
    {
      "id": "57d25075-78d6-42cc-8415-9a51c8c7883e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -512
      ],
      "parameters": {
        "width": 272,
        "height": 208,
        "content": "## 💾 SAVE CLASSIFICATION\nUpdates the Zoho Desk ticket with the AI-generated classification.\nError handling enabled to continue processing other tickets if one fails.\n"
      }
    }
  ],
  "connections": {
    "Classify": {
      "main": [
        [
          {
            "node": "Update Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get threads": {
      "main": [
        [
          {
            "node": "Get first thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Tickets": {
      "main": [
        [
          {
            "node": "Filter classification = null",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get first thread": {
      "main": [
        [
          {
            "node": "Classify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Tickets": {
      "main": [
        [
          {
            "node": "Split Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Filter classification = null": {
      "main": [
        [
          {
            "node": "Get threads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch All Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}