FlowX.AI 5.6.0 introduces a dedicated Intent Classification node that combines classification and routing in a single node. The pattern below (using TEXT_UNDERSTANDING + Condition) remains valid for advanced scenarios like confidence-based routing or multi-label classification.
When to use
Use this pattern when your workflow must handle multiple types of user input and respond differently depending on what the user wants. Intent classification is the foundation of any conversational AI app on FlowX — it determines what happens next. Common scenarios:- A chatbot that must distinguish greetings from product inquiries from data submissions
- An email triage pipeline that routes messages to different processing branches
- Any multi-turn conversation where the next step depends on user intent
Architecture
The pattern follows a detect-then-route structure:Implementation
1. Configure the TEXT_UNDERSTANDING node
Add a TEXT_UNDERSTANDING node to your workflow. This node sends the user message to an LLM with a classification prompt and enforces a structured response via a Response Schema.Prompt
The prompt should instruct the LLM to classify the input into one of your defined intent categories. Be explicit about the categories and expected output format.Response Schema
Define a Response Schema on the TEXT_UNDERSTANDING node to enforce structured output. This guarantees the LLM returns valid JSON matching your expected shape.Configuration summary
| Setting | Value |
|---|---|
| Node type | TEXT_UNDERSTANDING |
| Input | User message (from Chat Input node or upstream variable) |
| Output key | Configure an output key (e.g., routesKey) to store the classification result |
| Response Schema | JSON schema as shown above |
| Temperature | 0 or very low — classification should be deterministic |
2. Configure the Condition node
After the TEXT_UNDERSTANDING node, add a Condition node to fork the workflow based on the detected intent. Each branch uses a Python expression that evaluates toTrue or False.
Condition expressions
Use substring matching with thein operator for resilience. This handles cases where the LLM wraps the intent in extra whitespace or slightly different formatting.
Condition node summary
| Branch | Expression | Routes to |
|---|---|---|
| Greeting | "GREETING" in str(input.get("routesKey", {}).get("output", {}).get("detected_intent", "")) | Greeting handler |
| Product inquiry | "PRODUCT_OFFER" in str(input.get("routesKey", {}).get("output", {}).get("detected_intent", "")) | Product info handler |
| Data input | "DATA_INPUT" in str(input.get("routesKey", {}).get("output", {}).get("detected_intent", "")) | Data processing handler |
| Fallback | Default branch | Generic response or clarification prompt |
3. Build handler branches
Each handler branch is a self-contained sub-workflow tailored to the classified intent. Examples:- Greeting handler — responds with a welcome message or continues small talk using a text generation node
- Product inquiry handler — queries a knowledge base (see the Knowledge base RAG pattern) and returns product information
- Data input handler — validates and stores user-provided data, then confirms receipt
- Fallback handler — asks the user to rephrase or provides a generic help message
Real-world example
The Mortgage advisor chatbot tutorial implements this pattern as its core routing mechanism. User messages are classified into intents such as greeting, product inquiry (mortgage offers), data submission (income, employment), and general questions — then routed to specialized handlers that combine knowledge base lookups, financial calculations, and conversational responses.Variations
Binary classification
When you only need to distinguish between two outcomes (e.g., yes/no, relevant/irrelevant), simplify the schema to a single boolean or two-value enum. Use a single Condition branch instead of multiple forks.Multi-label classification
Some inputs may belong to multiple categories simultaneously (e.g., a message that both provides data and asks a question). Modify the schema to return an array of intents, and use a ForEach or parallel branching strategy to handle each detected intent.Confidence-based routing
Add a confidence threshold check before routing. If the confidence score falls below a threshold (e.g., 0.7), route to a human review queue or ask the user to clarify instead of proceeding with low-confidence automation.Related resources
AI patterns overview
All available patterns and how to combine them
AI node types
Reference for TEXT_UNDERSTANDING and other node types
Mortgage advisor tutorial
End-to-end implementation using intent classification
Conversational workflows
Multi-turn chat with session memory and intent routing

