Node-RED for IoT: automation and integration without a backend
Published
Most IoT deployments eventually need some custom logic that doesn’t fit neatly into "store the reading" or "show it on a dashboard": forward a reading to a third-party system, combine two sensors’ data before deciding whether to alert, or trigger a webhook only when a condition holds for a sustained period rather than a single noisy spike. Traditionally that meant writing and hosting a small backend service. Node-RED replaces that with a visual, flow-based editor: you wire together nodes representing triggers, logic, and actions, and deploy the result directly, no separate codebase to maintain.
Flow-based programming, in plain terms
A Node-RED flow is a diagram: an MQTT-in node subscribed to a sensor topic, wired into a function or switch node that checks a condition, wired into an action node that sends an email, calls a webhook, or publishes a message back to MQTT for something else to pick up. Each node does one small job, and the wiring between them is the logic. For straightforward automation, this is often faster to build and easier to read at a glance than the equivalent in a general-purpose programming language, because the flow itself is the documentation.
Where it fits between ingestion and everything else
Node-RED usually sits right next to your MQTT broker, subscribed to the same topics your database writer and dashboard are subscribed to. That means it can react to a reading the instant it is published, run whatever logic you have wired up, and, if needed, publish a new message back onto MQTT for something downstream to react to in turn. It is the layer where "if this, then that" logic lives, separate from raw ingestion and separate from visualisation.
A real example: escalating a gas detector reading
A gas detector publishes readings every few seconds over MQTT. A Node-RED flow subscribes to that topic, and rather than firing an alert on every single reading (which would be noisy and easy to ignore), it tracks whether the reading has stayed above a threshold for more than sixty continuous seconds. Only then does it call a webhook that pages the site safety officer, and separately logs the event for later review. That kind of sustained-condition logic is exactly the sort of thing that is fiddly to configure in a generic alerting rule but straightforward to wire up as a flow.
Bridging systems that don’t speak the same language
Node-RED also does quiet, unglamorous work bridging protocols and systems that were never designed to talk to each other: converting an odd vendor payload format into your canonical reading schema, calling a manufacturer’s cloud API on a schedule and republishing the result over MQTT, or forwarding selected readings into a customer’s own internal system via webhook. This is the same role a custom integration script would play, without needing to provision and maintain a server to run it on.
Why this beats writing a bespoke backend
The honest tradeoff: Node-RED is not the right tool for complex, heavily-tested business logic that belongs in a proper application. But for the class of problem it is built for, threshold checks, protocol bridging, simple integrations, notification routing, it removes an enormous amount of overhead. There is no separate deployment pipeline, no server to patch, no framework to learn just to wire together "when X happens, do Y." The flow is deployed instantly and can be edited live.
- Flow-based: you wire nodes together visually instead of writing and hosting a backend service
- Sits alongside your MQTT broker, reacting to readings the instant they are published
- Well suited to threshold logic, protocol bridging, and simple system integrations
- Not a replacement for complex application logic, but removes the overhead for the automation that most IoT deployments actually need
- Deploys instantly and can be edited live, without a separate release process
See our IoT stack overview for how automation fits alongside ingestion, storage, and dashboards, or talk to us about a specific automation you want to build.
Ready to see this in your own dashboard?
Talk to us about your sites, your sensors, and your compliance requirements.
Request a demo