This workflow follows the Chainllm → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Shopping App Action Classifier - Ollama",
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
-80,
300
],
"id": "chat-1",
"name": "When chat message received"
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.chatInput }}",
"hasOutputParser": true,
"messages": {
"messageValues": [
{
"message": "Classify the customer message into exactly one action: product_search, order_track, support_ticket, or hang_to_human. Detect the primary language as Eng or Th. Return only the structured result."
}
]
},
"batching": {}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.9,
"position": [
260,
300
],
"id": "llm-1",
"name": "Classify Customer Message"
},
{
"parameters": {
"model": "qwen3:8b",
"options": {
"temperature": 0,
"keepAlive": "30m"
}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"typeVersion": 1,
"position": [
180,
520
],
"id": "model-1",
"name": "Ollama Chat Model"
},
{
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"action\": { \"type\": \"string\", \"enum\": [\"product_search\", \"order_track\", \"support_ticket\", \"hang_to_human\"] },\n \"language\": { \"type\": \"string\", \"enum\": [\"Eng\", \"Th\"] }\n },\n \"required\": [\"action\", \"language\"],\n \"additionalProperties\": false\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.3,
"position": [
480,
520
],
"id": "parser-1",
"name": "Structured Output Parser"
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={{ $json.output }}",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
600,
300
],
"id": "set-1",
"name": "Extract Pure JSON"
},
{
"parameters": {
"mode": "expression",
"output": "={{ ['product_search','order_track','support_ticket','hang_to_human'].indexOf($json.action) }}",
"looseTypeValidation": true
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.4,
"position": [
860,
300
],
"id": "switch-1",
"name": "Route by Action"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1160,
60
],
"id": "noop-1",
"name": "PRODUCT SEARCH - Replace with Product Tool"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1160,
220
],
"id": "noop-2",
"name": "ORDER TRACK - Replace with Order Tool"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1160,
380
],
"id": "noop-3",
"name": "SUPPORT TICKET - Replace with Ticket Tool"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1160,
540
],
"id": "noop-4",
"name": "HANG TO HUMAN - Replace with Human Handoff"
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "Classify Customer Message",
"type": "main",
"index": 0
}
]
]
},
"Classify Customer Message": {
"main": [
[
{
"node": "Extract Pure JSON",
"type": "main",
"index": 0
}
]
]
},
"Ollama Chat Model": {
"ai_languageModel": [
[
{
"node": "Classify Customer Message",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Classify Customer Message",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Extract Pure JSON": {
"main": [
[
{
"node": "Route by Action",
"type": "main",
"index": 0
}
]
]
},
"Route by Action": {
"main": [
[
{
"node": "PRODUCT SEARCH - Replace with Product Tool",
"type": "main",
"index": 0
}
],
[
{
"node": "ORDER TRACK - Replace with Order Tool",
"type": "main",
"index": 0
}
],
[
{
"node": "SUPPORT TICKET - Replace with Ticket Tool",
"type": "main",
"index": 0
}
],
[
{
"node": "HANG TO HUMAN - Replace with Human Handoff",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Shopping App Action Classifier - Ollama. Uses chatTrigger, chainLlm, lmChatOllama, outputParserStructured. Chat trigger; 10 nodes.
Source: https://github.com/mobizmad/n8n-workflow-templates/blob/main/shopping/shopping-app-action-classifier/workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Becomex v2. Uses chatTrigger, lmChatOllama, agent, toolWorkflow. Chat trigger; 17 nodes.
This workflow shows how to use a self-hosted Large Language Model (LLM) with n8n's LangChain integration to extract personal information from user input. This is particularly useful for enterprise env
This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system a
Perform comprehensive research on a user's query by dynamically generating search terms, querying the web using Google Search (by Gemini) , reflecting on the results to identify knowledge gaps, and it
AI Comprehensive Research on User's Query (reproduction of gemini-fullstack-langgraph-quickstart). Uses lmChatGoogleGemini, outputParserStructured, chainLlm, redis. Chat trigger; 37 nodes.