This workflow corresponds to n8n.io template #4047 — we link there as the canonical source.
This workflow follows the Agent → 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 →
{
"id": "i8gsrw37GcVGRJZl",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "\ud83e\udd16 Taxi Service Provider",
"tags": [
{
"id": "no8Mb078mvRgw7PS",
"name": "DEMO",
"createdAt": "2025-04-30T05:34:10.330Z",
"updatedAt": "2025-04-30T05:34:10.330Z"
},
{
"id": "HkWjtKABHywZbLBH",
"name": "Provider",
"createdAt": "2025-05-01T17:04:09.852Z",
"updatedAt": "2025-05-01T17:04:09.852Z"
}
],
"nodes": [
{
"id": "33853542-a6d4-4d1f-9f8c-3e932a75dc80",
"name": "Flow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-3420,
340
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "2279a1b4-9e71-44e9-82dd-642d11067985",
"name": "Input",
"type": "n8n-nodes-base.set",
"notes": "provider_no: test",
"position": [
-3200,
340
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 3.4
},
{
"id": "b533fd57-6652-4cd0-a056-e5e07a5c9792",
"name": "Test Trigger",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-3420,
540
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "b01750d1-3cd7-4a88-802d-46b5c6a330ed",
"name": "Test Fields",
"type": "n8n-nodes-base.set",
"notes": "service_no: test",
"position": [
-3200,
540
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 3.4
},
{
"id": "854b7943-176e-4d25-8d7e-d31e468788a7",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"onError": "continueErrorOutput",
"position": [
-1520,
260
],
"parameters": {},
"typeVersion": 1.9
},
{
"id": "972e9699-1041-4a22-b698-c353c4cc3b9b",
"name": "Code",
"type": "n8n-nodes-base.code",
"onError": "continueErrorOutput",
"position": [
-1140,
240
],
"parameters": {},
"executeOnce": false,
"typeVersion": 2
},
{
"id": "7ae20b2c-b8ff-4d79-95a8-69a57a5b8d12",
"name": "xAI @grok-2-1212",
"type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
"position": [
-1640,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "42155bbd-0637-4d5c-9f98-318a8fb85137",
"name": "Create Booking Data",
"type": "n8n-nodes-base.postgresTool",
"position": [
-1340,
520
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "fa91d89e-e7a5-49ce-9785-741324b04d82",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3740,
280
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "17c9399a-3edc-4178-b11f-cf1c140962a6",
"name": "Provider Number",
"type": "n8n-nodes-base.redis",
"notes": "{session_id}:service:providers TTL 5m",
"position": [
-1720,
260
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "10af93f1-1fc0-42c4-8a2c-d1218cca5261",
"name": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
-1180,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0c1af92d-b06f-4131-a915-c52c7b376db6",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2960,
220
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "49c5fae8-e8fd-48ff-9b46-e7ead2143f08",
"name": "If Active",
"type": "n8n-nodes-base.if",
"position": [
-2280,
620
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "cef93e89-5fc9-43c8-b439-de662546b85c",
"name": "Provider Cache",
"type": "n8n-nodes-base.redis",
"notes": "TTL 15m service:{channel_no}:{service_no}:data",
"onError": "continueRegularOutput",
"position": [
-2760,
340
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "489cdc19-baf9-4d76-ae07-6635f32ed1cd",
"name": "Load Provider Data",
"type": "n8n-nodes-base.postgres",
"onError": "continueRegularOutput",
"position": [
-2280,
420
],
"parameters": {},
"executeOnce": true,
"typeVersion": 2.6,
"alwaysOutputData": true
},
{
"id": "0a1712ce-77b2-4727-8655-b2a984cdbe42",
"name": "Save Provider Cache",
"type": "n8n-nodes-base.redis",
"notes": "TTL 15m",
"onError": "continueRegularOutput",
"position": [
-2000,
600
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "6fa2bb5c-001e-4990-8988-3be5c5b66c51",
"name": "Parse Provider",
"type": "n8n-nodes-base.code",
"position": [
-2280,
260
],
"parameters": {},
"typeVersion": 2
},
{
"id": "86059a88-4e06-4902-abad-90e2326191b1",
"name": "Provider",
"type": "n8n-nodes-base.set",
"position": [
-2000,
260
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "fd44c532-6185-4377-8c18-ecc2275f4eb2",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1800,
900
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "d038d1b6-f288-4f85-9b3c-fc0b31cf80c8",
"name": "Error Output1",
"type": "n8n-nodes-base.set",
"notes": "Please retry.",
"position": [
-320,
1000
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 3.4
},
{
"id": "c6644e68-d8c0-4007-a19f-c3784d00971a",
"name": "If Score",
"type": "n8n-nodes-base.if",
"position": [
-540,
180
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "d625bb63-34db-4b75-a67f-71f878b7d095",
"name": "Output w/ Score",
"type": "n8n-nodes-base.set",
"position": [
-240,
120
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "1889ebcf-d231-4e8c-9877-e282591c19ba",
"name": "Output w/o Score",
"type": "n8n-nodes-base.set",
"position": [
-240,
300
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "3cfe653d-efde-4479-a89d-09c460218cc0",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-620,
40
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "619c94e8-6d93-49d6-8540-13d01d7cda79",
"name": "If Valid?",
"type": "n8n-nodes-base.if",
"position": [
-880,
200
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "6b039236-37f7-4aab-86d4-bcd540f8e43c",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-960,
40
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "8e82564f-61a3-45d7-a43f-142ad0d5b06b",
"name": "Test Output",
"type": "n8n-nodes-base.set",
"position": [
-320,
640
],
"parameters": {},
"notesInFlow": false,
"typeVersion": 3.4
},
{
"id": "94d7a371-a6de-44eb-a50c-665b0bf60d48",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
540
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "9690413c-c097-463c-99d8-83f13f301e94",
"name": "Call Back",
"type": "n8n-nodes-base.executeWorkflow",
"notes": "Demo Call Back",
"position": [
140,
120
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 1.2
},
{
"id": "a8f96f00-9f5b-4e06-bb9d-ac36f0504e05",
"name": "Provider Cache Switch",
"type": "n8n-nodes-base.switch",
"notes": "NO CACHE FOR demo",
"position": [
-2560,
340
],
"parameters": {},
"notesInFlow": true,
"typeVersion": 3.2
}
],
"active": false,
"settings": {
"timezone": "Etc/UTC",
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "vuso7W8t402BPcT2",
"executionOrder": "v1"
},
"versionId": "28fad365-85a7-4c8e-ae98-fb93f1a91d60",
"connections": {
"Code": {
"main": [
[
{
"node": "If Valid?",
"type": "main",
"index": 0
}
],
[
{
"node": "Error Output1",
"type": "main",
"index": 0
}
]
]
},
"Input": {
"main": [
[
{
"node": "Provider Cache",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
],
[
{
"node": "Error Output1",
"type": "main",
"index": 0
}
]
]
},
"If Score": {
"main": [
[
{
"node": "Output w/ Score",
"type": "main",
"index": 0
}
],
[
{
"node": "Output w/o Score",
"type": "main",
"index": 0
}
]
]
},
"Provider": {
"main": [
[
{
"node": "Provider Number",
"type": "main",
"index": 0
}
]
]
},
"If Active": {
"main": [
[
{
"node": "Save Provider Cache",
"type": "main",
"index": 0
}
],
[
{
"node": "Test Output",
"type": "main",
"index": 0
}
]
]
},
"If Valid?": {
"main": [
[
{
"node": "If Score",
"type": "main",
"index": 0
}
],
[
{
"node": "Test Output",
"type": "main",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Test Fields": {
"main": [
[
{
"node": "Input",
"type": "main",
"index": 0
}
]
]
},
"Flow Trigger": {
"main": [
[
{
"node": "Input",
"type": "main",
"index": 0
}
]
]
},
"Test Trigger": {
"main": [
[
{
"node": "Test Fields",
"type": "main",
"index": 0
}
]
]
},
"Error Output1": {
"main": [
[
{
"node": "Call Back",
"type": "main",
"index": 0
}
]
]
},
"Parse Provider": {
"main": [
[
{
"node": "Provider",
"type": "main",
"index": 0
}
]
]
},
"Provider Cache": {
"main": [
[
{
"node": "Provider Cache Switch",
"type": "main",
"index": 0
}
]
]
},
"Output w/ Score": {
"main": [
[
{
"node": "Call Back",
"type": "main",
"index": 0
}
]
]
},
"Provider Number": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Output w/o Score": {
"main": [
[
{
"node": "Call Back",
"type": "main",
"index": 0
}
]
]
},
"xAI @grok-2-1212": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Load Provider Data": {
"main": [
[
{
"node": "If Active",
"type": "main",
"index": 0
}
]
]
},
"Create Booking Data": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Save Provider Cache": {
"main": [
[
{
"node": "Provider",
"type": "main",
"index": 0
}
]
]
},
"Provider Cache Switch": {
"main": [
[
{
"node": "Parse Provider",
"type": "main",
"index": 0
}
],
[
{
"node": "Parse Provider",
"type": "main",
"index": 0
}
],
[
{
"node": "Load Provider Data",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Template was created in n8n v1.90.2 Execute Sub-workflow Trigger node Chat Trigger node Redis node Postgres node AI Agent node Calculator node If node, Switch node, Code node, Edit Fields (Set) Execute Sub-workflow Trigger: Taxi Service Workflow (or your own node) Sub-workflow:…
Source: https://n8n.io/workflows/4047/ — 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.
Template was created in n8n v1.90.2 Execute Sub-workflow Trigger node Chat Trigger node Redis node Postgres node AI Agent node If node, Switch node, Code node, Edit Fields (Set) Execute Sub-workflow T
Template was created in n8n v1.90.2 Execute Sub-workflow Trigger node Chat Trigger node Redis node Postgres node AI Agent node If node, Switch node, Code node, Edit Fields (Set) Execute Sub-workflow T
Ask your PostgreSQL database complex questions and receive clear summaries, charts, and even update or insert data — all through one smart agent powered by n8n’s Model Context Protocol (MCP).
Enable AI-driven conversations with your PostgreSQL database using a secure and visual-free agent powered by n8n’s Model Context Protocol (MCP). This template allows users to ask multiple KPIs in a si
Transform your WhatsApp into a powerful personal finance command center. This AI-powered workflow converts natural language messages into structured financial data, automates record-keeping, and deliv