Rust Runtime
Built on Tokio async I/O. No garbage collector. Only the function node runs JavaScript, through the QuickJS interpreter.
A Node-RED compatible runtime written in Rust. Run flows built from core Node-RED nodes with a small memory footprint, as a single binary plus the editor files.
RustRED running a Modbus-to-PostgreSQL flow with live memory and CPU monitoring.
RustRED is an open-source flow runtime written in Rust. It reads Node-RED flow JSON files and executes them on an async engine built on Tokio.
Flows exported from Node-RED import and run, without Node.js. That covers the core nodes, the stock MQTT nodes, node-red-contrib-modbus and node-red-contrib-postgresql. Broker and database passwords come along: flows_cred.json is read in Node-RED’s own format, encrypted or plain, with the same credential secret.
RustRED is a fork of EdgeLinkd by Li Wei, licensed under Apache-2.0, and is not affiliated with the Node-RED project.
What the current release does.
Built on Tokio async I/O. No garbage collector. Only the function node runs JavaScript, through the QuickJS interpreter.
Add your own nodes as Rust crates under node-plugins/; they are compiled into the binary.
17.0MB for the default feature set (about 24MB with --features full), no Node.js needed. Release archives for Linux and macOS, x86_64 and aarch64. The editor files ship in a folder next to the binary.
Uses the Node-RED flow format and editor. Core nodes, stock MQTT, node-red-contrib-modbus and node-red-contrib-postgresql flows import and run.
Build only what you need. Protocol, database, clustering and AI support sit behind cargo feature flags.
An embedded MQTT broker node, so a small setup needs no separate broker.
How the runtime is put together.
All I/O is non-blocking via Tokio. HTTP, MQTT, Modbus, and file operations run concurrently on a multi-threaded scheduler.
Parses Node-RED flow JSON and builds an execution graph. Messages flow between nodes through typed input/output ports.
Nodes are Rust code registered at compile time. An experimental WASM plugin host exists in the full feature set; it is not in release binaries.
Nodes for MQTT, Modbus, OPC-UA, BACnet, PostgreSQL, TimescaleDB, MSSQL, SQLite and InfluxDB. They are feature-gated and all in the default build.
Major subsystems sit behind cargo feature flags, so you can build smaller binaries for constrained devices.
The Node-RED editor is served by RustRED from the ui_static folder next to the binary, at http://127.0.0.1:1888 by default.
Custom nodes are Rust crates compiled into your own build of RustRED.
Implement the FlowNodeBehavior trait and annotate the node with the flow_node macro.
Put the crate in node-plugins/. The build script links every crate in that folder.
cargo build --release produces a binary that includes your node.
use rust_red_macro::*;
// Annotate with flow_node to register
struct MyCustomNode {
base: BaseFlowNodeState,
}
impl MyCustomNode {
fn build(
flow: &Flow,
base: BaseFlowNodeState,
config: &RedFlowNodeConfig,
) -> Result<Box<dyn FlowNodeBehavior>> {
Ok(Box::new(Self { base }))
}
}
impl FlowNodeBehavior for MyCustomNode {
async fn run(self: Arc<Self>, stop: CancellationToken) {
while let Ok(msg) = self.recv_msg(stop.clone()).await {
// Process your message
}
}
}
Flows made of core Node-RED nodes run as they are. Other nodes may need changes.
In Node-RED, select all nodes and export as JSON. Or copy your flows.json file directly.
Run rust-red run flows.json. RustRED reads the same JSON format and builds the execution graph.
Open http://127.0.0.1:1888 for the editor. Stock MQTT, node-red-contrib-modbus and node-red-contrib-postgresql nodes run as exported. Copy flows.json, flows_cred.json and .config.runtime.json together, or pass the secret with --credential-secret, and the broker and database passwords are picked up. A config node that fails to load is logged and disabled, and the rest of the flow keeps running.
Download a release, or build from source.
Get the archive for your platform from GitHub Releases and check it against checksums-sha256.txt.
git clone --recursive https://github.com/dzulfikar08/rust-red, then cargo build --release. Needs Rust and Node.js. cargo install --git https://github.com/dzulfikar08/rust-red installs the binary only, without the editor files.
./rust-red run flows.json. Add --headless to run without the editor.
Go to http://127.0.0.1:1888. Use --bind 0.0.0.0:8080 to change the address.
RustRED is open source under Apache-2.0.