Explainer
Node-RED visual flow vs YAML on the plant floor
Short answer
Commission Node-RED on the plant floor as a visual, message-driven flow: prove the runtime and editor, send one counted internal test, then read one known PLC or RTU value before adding logic. YAML is not Node-RED's commissioning format — it belongs in the container and deployment files around the runtime. Keep deterministic and safety control in the PLC under IEC 61131-3.
On this page
- Is Node-RED a YAML-first tool or a visual flow editor?
- Why do plant teams pick a visual flow over YAML for device integration?
- What order proves a Node-RED flow ready for the plant floor?
- How fast can Node-RED poll a serial RTU device?
- Should Node-RED replace the PLC's control logic?
- Where does YAML still fit around a Node-RED deployment?
- What hardware should run Node-RED on the plant floor?
- How do you keep a growing visual flow readable?
- Questions asked
Node-RED on the plant floor is commissioned as a visual, message-driven flow, not as a YAML file: the editor is the commissioning interface, and the runtime stores the result as a JSON flow document. That single fact decides most arguments before they start. Prove the runtime, prove the editor, send one counted internal message, read one known value from the PLC or RTU, and only then write application logic — each layer passes before the next builds on it. Keep YAML for the deployment files around the runtime, keep deterministic and safety control in the controller, and budget any serial polling from the link arithmetic rather than a copied interval. This article gives that order, the numbers for the counted tests, and the worked poll-rate math.
Is Node-RED a YAML-first tool or a visual flow editor? #
Node-RED is a visual, event-driven flow editor: you wire nodes together in the browser editor, deploy, and the runtime passes messages along the wires, storing the flow as a JSON document — YAML is not a format it reads or writes.
In the editor, sources, transformations, decisions and destinations are nodes wired left to right; deploy writes the flow document the runtime loads, and the active route stays visible on the canvas. A technician who has never seen the project can trace a value from the device connector to the output node on screen. The 'Node-RED versus YAML' comparison usually starts in home-automation circles, where competing stacks configure logic in YAML files; Node-RED does not work that way, so importing a YAML-first habit means fighting the tool. Build and change the flow in the editor, and hand the project over as the flow document the next engineer opens in the same editor — not as text to diff by eye.
Why do plant teams pick a visual flow over YAML for device integration? #
The deciding difference is visibility under diagnosis: a flow shows the message route on screen, so a technician can attach a diagnostic output at any boundary and see the exact payload, while a YAML file hides the runtime path inside text.
Three properties earn the visual model its place on the floor. First, boundary diagnostics: a debug-style output clipped onto any wire shows the payload, data type and quality fields at that point, so transport errors and data errors separate in minutes. Second, published connector nodes cover the industrial protocol families — Modbus RTU and TCP for serial and networked devices, the S7 communications used by Siemens controllers, and MQTT for brokered data — so integration is configuration rather than protocol code. Third, documentation lives with the flow: notes attach to nodes and flows, and the wired route is itself readable, which the flow documentation guidance treats as a documentation form in its own right. A YAML pipeline can achieve all three; on a floor where the person diagnosing at 6 a.m. is a technician rather than the author, the visible route wins because it shortens the path from symptom to boundary.
What order proves a Node-RED flow ready for the plant floor? #
Prove five layers in order — runtime, editor, an internal message test, one read-only device read, then normalization and logic — and do not write application logic until the earlier layer passes; the internal test is 1 message per second for 10 seconds, expecting exactly 10 debug entries.
Record four values before the first deploy: the host operating system, the Node-RED runtime version, the connector package version and the target controller's communication settings, read from the installation itself rather than from another project.
- Start the runtime through the host's service mechanism and confirm a stable process and a startup entry in the runtime log. A process that exits repeatedly stops the project here.
- Open the editor from the engineering workstation at the target host's address and confirm the page belongs to that host — not to a local instance left running on your own machine.
- Deploy an internal test: an Inject node firing once per second into a Debug node, no device involved. Over a 10 second window the debug output must show exactly 10 entries — 1 message/s × 10 s = 10. A miss here belongs to the runtime or the deploy, not to the PLC.
- Configure one read-only connector for one known value, such as a register operators change safely or a counter that advances predictably. Poll at 1 read/s for 10 s: 10 reads must arrive and all 10 must match the controller's online value. A session indicator without valid data is not a pass.
- Normalize once at one boundary and verify the normalized value against the controller, then inject controlled values into each logic branch without live communications and confirm every branch, including the fault path.
The same layer-by-layer discipline scales up to the edge gateway commissioning sequence, where this collector is one station among several. When a connector answers but values never arrive downstream, work through fixing MQTT sensor data that goes missing in Node-RED before touching the controller.
How fast can Node-RED poll a serial RTU device? #
Budget the link instead of copying an interval: for the worked link below, each 10-register transaction costs about 50 ms, so ten such devices once per second consume half of a 9600 bit/s link, and more than that needs a higher baud rate or a longer interval.
The inputs are illustrative: a Modbus RTU serial link at 9600 bit/s, the RTU character frame of 11 bits per character, and one transaction reading 10 holding registers. The request frame carries slave address, function code, start address, quantity and CRC: 1 + 1 + 2 + 2 + 2 = 8 bytes. The response carries address, function code, byte count, the 20 data bytes and the CRC: 1 + 1 + 1 + 20 + 2 = 25 bytes. Together 33 bytes × 11 bits per character = 363 bits, and 363 bits ÷ 9600 bit/s = 37.8 ms of line time. Add the inter-frame silent gap — 3.5 character times, about 4 ms per gap at this rate, twice per transaction ≈ 8 ms — plus device turnaround, and 50 ms per transaction is the honest budget.
At one read per second, one device of this size uses 50 ms of a 1000 ms cycle, about 5%; ten devices use 500 ms, half the cycle. The decision for these inputs: ten such devices per link at one read per second is the working ceiling — keep the total under half the cycle — and an eleventh device, a shorter interval or a larger register block pushes you to a higher baud rate, fewer registers per read or a second link. The controller's communication diagnostics confirm the budget in service: watch for timeouts and queued requests after every change.
Should Node-RED replace the PLC's control logic? #
No for anything the machine depends on: keep deterministic control and all interlocks in the PLC under IEC 61131-3 — the standard that defines the controller programming languages, ladder diagram among them — and use Node-RED for the data moves around the controller, never as the safety path.
A controller under IEC 61131-3 executes its logic in a fixed scan cycle with deterministic timing; a flow on a PC executes when messages arrive, on an operating system that schedules other work. That difference sets the boundary. Ladder-style logic inside Node-RED does exist — the community package @vitormnm/node-red-instructions-ladder-iec-61131-3 provides the common logic instructions for PLC-style flows — and it is useful for soft interlocks in monitoring, training and noncritical automation. What never moves is the control the machine depends on: process interlocks stay in the controller, and a machine safety function runs in its safety-rated controller or relay system sized by the risk assessment, never through a flow on a plant PC. Commission flows to read values, feed historians and brokers, and trigger noncritical outputs; keep writes to the controller limited to points a risk assessment has explicitly approved.
Where does YAML still fit around a Node-RED deployment? #
YAML belongs to the deployment around the runtime, not the flow inside it: container definitions such as Docker Compose files, deployment manifests and pipeline configuration are written in YAML, so keep them in version control and keep the flow itself in the editor.
The division is ownership: YAML files under version control define what runs and how it restarts; the editor owns the logic. Export a copy of the flow alongside that deployment configuration so both halves of the system live in the same repository. When Node-RED runs in a container on the edge PC, container-layer faults have signatures of their own: the case of an MQTT client stuck on connecting inside a Docker container looks identical from the flow and resolves entirely in the container layer. The same split applies to the certificates those brokered connections use — the MQTT TLS certificate configuration procedure in Node-RED lives at the runtime layer, not in YAML.
What hardware should run Node-RED on the plant floor? #
Pick a cabinet-rated host that runs unattended: the runtime, the editor session and every connector run on one box, so the host needs a service-managed restart after power cuts, storage sized for the buffered message history and headroom for the flow count — not a desktop tower beside the line.
Three host behaviors decide availability before any flow does: the host starts unattended after a power cut through its firmware power-recovery setting and the runtime restarts through the host's service mechanism; storage endures the write pattern of whatever history you keep on the box; and the box holds headroom over the flow count and connector set you deploy, because a collector at its memory ceiling degrades silently. If a running collector slows down, the method in how to prove an IPC slowdown is hardware, not software settles the hardware-or-software question before anyone blames the flow. When that conversation becomes a replacement or a new specification, the fitting form factor is a fanless industrial mini PC in the cabinet, with the four recorded values from the commissioning list attached to it.
How do you keep a growing visual flow readable? #
Treat the canvas as the documentation: name each node, add a note to every flow, normalize values at one boundary and put a diagnostic output at each layer boundary, so a new technician can read the message route in the workspace without opening your ticket system.
Keep transport and data errors apart as the flow grows: a timeout means the request never completed; a valid response with an unexpected value means addressing, byte order, scaling or logic — reconnect logic running on top of a wrong value hides that distinction and delays diagnosis. Move heavy computation out of the flow when message handling slows down; running Python beside Node-RED on an edge PC covers the pattern of keeping compute-intensive work in a process beside the runtime. Then the decisions, one per case:
- Device integration logic: build it in the visual editor and hand it over as the flow document.
- Deployment, containers and pipelines: write YAML, version it, and export the flow beside it.
- Deterministic and safety control: neither format — the logic stays in the controller under IEC 61131-3.
Questions asked
Does Node-RED run the same way on a Windows and a Linux industrial PC?
The runtime and the editor behave the same, while the service layer differs: on Linux the install runs under the system service manager, and on Windows it runs as a background service or a startup task. Record the host operating system, the Node-RED runtime version and every connector package version with each flow, because those values decide which connector builds you can install.
Can you edit the saved Node-RED flow file as text instead of using the editor?
The runtime loads a flow document saved as JSON, so a text edit is technically possible, but the editor is what keeps the canvas, the node properties and the credentials consistent. Treat a hand edit as a recovery step after a corrupted deploy, take a copy of the document first, and return to the editor as the normal commissioning path.
Is Node-RED a replacement for the plant historian?
No. Node-RED moves, filters and transforms messages between devices, brokers and databases; it does not provide the indexed long-term storage, retention and query layer a historian provides. Use flows as the feeding layer that delivers clean, normalized values to the historian, and size the historian and its storage as a separate decision.
Which protocols can Node-RED use to reach PLCs and RTUs?
Published connector nodes cover the common industrial protocols, including Modbus RTU and Modbus TCP for serial and networked devices, the S7 communications used by Siemens controllers, and MQTT for broker-based data. Match the connector package to your installed runtime version before deploying, because a connector built for one runtime generation can fail on a newer one.