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.
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. |
Step 2 - Write or Update the Prompt
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. |
Advanced Options for Each Input
-
Required / Optional
- Choose whether this input must be provided (
Required
) or can be skipped (Optional
). - If you set it to
Optional
, and no value is provided at runtime, the model will receive an empty value for that input variable.
- Choose whether this input must be provided (
-
Color Label
- Click the color swatch to pick a hex code (for example
#F35063
) that helps visually organize inputs on the workflow canvas. - This is purely for organizational clarity... colors do not affect model behavior.
- Click the color swatch to pick a hex code (for example
-
Default Value
- If no value is supplied by the user or upstream component, the model will use whatever you enter here.
- Useful if you want to ensure the prompt always has at least a placeholder (for example
"No message provided"
).
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
- Click + Outputs on the Classifier card to open the Add Output dialog.
- In Output Name, type
support
. - (Optional) In Description, type “Customer support requests, including troubleshooting or technical issues.”
- (Optional) In Expression, leave blank if you don’t need extra filtering logic.
- Click the color swatch and choose a hex value like
#3C89F9
. - Click Create.
- You will now see “support” appear in the Categories list on the Classifier node. It will use the color you picked. Repeat these steps to add as many categories (outputs) as you need.
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"
}
]
Step 6 - Debug and Preview
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
What to Try Next
- Combine with Agent Skill to classify natural user queries
- Store classifications in RAG Remember to build memory or logs