Skip to main content

Flows (Node-RED) — Getting Started

The /ui/flow menu gives you access to the Node-RED environment built into the gateway. Node-RED is a low-code tool where you build data flows by dragging and dropping blocks (nodes) and wiring them together. You can read and write gateway tag values, integrate with external systems over MQTT/HTTP, and design automation such as alarms, logging, and calculations.

Node-RED in container mode, 2026.05+

Node-RED 4.1.10 + Node.js 20 (both installed globally inside the image). On the container's first boot, userDir.seed (image-baked default flows + node_modules + plantpulse-edge / node-red-contrib-opcua nodes) is automatically copied to /data1/pp-data/node-userdir/ (from the second boot onward, user flows are preserved). User flows also survive an image upgrade.

The PlantPulse-specific nodes (pp-tag-value-read / pp-tag-value-write / pp-opc-* / pp-tag-list) link to node/conf/plantpulse-edge-nodes/ in the image via absolute-path symlinks — the entrypoint guarantees this on every boot (preventing the issue where the old native relative-path symlinks broke inside the container).

Before reading this document

Finish through 자주 하는 작업 → 새 PLC 연결 추가 / 태그 등록 and start with at least one tag being collected in real time. Node-RED uses that tag value as its input.


1. Access

Connect to the gateway in a browser, then go to Flows (Node-RED) in the left menu, or navigate directly to http://<gateway>/ui/flow.


2. Screen layout

AreaDescription
Left paletteList of available nodes, sorted by category. The 엣지 category contains the gateway-specific nodes.
Center workspaceDrag nodes into place and connect them with wires. Can be split into tabs (multiple flows).
Right sidebarThe info tab shows help for the selected node; the debug tab shows the output log of debug nodes.
Top-right DeployYou must press the Deploy button for your changes to actually take effect.

3. Basic operations — handy shortcuts

ActionHow
Add a nodeDrag from the palette into the workspace
Configure a nodeDouble-click the node → edit in the right panel → Done
Connect nodes (wire)Drag from a node's output port (right side) onto another node's input port (left side)
Remove a wireClick the wire to select it, then Delete
Multi-selectShift drag to select an area, or Ctrl/Cmd + 클릭 to add to the selection
Copy / pasteCtrl/Cmd + C / Ctrl/Cmd + V
SearchCtrl/Cmd + F — search node names in the palette
Import a flowMenu → Import → paste JSON (the example code in this document can be imported as-is)
Changes only take effect once deployed

Even if you add, delete, or modify nodes, the gateway knows nothing about the change until you press Deploy. A node marked with a red dot (●) means "has unsaved changes."


4. Basic structure of a message (msg)

The data flowing between nodes is always a JavaScript object called msg. The most commonly used fields:

FieldMeaning
msg.payloadThe body (main data). Can be a number, string, object, or buffer
msg.topicTopic (classification label). Frequently used in MQTT/Switch/Join, etc.
msg.timestampTimestamp (fill it in yourself when needed)
msg._msgidA unique ID assigned automatically by Node-RED — for tracing

Most nodes operate using msg.payload alone.


5. Edge nodes — at a glance (gateway-specific)

The 엣지 category in the left palette contains two nodes registered by the gateway itself. They are the input/output of nearly every IIoT flow.

IconNodeEnglish nameBehaviorREST called
Read tag value (pp-tag-read)read tag valueRetrieves the current value of one tag (from cache or by reading the PLC directly)GET /api/v1/tag/{tagId}/value
Write tag value (pp-tag-write)write tag valueWrites a value to one tag (applied to the PLC immediately)POST /api/v1/tag/{tagId}/value
inject (1s) ──▶ 태그값 읽기 ──▶ 처리 (function/switch/...) ──▶ 태그값 쓰기 / mqtt out / debug / file ...

How to find the nodes — type read tag or 엣지 in the palette search box → only those two nodes are shown. They are a light pastel blue.

Fields often left blank in node settingsHow to fill them dynamically
Tag IDSpecify dynamically with msg.tagId = 'TAG_...' during the flow (reuse one node for multiple tags)
Value (write node)Fill in during the flow with msg.value or msg.payload
Writing is risky — validate with a test tag first

Before applying writes directly to live equipment, validate thoroughly with an external simulator or a test tag. Grant write permission only for tags agreed upon with the operations team.

For detailed fields / inputs and outputs / the full protocol support table → Edge category (tag read/write)


6. Your first flow — Hello World

Goal: read one tag every 5 seconds and print it to the Debug sidebar.

  1. Drag an inject node from the palette → double-click → Repeat: interval every 5 seconds → Done
  2. Drag a 엣지태그값 읽기 node → enter a real tag in Tag ID (e.g., TAG_TEST_00042) → Done
  3. Drag a debug node from the palette
  4. Wire the three nodes together in inject → 태그값 읽기 → debug order
  5. Click Deploy at the top right
  6. Open the debug tab in the right sidebar and check that a value is printed every 5 seconds

This pattern (periodic trigger → read → process) is the basic form of every IIoT flow.


7. Next steps

In left-menu order:

  1. Using the basic nodes — what the 14 nodes most used in IIoT do
  2. Edge nodes (tag read/write) — gateway-specific nodes (the detailed version of the at-a-glance section 5 above)
  3. MQTT nodes in detail — Broker settings / Pub / Sub / LWT / Birth
  4. OPC-UA nodes in detail — Endpoint / Item / Client / Subscribe / Browse
  5. Sparkplug B nodes in detail — Group / Edge / Birth-Death / send and receive
  6. IIoT example collection — 12 patterns frequently built in the field
  7. Troubleshooting — common pitfalls

8. Learn more

  • The OPC-UA node viewer (/ui/opcua) shows every tag/value/node ID the gateway currently holds at a glance. → Using the OPC-UA node viewer
  • The REST API itself is covered in the 고급 / 통합 파트너용 → REST API chapter. Node-RED's pp-tag-read / pp-tag-write are thin wrappers around that API.
  • Official Node-RED manual: <https://nodered.org/docs/>