Real-time IoT Anomaly Detection with MQTT, GPT-4o-mini AI, and Multi-channel Alerts — n8n Workflow
Overview
How It Works
MQTT ingests real-time sensor data from connected devices. The workflow normalizes the values and trains or retrains machine learning models on a defined schedule. An AI agent detects anomalies, validates the results for accuracy, and ensures reliable alerts. Detected issues are then routed to dashboards for visualization and sent via email notifications to relevant stakeholders, enabling timely monitoring and response.
Setup Steps
MQTT: Configure broker connection, set topic sub
Nodes used
Workflow Preview
How it Works
- 1
Trigger
The workflow starts with a trigger trigger.
- 2
Process
Data flows through 17 nodes, connecting agent, aggregate, code.
- 3
Output
The workflow completes its automation and delivers the result to the configured destination.
Node Details (17)
Send Email
emailSend
HTTP Request
httpRequest
Postgres
postgres
Slack
slack
Code
code
AI Agent
n8n-nodes-langchain.agent
OpenAI Chat Model
n8n-nodes-langchain.lmChatOpenAi
How to Import This Workflow
- 1Click Download JSON button on the right to save the workflow file.
- 2Open your n8n instance. Go to Workflows → New → Import from file.
- 3Select the downloaded
real-time-iot-anomaly-detection-with-mqtt-gpt-4o-mini-ai-and-multi-channel-alertsfile and click Import. - 4Set up credentials for each service node (API keys, OAuth, etc.).
- 5Click Test Workflow to verify everything works, then activate it.
Or paste directly in n8n → Import from JSON:
Integrations
Created by
Cheng Siong Chin
@cschin
Tags
New to n8n?
n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.
Get n8n Free →