Skip to content
Fork of EdgeLinkd · Apache-2.0 Flow Copilot · experimental

Node-RED,
reimplemented
in Rust

n2link runs your Node-RED flows on a native Rust runtime, with the Node-RED editor built in. Keep your flows.json, drop the Node.js runtime, and add production controls for credentials, inbound traffic and outbound connections.

bash — n2link
# clone and build (Rust 1.88+, npm for the editor build)
git clone --recursive https://github.com/n2link/n2link.git
cd n2link && cargo build --release
# run: editor at http://127.0.0.1:1888
./target/release/n2linkd
AlphaNo Node.js at runtimeflows.json compatible
127.0.0.1:1888
The n2link editor with a flow drafted by Flow Copilot: an MQTT subscription adds a timestamp, then writes CSV and caches the latest value in Redis. The Copilot panel and debug messages are on the right.
The real editor, served by n2linkd. The lower flow was drafted by Flow Copilot from one sentence.

Flow Copilot · experimental

Describe it.
Review the draft. Deploy.

Flow Copilot lives in the editor sidebar. You describe a flow in plain language; it drafts nodes and wires from the node catalog of this runtime, and nothing runs until you review the draft and press Deploy.

Screen recording, n2link 0.4.0-rc.1 · 5:47Trimmed at the start, otherwise unedited

What you see in the recording

  1. 1

    Connect a provider

    An ai-provider config node holds the model settings: OpenAI, Anthropic, xAI or Snowflake Cortex.

  2. 2

    Describe the flow

    Pick the target flow and model in the Copilot panel and write what you want, e.g. read CPU usage with an exec node and publish it to a local MQTT topic.

  3. 3

    Get a grounded draft

    The draft uses only nodes installed in this runtime, with their named ports and payload types, and is checked against node metadata.

  4. 4

    Apply, review, deploy

    Apply to flow imports the draft into the editor. You inspect it, then Deploy like any other change.

EndpointPOST /assistant/draft
LimitsOwn rate and concurrency budget in [api_protection.copilot]
OutboundProvider calls go through the egress policy

Experimental. Drafts can add and connect nodes; they don't edit or delete existing ones yet. Live provider runs are not part of the automated test suite, which uses a deterministic local provider. Details in known issues.

Screens

The editor you already know

n2link serves the Node-RED editor itself, so palettes, debug messages and deploys work the way they do in Node-RED. The n2link additions sit in the same sidebar and settings.

A drafted flow, runningSubscribe, timestamp, then CSV and a Redis cache, from one prompt.
Debug and paletteMessages as they arrive; storage nodes including PostgreSQL and Redis.
Outbound network policyRead, validate, save and roll back the [egress] table from User Settings.

Why n2link

Built for gateways, controllers and small machines

The same editor and flows as Node-RED, on a single Rust binary, with the controls you need before a flow engine goes near production equipment.

Web UI

Editor built in

Design, deploy and debug in the browser. Admin login supports viewer, deployer and administrator roles or OIDC. Run --headless in production.

flows.json

Drop-in flows

Bring your existing flows.json and credential files. Deploys are revision-checked and one previous copy is kept for rollback.

QuickJS

Native nodes, JS where it counts

Only the function node runs JavaScript, in an embedded QuickJS interpreter. Every other node is native Rust.

XChaCha20-Poly1305

Encrypted credentials

An explicit credentials migrate encrypts the sidecar, with a backup. Rotate, recover and export are built into the CLI.

Hardened

Inbound and outbound controls

Per-endpoint request budgets, an optional bearer token for http in, and an outbound allowlist you roll out from observe to enforce.

Experimental · opt-in

WASM plugin nodes

Third-party nodes run in a Wasmi sandbox with no file, network, clock or credential access. Installs are staged, self-tested and atomic.

Quick start

From clone to flows

Build once from source, then it's one binary. npm is only needed at build time, to build the bundled Node-RED editor.

Build and run
# prerequisites: Rust 1.88+, git, Node.js with npm (build time only)
git clone --recursive https://github.com/n2link/n2link.git
cd n2link

# release build, including the Node-RED editor
cargo build --release

# run: opens the editor at http://127.0.0.1:1888
./target/release/n2linkd

# production: your own flow file, no web UI
./target/release/n2linkd run ./flows.json --headless
Editor127.0.0.1:1888
Data and config~/.n2linkd
All commandsn2linkd --help

Supported targets

  • x86_64-unknown-linux-gnuLinux
    x86-64
  • x86_64-pc-windows-msvcWindows (also -gnu)
    x86-64
  • aarch64-unknown-linux-gnu64-bit ARM, e.g. Raspberry Pi 4/5
    ARM64
  • armv7-unknown-linux-gnueabihf32-bit ARM (also gnueabi)
    ARMv7

Windows builds need patch.exe on PATH (it ships with Git) and Visual Studio for MSVC.

What you get

  • The editor and runtime API on one port; change it with --bind
  • Flows, credentials and settings under ~/.n2linkd
  • A commented n2linkd.toml written on first start
  • MQTT, HTTP, WebSocket, TCP/UDP, Redis and PostgreSQL nodes in the default build; Modbus with --features nodes_modbus

Architecture

Rust core, JS where it counts

No Node.js runtime. QuickJS runs Function nodes, Wasmi runs plugin nodes, and everything else is native Rust.

RuntimeRust on Tokio
Function nodeEmbedded QuickJS
EditorNode-RED editor, served by n2linkd
PluginsWasmi sandbox, opt-in
HistorySQLite deploy, node and Copilot history, opt-in
n2linkd
CORERust flow engineTokio · flows.json
QuickJSfunction nodes
WASMWasmi sandbox
Web UIeditor + admin API
MQTT
HTTP · WS
TCP · UDP
Modbus
dashed: optional build feature

Configuration

Config highlights

n2linkd.toml

Bind address and port for the editor and runtime API. --bind overrides it on the command line.

Configuration guide →
n2linkd.toml
[ui-host]
host = "0.0.0.0"
port = 1888

# or on the command line
# n2linkd run --bind 0.0.0.0:1888

Use cases

Where n2link fits

Anywhere you'd run Node-RED but would rather ship one native binary with explicit security controls.

IoT edge gateways

Collect sensor data over MQTT or TCP and forward it upstream, with outbound connections limited to an allowlist.

Industrial automation

Run control and data flows on industrial PCs with encrypted credentials and per-endpoint request limits.

Home automation

Run your existing flows on a Raspberry Pi, with the editor in the browser and no Node.js install on the device.

Cloud-to-edge migration

Prototype in Node-RED, then deploy the same flows.json to n2link at the edge.

Remote management

Edit flows remotely through the web editor, behind admin roles or OIDC, with deploy and Copilot history.

Development to production

Use the editor while building, then run the same binary with --headless in production.

Support n2link

Keep the steam going

n2link is built, debugged and maintained in personal time, and much of that work runs on paid AI tokens: Flow Copilot is tested against live models, and the code is reviewed and debugged with AI help. If n2link saves you time, a donation helps keep it moving.

  • A coffeeKeeps an evening of debugging going.
  • A token refillPays for live provider runs and AI-assisted reviews.
  • Maintenance timeFixes, releases, docs and answering issues.

Not able to donate? A star on GitHub, a bug report or a pull request helps too.