CPS Lab Workshops
npm install -g n8n and press Enter.n8n and press Enter to start the server.{
"nodes": [
{
"parameters": {},
"id": "chat-trigger",
"name": "Chat Trigger",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [ 100, 300 ]
},
{
"parameters": {
"url": "https://api.yourcpslab.com/sensors/live",
"options": {}
},
"id": "fetch-sensors",
"name": "Fetch CPS Sensor Data (API)",
"type": "n8n-nodes-base.httpRequest",
"position": [ 300, 300 ]
},
{
"parameters": {
"model": "gpt-3.5-turbo"
},
"id": "openai-model",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [ 500, 450 ]
},
{
"parameters": {
"promptType": "define",
"text": "=You are the CPS Lab Assistant. The user just asked a question. Here is the live sensor data from the lab: {{ $json.data }}\n\nPlease answer their question based on the sensor data."
},
"id": "analyze-sensor",
"name": "Analyze Sensor Data",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [ 500, 300 ]
}
],
"connections": {
"Chat Trigger": {
"main": [ [ { "node": "Fetch CPS Sensor Data (API)", "type": "main", "index": 0 } ] ]
},
"Fetch CPS Sensor Data (API)": {
"main": [ [ { "node": "Analyze Sensor Data", "type": "main", "index": 0 } ] ]
},
"OpenAI Chat Model": {
"ai_languageModel": [ [ { "node": "Analyze Sensor Data", "type": "ai_languageModel", "index": 0 } ] ]
}
}
}