The problem
Traditional chatbots built on decision trees or keyword rules break down fast — any query that doesn't fit the scripted path either gives a wrong answer or dead-ends into "let me connect you to an agent." The goal here was a support agent that could actually reason about the request, not just pattern-match it.
The approach
Built as an agent, not a scripted flow: instead of hardcoding every branch, the LLM is given a defined set of tools (order lookup, ticket creation, knowledge-base search) and decides at runtime which to call and in what order, based on the customer's actual message. N8N orchestrates the workflow — receiving the message, invoking the LLM with the tool definitions, executing whichever tool the model calls, and returning the result — with custom JavaScript nodes handling the data shaping the built-in nodes couldn't.
What it does
- Classifies incoming queries by intent (order status, refund request, general question, complaint) without a rigid keyword list
- Calls the right backend tool for the intent — order lookup, knowledge-base search, or ticket creation — rather than answering from static scripted text
- Drafts a response grounded in the tool's actual result, not a hallucinated guess
- Falls back to human handoff when confidence is low or the query is outside its tool set, instead of guessing
Outcome
Deflects the routine, high-volume queries that don't need a human — status checks, FAQ-style questions — while keeping genuinely ambiguous or sensitive cases routed to a person. The tool-calling design means adding a new capability is adding a new tool, not rewriting a decision tree.