Classifier
Classify text into custom categories using AI.
Classifier
The Classifier node uses AI to categorize text into predefined categories. Define your categories with descriptions, and the AI will analyze the input and assign the most appropriate category.
Overview
Use the Classifier node when you need to:
- Categorize customer support tickets
- Sort emails by type or priority
- Route content to appropriate handlers
- Tag or label text content automatically
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The AI model to use for classification. |
categories | array | Yes | List of categories to classify into. Must have at least one category. |
includeJustification | boolean | No | When enabled, returns an explanation for why the category was chosen. Default: false. |
Category Configuration
Each category in the categories array has the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier for the category (auto-generated). |
name | string | Yes | The category name (e.g., "bug_report", "feature_request"). |
description | string | Yes | Description of what content belongs in this category. |
Loop Mode
The Classifier node supports Loop Mode for batch classification:
| Field | Type | Default | Description |
|---|---|---|---|
loopMode | boolean | false | Enable to classify each item in an array input separately. |
maxIterations | number | 100 | Maximum number of iterations when loop mode is enabled. |
concurrency | number | 1 | Number of parallel classifications. |
onError | string | "stop" | Error handling: "stop" or "continue". |
Inputs
The Classifier node accepts inputs from connected upstream nodes. All connected inputs are automatically concatenated and analyzed together.
Output
| Variable | Type | Description |
|---|---|---|
category | string | The name of the assigned category. |
justification | string | (Optional) Explanation for the classification. Only present when includeJustification is enabled. |
Example Use Cases
Support Ticket Classification
Categories:
| Name | Description |
|---|---|
bug_report | User is reporting a bug, error, or unexpected behavior in the product |
feature_request | User is requesting a new feature or enhancement |
billing_inquiry | Questions about billing, payments, subscriptions, or pricing |
general_question | General questions about how to use the product |
account_issue | Problems with account access, login, or settings |
Input:
I've been charged twice for my subscription this month. Can you help me get a refund?Output:
{
"category": "billing_inquiry",
"justification": "The user is reporting a duplicate charge and requesting a refund, which is a billing-related issue."
}Content Moderation
Categories:
| Name | Description |
|---|---|
appropriate | Content is suitable and follows community guidelines |
spam | Content is promotional, repetitive, or unsolicited advertising |
offensive | Content contains inappropriate language or harmful material |
off_topic | Content is unrelated to the discussion or platform purpose |
Email Priority Classification
Categories:
| Name | Description |
|---|---|
urgent | Time-sensitive matters requiring immediate attention |
high | Important items that should be addressed within 24 hours |
normal | Regular correspondence with standard response time |
low | Informational or FYI emails that don't require action |
Best Practices
-
Write detailed category descriptions: The AI relies on descriptions to understand the boundaries between categories. Be specific about what belongs (and doesn't belong) in each category.
-
Use mutually exclusive categories: Avoid overlap between categories to improve classification accuracy.
-
Keep category names simple: Use clear, lowercase names with underscores (e.g.,
feature_requestnotFeature Request!!!). -
Enable justification for debugging: When building or testing your workflow, enable
includeJustificationto understand why classifications are made. -
Consider edge cases: Include categories for unclear or borderline content (e.g.,
"other"or"needs_review"). -
Test with diverse inputs: Verify classification works correctly with various input formats and edge cases.