Node-RED
Node-RED is a flow-based, low-code programming tool built on Node.js that enables visual development of event-driven applications by wiring together hardware devices, APIs, and online services in a browser-based editor.[1] It allows users to create lightweight flows for collecting, transforming, and visualizing data, with single-click deployment and support for running on low-cost hardware like the Raspberry Pi or in cloud environments.[1] Originally developed in early 2013 as a side project by Nick O’Leary and Dave Conway-Jones at IBM’s Emerging Technology Services, Node-RED was open-sourced in September 2013 to facilitate rapid prototyping of Internet of Things (IoT) solutions.[1] It quickly gained popularity for its intuitive interface and extensibility, becoming a founding project of the JS Foundation in 2016, which later merged into the OpenJS Foundation in 2019, under whose governance it continues to be maintained as an open-source project.[1] The tool's name playfully references "Code Red," highlighting its Node.js foundation and node-centric flow model.[1] Key features include a vast library of over 5,000 community-contributed nodes available for sharing via JSON-based exports on an online flow repository, integration of custom JavaScript functions, and broad applicability in industrial and IoT contexts for automating workflows and data processing.[1] Widely adopted for its accessibility to non-programmers while supporting advanced customization, Node-RED has evolved to include enterprise enhancements, such as those provided by FlowFuse, Inc., founded in 2021 by its original creator to scale deployments.[1]History and Development
Origins at IBM
Node-RED was initiated in early 2013 as a side project by Nick O'Leary and Dave Conway-Jones, members of IBM's Emerging Technology Services group, with the primary goal of simplifying the integration of Internet of Things (IoT) devices, application programming interfaces (APIs), and online services.[1] This effort stemmed from the need to address the complexities of connecting disparate systems in IoT environments, where traditional coding approaches often proved cumbersome for rapid development and prototyping.[2] The project began as a proof-of-concept designed to enable low-code visual programming specifically for event-driven applications within IoT contexts, allowing users to create data flows through intuitive graphical representations rather than extensive scripting.[1] At its core, this prototype focused on visualizing and manipulating message mappings, such as those using the MQTT protocol, to facilitate seamless event handling across connected devices and services.[1] By emphasizing a declarative wiring paradigm, it aimed to make application assembly more accessible to non-programmers while supporting the dynamic, real-time nature of IoT interactions.[3] A key aspect of the initial development was the creation of a browser-based editor, which provided an immediate, interactive canvas for users to drag, drop, and connect components without requiring traditional coding environments or installations.[1] This editor enabled rapid prototyping by allowing flows to be built, tested, and deployed in a single-click manner directly from the web interface, significantly lowering the barrier to entry for experimenting with IoT prototypes.[4] The focus on this visual, no-code interface marked Node-RED's early innovation in making event-driven programming feel intuitive and aligned with how engineers conceptualize system integrations.[1]Open-Sourcing and Governance
Node-RED was initially developed internally at IBM before being open-sourced in September 2013 under the Apache License 2.0, enabling broader community involvement and adoption.[1][5] In October 2016, Node-RED became one of the founding projects of the JS Foundation, which provided a structured framework for its ongoing development and sustainability.[1][6] In 2019, the JS Foundation merged with the Node.js Foundation to form the OpenJS Foundation, under which Node-RED continues to operate as a key project.[1] Governance of Node-RED is managed through the OpenJS Foundation, emphasizing collaborative decision-making and transparency, with the project maintained by a dedicated team of contributors who handle code reviews, issue triage, and feature development.[7][5] Key maintainers include Nick O'Leary, a co-creator of Node-RED, who leads much of the core development efforts. In 2021, O'Leary founded FlowFuse, Inc., to extend Node-RED's capabilities for enterprise environments, focusing on enhancements like collaborative tools and deployment management while keeping the core project open-source.[1][8] The project's release cadence follows a structured plan, targeting major releases annually around April, supplemented by frequent minor updates for bug fixes and new features, with older versions entering maintenance for security patches.[9] The latest stable version as of November 2025, 4.1.1, was released on October 13, 2025.[10]Core Architecture
Technology Stack
Node-RED is built on the Node.js runtime, leveraging its lightweight, event-driven architecture to handle non-blocking I/O operations efficiently, which enables the creation of scalable applications for data processing and automation.[11][5] This foundation allows Node-RED to operate as a server-side JavaScript environment, where flows execute asynchronously in response to events from various inputs, such as hardware devices or web services. The use of Node.js ensures that Node-RED can manage concurrent tasks with minimal resource overhead, making it suitable for both resource-constrained devices and larger deployments.[12] Node-RED provides cross-platform support across major operating systems including Windows, macOS, and Linux, as well as embedded systems like the Raspberry Pi, facilitating deployment in diverse environments from desktops to IoT edge devices.[13][14][15] Node-RED 4.x (latest version 4.1.1 as of November 2025) requires Node.js version 18 or later; however, as Node.js 18 reached end-of-life in October 2025, Node.js 20 or later is recommended, with Node.js 22 as the current Active LTS version for optimal performance and security.[16][17][18] This compatibility extends to containerized setups via Docker, supporting multiple architectures such as amd64, arm32v7, and arm64v8 to accommodate varied hardware.[19] Flows in Node-RED are stored in a JSON-based format, typically in files namedflows_<hostname>.json, which allows for straightforward serialization, import, and export of configurations.[20][21] This structure promotes portability, enabling users to share flows across instances or integrate them with version control systems like Git for collaborative development and tracking changes.[22]
The modular design of Node-RED relies on npm for package management, allowing core functionality and community-contributed nodes to be installed, updated, or removed as discrete modules.[23] Developers can publish custom nodes to the public npm registry, extending the platform's capabilities without altering the core codebase, which fosters a rich ecosystem of over thousands of reusable components.[24] This approach aligns with Node.js conventions, ensuring seamless integration and dependency resolution through standard npm workflows.
Key Components
Node-RED's primary interface is a browser-based flow editor, accessible by default at http://localhost:1880, which provides a drag-and-drop interface for visually assembling applications from interconnected nodes.[25][26] This editor consists of key elements including a header for deployment and menus, a left-side palette for node selection, a central workspace for arrangement, and a right sidebar for configuration and debugging.[26] The node palette serves as the central repository of building blocks, featuring a set of core nodes such as the inject node for triggering flows, the debug node for inspecting messages, and the function node for embedding custom JavaScript logic.[27][28] Beyond these essentials, the palette supports extensibility through over 5,600 community-contributed nodes and flows (as of November 2025) available via the official library at flows.nodered.org, enabling integration with diverse protocols, services, and hardware.[11][29] For user interface development, community-contributed modules such as the deprecated Dashboard (version 3.6.6, last updated in 2024) provide nodes for creating interactive web-based dashboards to visualize and control live data without additional coding.[30] Administrative and development tasks are facilitated by command-line tools, including the primarynode-red command for starting and managing the runtime, as well as node-red-nodegen for generating custom nodes from sources like OpenAPI specifications or existing function nodes.[25][31]
At the core of the system is the runtime engine, built on Node.js, which executes the defined flows by processing messages through nodes in a non-blocking, event-driven manner while supporting persistence through configurable context stores (such as memory or file-based) to retain state across restarts.[22][11] Error handling is integrated via mechanisms like catch nodes to intercept exceptions and configurable logging levels to monitor runtime issues, ensuring robust operation in production environments.[22][28]
Programming Model
Flows and Nodes
In Node-RED, flows represent sequences of connected nodes that form data processing pipelines, operating within an event-driven model where messages are passed between nodes to trigger actions and transformations.[32] A flow is organized as a tab in the editor workspace, allowing multiple sets of interconnected nodes to be grouped logically, with all nodes in a flow sharing the same flow-scoped context for storing data across node executions. Node-RED provides three levels of context scope: node-specific (private to one node), flow (shared within the tab), and global (accessible across all flows). Context storage is in-memory by default but can be configured for persistence across restarts using file-based or other stores.[32][33] This structure enables the creation of modular, visual representations of workflows, where data enters through input nodes, undergoes processing, and exits via output nodes, facilitating rapid prototyping and iteration without traditional coding.[32] Nodes serve as the fundamental modular building blocks within flows, each designed to perform specific tasks such as receiving input, processing data, or sending output.[32] Input nodes, like the MQTT in node, capture events from external sources such as message brokers; processing nodes, exemplified by the function node, allow custom JavaScript code to manipulate incoming messages; and output nodes, such as the HTTP response node, deliver results to endpoints like web servers.[28] Every node features configurable properties accessible via a properties panel, enabling users to set parameters like topics, thresholds, or connection details without altering the node's core logic.[32] Nodes typically have one input port and one or more output ports, with execution triggered either by an incoming message from a preceding node or by external events like timers or HTTP requests.[32] Messages in Node-RED are simple JavaScript objects that carry data between nodes, conventionally including a payload property to hold the primary data (which can be a string, number, boolean, array, object, or null), a topic string for routing or categorization, and optional metadata such as_msgid for unique identification and tracing.[34] Additional properties like msg.parts support message sequences for handling chunked data.[34] For reusability, Node-RED provides subflows, which encapsulate a group of nodes into a single reusable node type that appears in the palette, allowing instances to be deployed across flows with customizable properties exposed as environment variables.[35] The template node further enhances message handling by generating dynamic text outputs using Mustache templating syntax, interpolating message properties (e.g., {{payload}}) into strings or HTML while supporting features like loops and conditional rendering.[28] This conceptual data flow—input → transform → output—underpins Node-RED's efficiency in building event-driven applications.[32]
Wiring and Deployment
In Node-RED, wiring involves a drag-and-drop interface within the editor workspace, where users select nodes from the palette on the left and place them on the canvas. Connections are made by clicking and dragging from an output port on one node to an input port on another, creating wires that enable the passage of messages between nodes during runtime.[36][37] These wires represent directed data flows, with messages propagating from upstream to downstream nodes upon triggering. To organize complex applications, the workspace uses tabs along the top, each representing a separate flow for grouping related nodes. Users can add new tabs via the menu or by double-clicking empty space in the tab bar, rename them through the Flow Properties dialog, and reorder or hide them as needed to manage multiple flows efficiently.[38] Deployment occurs with a single click on the red Deploy button in the editor's top-right corner, which sends the configured flows to the Node-RED runtime for execution and restarts the flow context to apply changes. For versioning, Node-RED's Projects feature integrates Git to track modifications to flow files, allowing commits, branching, and history review directly in the sidebar. Remote deployment options include pushing changes to Git repositories via HTTP/SSH, enabling collaboration or distribution across instances, though the core runtime must be set up separately on target systems.[39][40] Debugging is facilitated by the Debug node, which, when wired into a flow, outputs messages to the Debug sidebar in the editor for real-time inspection, showing structured details like payload, timestamp, and originating node ID. The sidebar filters messages by node and supports toggling output to the runtime log for persistent recording. For error handling, the Catch node intercepts runtime errors from other nodes, generating a message with error details (such as description, source node info, and occurrence count) to route into a dedicated recovery flow, preventing unhandled exceptions from disrupting the system.[28][41][42] Flows can be exported from the editor menu as JSON files for backup or sharing, capturing the complete node configurations, wires, and properties in a portable format. Conversely, imports allow pasting JSON or loading files to recreate flows, with options to replace or append to existing tabs, ensuring seamless transfer across installations.[21]Installation and Basic Usage
Setup Process
Node-RED can be installed and set up on various platforms, with the primary method using Node Package Manager (npm) for local environments, while scripts and container images support embedded devices like Raspberry Pi or cloud deployments.[25][15][19] To install locally, a supported version of Node.js is required, with Node-RED 4.x necessitating at least Node.js 18, though Node 20.x is recommended for optimal performance.[17] On Linux or macOS, executesudo npm install -g --unsafe-perm node-red to install globally, avoiding permission issues; on Windows, use npm install -g --unsafe-perm node-red without sudo.[25] This places the node-red command in the system's PATH, allowing easy access from any directory.[25]
Once installed, start the server by running node-red in the terminal, which launches Node-RED on the default port 1880 and loads the editor.[25] Access the web-based editor at http://localhost:1880, where users can begin wiring flows using the browser interface.[25] The runtime uses a default user directory at ~/.node-red, containing files like the flows configuration and settings.[25]
Initial configuration occurs via the settings.js file in the user directory, which exports a JavaScript object for customizing runtime behavior.[43] Key options include setting the port (default 1880) for the HTTP server, enabling logging for console or file output, and configuring httpNodeRoot for endpoint paths; edits require uncommenting lines and ensuring valid JavaScript syntax to avoid startup errors.[43] For security, enable adminAuth in settings.js to require authentication, defining users with hashed passwords generated via node-red admin hash-pw and permissions like read or full access.[44][43]
Upon first access, the editor prompts for admin user setup if not pre-configured, establishing credentials to protect the interface.[44] Palette management allows adding nodes immediately through the editor's Manage Palette menu, where the Install tab searches and deploys modules from the Node-RED library, or via npm install in the user directory followed by a restart.[24]
For compatibility, Node-RED supports Raspberry Pi via a dedicated script (bash <(curl -sL https://github.com/node-red/linux-installers/releases/latest/download/update-nodejs-and-nodered-deb)) that installs Node.js 20 LTS, Node-RED, and optional Pi-specific nodes, setting it up as a system service.[15] Containerized setups use Docker with docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red, persisting data in volumes for portability.[19] Cloud hosting options include deploying on platforms like AWS, Azure, or Heroku, often via Docker images or npm in virtual machines.[19]
Simple Examples
Node-RED's visual programming paradigm allows users to create basic flows by dragging nodes from the palette and wiring them together, often without writing code, though JavaScript can be added in function nodes for custom logic.[28] These simple examples demonstrate introductory uses, assuming Node-RED is installed and running locally.[25] One basic example is a simple HTTP endpoint that echoes incoming requests. This flow uses an HTTP In node configured for a GET or POST method at a path like/echo, wired to a function node that sets the message payload to the request body or query parameters (e.g., msg.[payload](/page/Payload) = [JSON](/page/JSON).stringify(msg.req.body || msg.req.query);), and then to an HTTP Response node to send the echoed content back to the client.[28][45] Deploying this flow creates an endpoint accessible via a browser or tool like curl, where sending a request returns the input data, illustrating Node-RED's ease in handling web interactions visually.[28]
Another introductory flow involves timer-based messaging for periodic data transformation. An Inject node is set to inject a timestamp payload every 5 seconds (configurable interval), connected to a function node that formats the timestamp into a readable date string using JavaScript like var [date](/page/Date) = new [Date](/page/Date)(msg.[payload](/page/Payload)); msg.[payload](/page/Payload) = [date](/page/Date).toString(); return msg;, and finally wired to a Debug node to output the result in the sidebar.[39][28] This setup highlights automated triggering and simple processing without external dependencies, with the visual wires defining the data flow path.[28]
For IoT scenarios, a straightforward MQTT integration flow subscribes to a broker topic, processes the incoming payload, and publishes a response. An MQTT In node, configured with a broker (e.g., localhost:1883) and topic like sensors/input, connects to a function node for payload manipulation (e.g., msg.[payload](/page/Payload) = msg.[payload](/page/Payload) * 1.8 + 32; // Convert to [Fahrenheit](/page/Fahrenheit)), then to an MQTT Out node publishing to sensors/output using the same broker configuration.[46] This wire-based setup enables quick prototyping of message brokering, with optional JavaScript for transformations, and requires no additional coding for basic subscribe-process-publish behavior.[28]