AI-Powered Zoho Desk Ticket Classifier - n8n Workflow

Use this powerful n8n workflow to automatically classify unassigned Zoho Desk support tickets using AI (Gemini via OpenRouter). Features advanced pagination and filtering logic.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Support Managers: Needing automated triage for high volumes of incoming tickets.
Automation Specialists: Seeking sophisticated examples of AI integration within an n8n workflow.
Zoho Desk Users: Who require custom fields (like 'classification') to be populated automatically.
n8n Developers: Looking for n8n templates demonstrating robust API pagination and error handling in an n8n node setup.

Overview

Managing high volumes of support tickets often requires manual effort to correctly assign categories, leading to delays and human error. This comprehensive n8n workflow solves this by fully automating the classification process using AI. This specific n8n workflow demonstrates best practices for integrating third-party AI services (via OpenRouter) with enterprise applications like Zoho Desk.

The automation begins by retrieving all tickets, using precise pagination logic tailored for the Zoho API. It then filters out any tickets that have already been classified, ensuring efficiency. For each remaining ticket, the full thread content is retrieved and passed to the large language model. The core of this solution lies in the chainLlm n8n node, which uses a defined prompt and categorization list to output a single, accurate classification label. Finally, an n8n node updates the ticket in Zoho Desk. This robust n8n workflow serves as an excellent foundation for other complex classification or data enrichment tasks.

How it Works

This n8n workflow operates in a sequential, highly structured manner:


  1. Trigger and Fetch: The process starts with a manual n8n trigger, initiating the batch classification job. The first httpRequest n8n node, 'Fetch All Tickets', uses advanced pagination logic to retrieve all support tickets from the Zoho Desk API in batches of 100.

  2. Split and Filter: The 'Split Tickets' n8n node breaks the batch response into individual tickets. The subsequent 'Filter classification = null' code n8n node ensures that only tickets lacking a classification tag are processed, preventing unnecessary API calls and LLM usage.

  3. Retrieve Content: Two chained httpRequest n8n nodes, 'Get threads' and 'Get first thread', dynamically retrieve the full plain text content of the initial ticket request from the Zoho Desk API, which is essential context for the AI.

  4. AI Classification: The 'Classify' chainLlm n8n node takes the ticket subject and body and sends it to the 'OpenRouter Chat Model' n8n node (configured to use Gemini 2.5 Flash). It uses a defined prompt instructing the AI to select one category (e.g., 'Bug', 'Invoice', 'Content') and return only that single word.

  5. Update Record: The final 'Update Ticket' httpRequest n8n node performs a PUT request to the Zoho Desk API, using the Zoho ticket ID and the AI-generated classification text to update the ticket record. This entire n8n workflow demonstrates seamless data movement between enterprise CRM and external AI services.

Installation Guide

To deploy and utilize this powerful n8n workflow, follow these steps:


  1. Import the n8n Template: Copy the provided JSON code and import it directly into your n8n instance.

  2. Set Up Zoho Desk Credentials: The workflow uses generic OAuth2 credentials for Zoho Desk across multiple httpRequest n8n node instances. You must configure OAuth2 access following Zoho's specific instructions. Ensure the credential name is correctly linked to the four Zoho nodes.

  3. Set Up OpenRouter Credentials: The 'OpenRouter Chat Model' n8n node requires an OpenRouter API Key credential. Configure this credential within your n8n environment and link it to the relevant n8n node.

  4. Customize Categories: Review the prompt in the 'Classify' n8n node and update the list of categories (Content, Contract, Invoice, etc.) to align with your organization’s specific support categories. This is crucial for the success of your specialized n8n templates.

  5. Execute: After setting up credentials, click the 'Execute workflow' n8n trigger to run the classification process.

Node Details

When clicking ‘Execute workflow’ (Manual Trigger): Serves as the starting point, acting as the primary n8n trigger for running the batch job.
Fetch All Tickets (HTTP Request): Responsible for contacting the Zoho Desk search API. Key configuration includes using generic OAuth2 authentication and advanced pagination parameters (e.g., from={{ $pageCount 100 }}) to iterate through all available tickets.
Filter classification = null (Code): A critical n8n node that uses custom JavaScript (filter(item => item.json.classification === null)) to selectively process only unclassified tickets.
Get threads / Get first thread (HTTP Request): These chained n8n nodes perform dynamic lookups using expressions (e.g., {{ $json.data[0].id }}) to retrieve the full, unformatted text of the initial customer request.
OpenRouter Chat Model (LLM Node): The underlying AI service, configured to use the google/gemini-2.5-flash-lite-preview model. This n8n node handles the communication with the LLM API.
Classify (LangChain LLM Chain): This powerful n8n node wraps the LLM call with a detailed, structured prompt. It takes ticket metadata as input and forces the AI to output a clean, single-category response.
Update Ticket (HTTP Request): The final n8n node, executing a PUT request. It uses an expression ({{ $json.text }}) to extract the AI-generated classification and update the classification field on the corresponding Zoho Desk ticket.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Full Stack Developer turned AI & Automation Engineer, implementing intelligent solutions with custom code, LLMs & n8n. Use my link to book a free 30-minute call to discuss your AI challenges and see if my services might be a good fit for your needs.

Featured*