Migrating from Node-RED
How to export Node-RED flows as JSON and translate industrial connectivity flows into a Connectware service commissioning file with the help of an AI assistant.
This guide shows you how to migrate industrial Node-RED flows to Connectware by exporting the flows as JSON and translating the connectivity portion into a service commissioning file. Node-RED is widely used as a low-cost glue layer that reads PLCs through contrib nodes and publishes to MQTT. Those flows translate well, because the entire flow configuration is a single, well-defined JSON document. In more detail, the following topics are covered:
Understanding how Node-RED concepts map to Connectware resources
Exporting flows from the editor, the flow file, or the Admin API
Translating the flows into a service commissioning file with an AI assistant
Deciding what happens to function nodes and other logic
Verifying the migrated data points in the Data Explorer
A complete worked example, from flow export to service commissioning file, is available at the end of this guide.
Prerequisites
To follow this guide, you will need the following:
A running instance of Cybus Connectware with licenses for the connectors that replace your contrib nodes.
Access to the Node-RED editor, the flow file on disk, or the Admin API. The export format is the same across Node-RED 3.x and 4.x.
Network access from Connectware to the devices that Node-RED currently polls.
An AI assistant to translate the export. Any capable large language model (LLM) works. Cybus Connectware GPT is a ChatGPT assistant that already knows the service commissioning file format.
Basic knowledge of the Connectware services concept (for example, service commissioning files, connections, and endpoints).
How Node-RED Concepts Map to Connectware
A Node-RED flow export is a flat JSON array of node objects. Nodes that talk to devices reference a configuration node by ID: the configuration node holds the connection settings, and the flow nodes hold the addresses and polling rates. Connectware separates the same concerns in resources of a service commissioning file:
Configuration node (modbus-client, s7 endpoint, OpcUa-Endpoint)
Holds host, port, and protocol-specific settings. One connection per configuration node.
Read and poll nodes (modbus-read, s7 in, OpcUa-Client)
Address, quantity, and poll rate become the endpoint properties. The s7 endpoint variable table maps one-to-one to S7 endpoints.
mqtt out node topic
The topic can be reused verbatim on the integrated Connectware broker.
mqtt-broker configuration node
Integrated Connectware broker
External brokers that must keep receiving data become MQTT connector connections.
Simple function nodes
Pure payload reshaping and scaling translate to JSONata transform rules.
Complex flows and logic
Flows import into the Workbench largely unchanged for prototyping; production Node-RED runs as a containerized service.
Mapping Contrib Nodes to Connectors
The most common industrial contrib node families and their Connectware counterparts:
What Does Not Migrate to Native Connectors
Node-RED is a general-purpose programming environment, so only the connectivity portion translates mechanically:
function nodes with arbitrary JavaScript
Simple reshaping becomes a JSONata transform rule. Everything else moves to the Node-RED Workbench or a containerized Node-RED service.
Dashboards
Out of scope. Visualization consumes data from Connectware topics instead.
http in / http response endpoints
Re-implement with the HTTP Server, or keep them in a Node-RED instance.
Dynamic-address nodes (modbus-flex-getter)
Addresses computed at runtime cannot be translated statically. Redesign as fixed endpoints or keep the flow in Node-RED.
Context storage, timers, stateful logic
Keep in Node-RED (Workbench or container) and exchange data with Connectware over MQTT.
The Node-RED Workbench in Connectware is intended for prototyping and testing. For production workloads, run Node-RED as a dedicated service with a Cybus::Container resource, connected to the Connectware broker.
Exporting the Node-RED Flows
Any of the following gives you the same flat JSON array:
Editor: Open the main menu and select Export (or press Ctrl+E / Cmd+E), select all flows, choose the formatted JSON, and download or copy it.
Flow file: The runtime stores all flows in the
flows.jsonfile in the Node-RED user directory,~/.node-redby default. Installations older than Node-RED 2.0 use aflows_<hostname>.jsonfile name.Admin API:
GET http://${NODE_RED_HOST}:1880/flowsreturns the active flow configuration (with a bearer token ifadminAuthis enabled).
Credentials never appear in flow exports: Node-RED stores them encrypted in a separate flows_cred.json file. Collect broker and PLC credentials separately and pass them into the service as parameters. Before you paste an export into an AI tool, also check function node code for hardcoded secrets, and check the data privacy terms of the tool you use. See also the privacy notes for Cybus Connectware GPT.
Translating the Flows with an AI Assistant
Copy the following prompt and attach the flow export:
Reviewing the Generated Service Commissioning File
Work through this checklist before installing:
Validate the file structure. The Cybus Connectware Extension for VS Code validates service commissioning files against the official schemas as you edit.
Check every connection against its configuration node: host, port, rack and slot, and security settings.
Spot-check translated addresses and inferred Modbus data types against live values.
Review every generated JSONata transform against the original
functionnode code.Re-enter all credentials as parameters; they were not part of the export.
Compare the endpoint count against the migration report of the AI assistant.
Installing the Service
Install the service commissioning file. See Installing Services.
Enable the service. See Enabling Services.
Result: Connectware connects to the migrated devices directly and the connections reach the Connected state.
For read-only validation, Connectware and Node-RED can usually poll the same device at the same time, which allows you to compare live values before you retire the flows. Check the connection limits of your devices first. Disable the migrated flows in Node-RED once the migration is verified.
Verifying the Data
Open the Data Explorer and subscribe to the topics of the migrated service:
Every migrated data point publishes on its topic with plausible values.
Values match between Node-RED (for example, in a debug node) and Connectware.
Payloads shaped by transform rules match what the original function nodes produced. Compare a sample message from each system side by side.
Data arrives at the original poll rates.
Worked Example
The following flow export reads two holding registers from a PLC every second, scales the first register in a function node, and publishes the result to MQTT. It contains a tab, three flow nodes, and two configuration nodes:
Applying the translation rules produces the following service commissioning file. The modbus-client node becomes a Modbus connection; the modbus-read node becomes a holding register endpoint at address 0 with a one-second interval; the function node only uses the first register, so the endpoint reads one register as int16BE and the scaling becomes a JSONata transform rule; and the MQTT topic is reused verbatim:
The mqtt-broker node needs no counterpart: consumers subscribe to the topic on the integrated Connectware broker. If the external broker at broker.example.com must keep receiving the data, add an MQTT connector connection with a mapping.
For all Modbus connection and endpoint properties, see Modbus Connection Properties and Modbus Endpoint Properties. For the transform rule, see Data Processing Rules.
Disclaimer: Node-RED is a trademark of the OpenJS Foundation. Cybus is not affiliated with the OpenJS Foundation.
Last updated
Was this helpful?

