I recently built an end-to-end AI-powered triage pipeline designed to turn unstructured inbound requests—like messy support emails and web forms—into structured, actionable data for downstream teams.
Instead of just a simple “prompt and response,” I engineered a multi-step agentic workflow focused on reliability and system design.
The Tech Stack:
Orchestration: n8n (self-hosted via Docker) for the workflow logic and state management.
Inference: Ollama for running local LLMs, ensuring data privacy and zero API latency.
Storage: Integrated with [Google Sheets/Airtable] for structured output and escalation queues.
The Engineering Workflow:
Ingestion: Automated triggers for raw, unstructured B2B messages.
Deterministic Classification: Using Ollama to assign categories (Bug, Billing, Incident) and priority levels with a confidence score.
Entity Extraction: Structuring key identifiers like Account IDs, Invoice numbers, and error codes into clean JSON.
Agentic Routing & Fail-safes: I built logic to map classifications to specific department queues.
Human-in-the-loop (HITL): Implemented an automated escalation flag. If the model’s confidence drops below 70% or detects high-stakes keywords (like “outage” or “billing error > $500”), the system bypasses standard routing and alerts a human reviewer.
The Takeaway:
The real challenge wasn’t just getting the AI to “understand” the text—it was building the routing logic and error handling to ensure the system remains reliable at scale. Moving from a “black box” prompt to a transparent, structured pipeline is where the real value lies for any high-volume business process.
hashtag#AIEngineering hashtag#n8n hashtag#Ollama hashtag#Docker hashtag#SelfHosted hashtag#AgenticAI hashtag#WorkflowAutomation **hashtag#SystemDesign
You can check out the project and a screenshot of it on my linkedin** Building Self-Hosted AI Workflow with n8n & Ollama | kevork lepedjian posted on the topic | LinkedIn
