Client Context
Customer support for a live ecommerce catalog required operators to interpret multilingual messages, extract requirements, query WooCommerce, and respond consistently—not sustainable at higher volume.
The Challenge
Before
Humans in the loop for every thread: slow at peaks, inconsistent tone, and training-heavy.
Better
Automation had to combine LLM flexibility with strict guards—no runaway searches, no duplicate processing, no silent failures.
- English, Macedonian, Albanian traffic in one funnel
- WooCommerce failures (401, timeouts, odd shapes) are normal at scale
- Abuse and duplicate webhooks can starve workers
The architecture prioritizes defensive exits, structured model outputs, and observable state.
Solution Architecture
n8n orchestration with verified webhooks, dedupe, and execution budgeting before AI spend.
OpenRouter (Gemini 2.5 Flash) for language detection, intent, and JSON-schema-shaped extractions.
Deterministic routing: conversational replies vs follow-up questions vs SKU-style search vs widened tolerance search.
WooCommerce REST integration with normalization across array/single/empty payloads and user-safe fallbacks.
Key Implementation Decisions
Structured outputs before backend calls
Never search without validated, complete inputs—saves API cost and reduces garbage queries.
Hybrid AI + code
LLM handles nuance; code enforces business rules, retries, caps, and messaging safety.
Sliding conversation memory
Last N messages for continuity without unbounded storage growth.
Ranking layer over raw SKUs
Business heuristics (stock, category fit, tolerances) before natural-language response generation.
Operational Impact
- Operators focus on edge cases instead of repetitive product matching.
- Faster median response time during peak message volume.
- More consistent customer-facing tone with fewer dead-end loops.
Results
- ≈40% reduction in manual handling for the targeted workflow.
- Near-zero downtime design with graceful degradation paths.
- Multilingual coverage without separate manual triage per language.
- Maintainable workflows visible to technical stakeholders—not opaque scripts only.
Technology Stack
- Orchestration
- n8n (self-hosted), JavaScript code nodes
- AI
- OpenRouter — Gemini 2.5 Flash
- Commerce
- WooCommerce REST API
- Channel
- Facebook Messenger webhooks