TemperatureAnalzyer
Take a temperature reading and to recommend clothing fitting for the temperature.
Shared 9/8/2025
345 views
Visual Workflow
JSON Code
{
"id": "6h90qNuOeRYmJH5d",
"meta": {
"instanceId": "274f1e029771ddf1edd3aa5ab1bcc762247c497e0eaf6b9ef0a118d13388049e",
"templateId": "self-building-ai-agent",
"templateCredsSetupCompleted": true
},
"name": "TemperatureAnalzyer",
"tags": [],
"nodes": [
{
"id": "680ba61c-07f5-4101-9e4e-28501d474263",
"name": "Basic LLM Chain",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1280,
256
],
"parameters": {
"text": "=The temperature currently is {{ $('Read Temperature').item.json.temperature.toFixed(1) }}°C.\nWrite a recommendation what to wear depending on the current temperature. Give a suggestion for what to wear that is well suited for the current temperature.\n\nBe creative and avoid giving standard clothing tips that are common, instead give exotic clothing ideas taking inspriration from different cultures and countries, that for example have a similar temperature.\n\nAvoid giving the same recommendation multiple times. Ensure to use alternative clothing styles compared to: \n{{ JSON.stringify($json.parsedmessages[0].lastmessages) }}",
"batching": {},
"messages": {
"messageValues": [
{
"message": "You are a fashion expert specialized in recommending clothing to wear for the day."
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"retryOnFail": true,
"typeVersion": 1.7
},
{
"id": "72265b3a-68f7-48d6-8ac9-d8f98714de59",
"name": "Ollama Model",
"type": "@n8n/n8n-nodes-langchain.lmOllama",
"position": [
1280,
432
],
"parameters": {
"model": "hf.co/tensorblock/mlx-community_Qwen3-4B-bf16-GGUF:Q4_K_M",
"options": {}
},
"credentials": {
"ollamaApi": {
"id": "XXXX",
"name": "Ollama account"
}
},
"typeVersion": 1
},
{
"id": "9237a08e-f7cb-4f2b-b55d-f108182f1e31",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1424,
432
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"thinking\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"recommendation\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
},
"typeVersion": 1.3
},
{
"id": "22cd2ccf-b218-4b20-9157-ffff8b06eb11",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
448,
256
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "9569af50-00b5-4c1d-826c-4534636ba012",
"name": "Send a text message",
"type": "n8n-nodes-base.telegram",
"position": [
2096,
256
],
"webhookId": "6b275a7a-fe41-4da8-952e-75c52b421269",
"parameters": {
"text": "=Clothing recommendation based on the current temperature of {{ $('Read Temperature').item.json.temperature.toFixed(1) }}°C: {{ $('Basic LLM Chain').item.json.output.recommendation }}",
"chatId": "XXX",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "XXX",
"name": "Telegram account"
}
},
"typeVersion": 1.2,
"alwaysOutputData": true
},
{
"id": "5babdcc6-e38d-4aab-ba53-1e2d2ffc7a95",
"name": "Add Filename",
"type": "n8n-nodes-base.set",
"position": [
768,
256
],
"parameters": {
"mode": "raw",
"options": {},
"jsonOutput": "{\n \"filename\": \"lastmessage.json\"\n}\n"
},
"typeVersion": 3.4
},
{
"id": "b3174a74-2438-465d-9bce-b2450a85bc3d",
"name": "Read Temperature",
"type": "n8n-nodes-base.httpRequest",
"position": [
608,
256
],
"parameters": {
"url": "http://<hostname>/temperature",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "5581a3a0-3e03-4ad3-8892-f1f8be4e47c8",
"name": "Append last message",
"type": "n8n-nodes-base.code",
"position": [
1584,
256
],
"parameters": {
"jsCode": "let lastMessages = $('Parse last messages').first().json.parsedmessages[0].lastmessages;\nlastMessages.push($('Basic LLM Chain').first().json.output.recommendation);\n\nif (lastMessages.length > 3) {\n lastMessages = lastMessages.slice(lastMessages.length - 3);\n}\n\nreturn { \"lastmessages\": lastMessages };"
},
"typeVersion": 2,
"alwaysOutputData": false
},
{
"id": "1e0b28de-58bb-48d2-835f-c8807242f03a",
"name": "Read last recommendations",
"type": "n8n-nodes-base.readWriteFile",
"position": [
928,
256
],
"parameters": {
"options": {
"mimeType": "application/json",
"fileExtension": "json",
"dataPropertyName": "lastmessages"
},
"fileSelector": "=./{{ $json.filename }}"
},
"typeVersion": 1
},
{
"id": "11bca2af-9bae-4f52-888b-e423c3690a82",
"name": "Parse last messages",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1104,
256
],
"parameters": {
"options": {
"encoding": "utf8",
"keepSource": "json"
},
"operation": "fromJson",
"destinationKey": "parsedmessages",
"binaryPropertyName": "lastmessages"
},
"typeVersion": 1,
"alwaysOutputData": false
},
{
"id": "26eadae8-29ae-44cf-9c4a-ac76af059edd",
"name": "Convert last messages",
"type": "n8n-nodes-base.convertToFile",
"position": [
1744,
256
],
"parameters": {
"options": {
"format": true,
"encoding": "utf8",
"fileName": "=./{{ $('Add Filename').item.json.filename }}"
},
"operation": "toJson",
"binaryPropertyName": "writtenmessages"
},
"typeVersion": 1.1
},
{
"id": "c12a7671-7f24-4f0e-bfc9-c116cac264ed",
"name": "Write last messages to file",
"type": "n8n-nodes-base.readWriteFile",
"position": [
1920,
256
],
"parameters": {
"options": {},
"fileName": "=./{{ $('Add Filename').item.json.filename }}",
"operation": "write",
"dataPropertyName": "writtenmessages"
},
"typeVersion": 1,
"alwaysOutputData": true
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "ae062b48-cb79-4a3c-bdd5-345b56215e36",
"connections": {
"Add Filename": {
"main": [
[
{
"node": "Read last recommendations",
"type": "main",
"index": 0
}
]
]
},
"Ollama Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Append last message",
"type": "main",
"index": 0
}
]
]
},
"Read Temperature": {
"main": [
[
{
"node": "Add Filename",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Read Temperature",
"type": "main",
"index": 0
}
]
]
},
"Append last message": {
"main": [
[
{
"node": "Convert last messages",
"type": "main",
"index": 0
}
]
]
},
"Parse last messages": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Send a text message": {
"main": [
[]
]
},
"Convert last messages": {
"main": [
[
{
"node": "Write last messages to file",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Basic LLM Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Read last recommendations": {
"main": [
[
{
"node": "Parse last messages",
"type": "main",
"index": 0
}
]
]
},
"Write last messages to file": {
"main": [
[
{
"node": "Send a text message",
"type": "main",
"index": 0
}
]
]
}
}
}