Classifier Component
Use the Classifier component to route unstructured input (for example user messages, logs or email content) into clear, predefined categories using a prompt powered by a language model.
Why this matters
What You’ll Configure
- Choose a Model
- Write or Update the Prompt
- Add Inputs
- Define Output Categories
- Advanced Routing (Optional)
- Debug and Preview
- Best Practices
- Troubleshooting Tips
- What to Try Next
Step 1 - Choose a Model
Field | Required? | Description | Tips |
---|---|---|---|
Model | Yes | The LLM used for classification | By default you will see GPT 4o Mini (SmythOS 128K). You can also choose GPT 4.1 Nano, GPT 4.1 Mini, GPT o1, Claude Sonnet 3.7, Gemini 2.5 Pro, Sonar or other supported engines. |
Custom Model | No | Use your own hosted model or external API | You can connect to OpenAI, Claude, Google AI, Grok, or any endpoint compatible with your workflow. |
Token limits
Step 2 - Write or Update the Prompt
Default Classification Prompt
Classify the {{Input}} content to one of the categories. Set the selected category to true and the others to an empty value.
Make prompts specific
Step 3 - Add Inputs
Field | Required? | Description | Notes |
---|---|---|---|
Input Name | Yes | A descriptive label for the input, for example user_message or email_body . | This name becomes a variable reference in your prompt (use {{InputName}} ). |
Input Type | Yes | The data type of the input value. Options typically include Text , Number , Boolean , Any etc. | Choose Any if you do not need type‐specific validation. |
INFO
Advanced Options for Each Input
Step 4 - Create Outputs
Each Output corresponds to one classification bucket. The model will assign exactly one bucket (set to true
) and leave all others blank. By default, when you first open the Classifier node, no categories are defined... you must click + Outputs to begin defining them.
Field | Required? | Description | Example |
---|---|---|---|
Name | Yes | A unique identifier for this category. | support , sales , critical_alert |
Description | No | A short explanation of what content belongs in this bucket. | “Password reset requests or technical issues.” |
Expression | No | (Advanced) A custom expression that can post‐process or filter which messages go here. Leave blank to rely purely on the LLM. | For example, you could write a JSONPath or Liquid expression to extract a field or to validate the model’s output. |
Color | No | Pick a hex code (for example #3C89F9 ) to color-code this output on the canvas. Helpful when you have many buckets. | Use contrasting colors for easy identification. |
Example: Adding a New Category
Example Output Configuration (JSON)
[
{
"Name": "positive_sentiment",
"Color": "green",
"Description": "Text that shows appreciation, praise or good feedback"
},
{
"Name": "support",
"Color": "#3C89F9",
"Description": "Customer support inquiries or help requests"
},
{
"Name": "escalation",
"Color": "red",
"Description": "Urgent or high-risk issues requiring immediate attention"
}
]
Step 5 - Advanced Routing (Optional)
You can configure each category’s Format or attach downstream logic by using custom expressions, Webhook calls or conditional fields. For example, you might want the “sales” bucket to forward message content to a CRM, while “engineering” sends technical logs to a different queue.
Example: Return Different Formats per Category
[
{
"Name": "sales",
"Description": "Routes message to the sales inbox",
"Format": "text"
},
{
"Name": "engineering",
"Description": "Forwards technical messages to the dev team",
"Format": "json"
},
{
"Name": "marketing",
"Description": "Extracts campaign name from the input",
"Format": "text"
}
]
TIP
Step 6 - Debug and Preview
Live testing
Best Practices
- Use detailed, mutually exclusive descriptions for each output
- Avoid vague labels like "misc" or overlapping categories like “help” and “support”
- Always test edge cases in Debug
- Use fallback categories if you expect unpredictable input
- Stick to consistent naming like
snake_case
orkebab-case
- Validate using real user data if possible
Troubleshooting Tips
If classification doesn’t behave as expected
What to Try Next
- Combine with Agent Skill to classify natural user queries
- Store classifications in RAG Remember to build memory or logs
TIP