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": "Sensor Chatbot",
"nodes": [
{
"parameters": {
"public": true,
"allowFileUploads": false,
"options": {}
},
"id": "node-chat-trigger",
"name": "Chat Trigger",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
240,
300
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "cond-temp",
"leftValue": "={{ $json.chatInput }}",
"rightValue": "\uc628\ub3c4",
"operator": {
"type": "string",
"operation": "contains",
"name": "filter.operator.contains"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "\uc628\ub3c4"
},
{
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "cond-humid",
"leftValue": "={{ $json.chatInput }}",
"rightValue": "\uc2b5\ub3c4",
"operator": {
"type": "string",
"operation": "contains",
"name": "filter.operator.contains"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "\uc2b5\ub3c4"
},
{
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "cond-press",
"leftValue": "={{ $json.chatInput }}",
"rightValue": "\uae30\uc555",
"operator": {
"type": "string",
"operation": "contains",
"name": "filter.operator.contains"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "\uae30\uc555"
},
{
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "cond-recent",
"leftValue": "={{ $json.chatInput }}",
"rightValue": "\ucd5c\uadfc",
"operator": {
"type": "string",
"operation": "contains",
"name": "filter.operator.contains"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "\ucd5c\uadfc"
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"id": "node-switch",
"name": "Route by Keyword",
"type": "n8n-nodes-base.switch",
"typeVersion": 3,
"position": [
460,
300
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT temperature, recorded_at FROM sensor_data ORDER BY recorded_at DESC LIMIT 1;"
},
"id": "node-pg-temp",
"name": "Query \uc628\ub3c4",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
680,
120
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT humidity, recorded_at FROM sensor_data ORDER BY recorded_at DESC LIMIT 1;"
},
"id": "node-pg-humid",
"name": "Query \uc2b5\ub3c4",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
680,
240
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT pressure, recorded_at FROM sensor_data ORDER BY recorded_at DESC LIMIT 1;"
},
"id": "node-pg-press",
"name": "Query \uae30\uc555",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
680,
360
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT temperature, humidity, pressure, recorded_at FROM sensor_data ORDER BY recorded_at DESC LIMIT 5;"
},
"id": "node-pg-recent",
"name": "Query \ucd5c\uadfc",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
680,
480
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const row = $input.first().json;\nconst t = parseFloat(row.temperature).toFixed(1);\nconst time = new Date(row.recorded_at).toLocaleString('ko-KR', {timeZone:'Asia/Seoul'});\nreturn [{ json: { output: `\ud604\uc7ac \uc628\ub3c4\ub294 ${t}\u00b0C \uc785\ub2c8\ub2e4. (\uce21\uc815 \uc2dc\uac04: ${time})` } }];"
},
"id": "node-code-temp",
"name": "Reply \uc628\ub3c4",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
120
]
},
{
"parameters": {
"jsCode": "const row = $input.first().json;\nconst h = parseFloat(row.humidity).toFixed(1);\nconst time = new Date(row.recorded_at).toLocaleString('ko-KR', {timeZone:'Asia/Seoul'});\nreturn [{ json: { output: `\ud604\uc7ac \uc2b5\ub3c4\ub294 ${h}% \uc785\ub2c8\ub2e4. (\uce21\uc815 \uc2dc\uac04: ${time})` } }];"
},
"id": "node-code-humid",
"name": "Reply \uc2b5\ub3c4",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
240
]
},
{
"parameters": {
"jsCode": "const row = $input.first().json;\nconst p = parseFloat(row.pressure).toFixed(1);\nconst time = new Date(row.recorded_at).toLocaleString('ko-KR', {timeZone:'Asia/Seoul'});\nreturn [{ json: { output: `\ud604\uc7ac \uae30\uc555\uc740 ${p}hPa \uc785\ub2c8\ub2e4. (\uce21\uc815 \uc2dc\uac04: ${time})` } }];"
},
"id": "node-code-press",
"name": "Reply \uae30\uc555",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
360
]
},
{
"parameters": {
"jsCode": "const rows = $input.all();\nlet result = '\ucd5c\uadfc 5\uac74\uc758 \uc13c\uc11c \ub370\uc774\ud130:\\n';\nrows.forEach((item, i) => {\n const d = item.json;\n const t = parseFloat(d.temperature).toFixed(1);\n const h = parseFloat(d.humidity).toFixed(1);\n const p = parseFloat(d.pressure).toFixed(1);\n const time = new Date(d.recorded_at).toLocaleString('ko-KR', {timeZone:'Asia/Seoul'});\n result += `${i+1}. \uc628\ub3c4: ${t}\u00b0C | \uc2b5\ub3c4: ${h}% | \uae30\uc555: ${p}hPa (${time})\\n`;\n});\nreturn [{ json: { output: result.trim() } }];"
},
"id": "node-code-recent",
"name": "Reply \ucd5c\uadfc",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
480
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "assign-default",
"name": "output",
"value": "\uc628\ub3c4, \uc2b5\ub3c4, \uae30\uc555, \ucd5c\uadfc \uc911 \ud558\ub098\ub97c \ubb3c\uc5b4\ubcf4\uc138\uc694.\n\uc608\uc2dc: '\uc9c0\uae08 \uc628\ub3c4 \uc54c\ub824\uc918', '\uc2b5\ub3c4\ub294?', '\ucd5c\uadfc \ub370\uc774\ud130 \ubcf4\uc5ec\uc918'",
"type": "string"
}
]
},
"options": {}
},
"id": "node-default",
"name": "Default Reply",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
680,
600
]
}
],
"connections": {
"Chat Trigger": {
"main": [
[
{
"node": "Route by Keyword",
"type": "main",
"index": 0
}
]
]
},
"Route by Keyword": {
"main": [
[
{
"node": "Query \uc628\ub3c4",
"type": "main",
"index": 0
}
],
[
{
"node": "Query \uc2b5\ub3c4",
"type": "main",
"index": 0
}
],
[
{
"node": "Query \uae30\uc555",
"type": "main",
"index": 0
}
],
[
{
"node": "Query \ucd5c\uadfc",
"type": "main",
"index": 0
}
],
[
{
"node": "Default Reply",
"type": "main",
"index": 0
}
]
]
},
"Query \uc628\ub3c4": {
"main": [
[
{
"node": "Reply \uc628\ub3c4",
"type": "main",
"index": 0
}
]
]
},
"Query \uc2b5\ub3c4": {
"main": [
[
{
"node": "Reply \uc2b5\ub3c4",
"type": "main",
"index": 0
}
]
]
},
"Query \uae30\uc555": {
"main": [
[
{
"node": "Reply \uae30\uc555",
"type": "main",
"index": 0
}
]
]
},
"Query \ucd5c\uadfc": {
"main": [
[
{
"node": "Reply \ucd5c\uadfc",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Sensor Chatbot. Uses chatTrigger, postgres. Chat trigger; 11 nodes.
Source: https://github.com/Userlsj-project/docker_n8n_sensor/blob/ea44301384261128b28a8f5a1a3861e29135b0d2/n8n/chatbot_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.
Template was created in n8n v1.90.2 Execute Sub-workflow Trigger node Chat Trigger node Redis node Postgres node Google Calendar node Execute Sub-workflow If node, Switch node, Code node, Edit Fields
cv-elaborator. Uses chatTrigger, executeWorkflowTrigger, agent, lmChatGoogleGemini. Chat trigger; 18 nodes.
modelo do chatbot. Uses openAi, chatTrigger, memoryPostgresChat, mySqlTool. Chat trigger; 12 nodes.
modelo do chatbot. Uses openAi, chatTrigger, memoryPostgresChat, mySqlTool. Chat trigger; 12 nodes.
modelo do chatbot. Uses openAi, chatTrigger, memoryPostgresChat, mySqlTool. Chat trigger; 12 nodes.