Text Classifier

Classify text into categories using an LLM.

Written By pvdyck

Last updated 21 minutes ago

Text Classifier

The Text Classifier uses an LLM to assign input text to one or more predefined categories. Each category becomes a separate output, enabling workflow branching based on classification.

How It Works

You define a list of categories (with optional descriptions). The node sends the input text to the LLM, which classifies it into one of the categories. Each category maps to a separate output connector, so you can wire different downstream logic per category.

Parameters

ParameterDescription
TextThe input text to classify. Supports expressions like {{ $json.message }}.
CategoriesList of classification categories. Each has a Name and optional Description to guide the LLM.
System PromptOptional instructions for classification behavior.
Allow MultipleWhen enabled, the model can assign the text to more than one category. Default: single category.
When No MatchControls what happens when the text doesn't match any category. Discard Item (default): silently drops the item. Output on Extra "Other" Branch: routes unmatched items to a separate "Other" output connector.
Enable Auto-FixingRe-prompts the model if its output doesn't match a valid category, sending the parsing error back to the LLM for correction.

Category Configuration

Each category requires:

  • Name β€” The label (e.g., "Sales", "Support", "Billing").
  • Description β€” (Optional) Helps the LLM understand what belongs in this category.

The node creates one output per category, enabling direct routing in your workflow.

Sub-Node Connections

InputRequiredDescription
AI Language ModelYesThe LLM powering the classification.
Output ParserNoAdditional output formatting.

Example Use Cases

  • Route support tickets to Sales / Support / Billing teams
  • Classify emails by urgency (High / Medium / Low)
  • Tag content by topic (News / Tutorial / Opinion)
  • Sort feedback by product area

Tips

  • Write clear category descriptions β€” "Billing: questions about invoices, payments, refunds" works better than just "Billing".
  • Use Allow Multiple when text may belong to several categories (e.g., a ticket about both billing and a bug).
  • Connect each output to a different downstream workflow branch for automatic routing.
  • For simple positive/negative/neutral classification, consider the Sentiment Analysis node instead.

Related