- Breaking Cost Barriers: Traditional proprietary interfaces like OPC UA gateways and middleware licensing are often unaffordable for SMEs. n8n offers an open-source-based alternative with maximum flexibility at minimal licensing cost.
- Seamless Hardware-Software Coupling: Through protocols like MQTT, Modbus, and REST APIs, machine data can be read directly and transferred into modern software systems (ERP, CRM, dashboards).
- Focus on the Software Layer: Pragma Code builds this intelligent software layer—from custom database interfaces to interactive performance dashboards.
The Sensor-to-API Workflow in the AI Era
Why simply collecting machine data is no longer enough and how SMEs realize predictive maintenance and autonomous process control through agentic workflows and local LLMs.
Introduction: Why Machine Data is a Sleeping Giant in SMEs
In many medium-sized manufacturing companies, a massive, unused treasure is slumbering: machine data. Operating hours, cycle times, temperatures, error codes, or load levels – modern industrial assets generate valuable signals continuously. Yet, the reality in small and medium-sized enterprises (SMEs) is often sobering. Data remains siloed in programmable logic controllers (PLCs) in the shop floor, noted manually on clipboards, or keyed into Excel spreadsheets.
This lack of real-time data blocks competitiveness. Without automated transmission to higher-level IT systems (such as ERP systems, CRM systems, or BI platforms), efficient production planning, predictive maintenance, or exact post-calculations are impossible. The traditional solution is to implement expensive industrial middleware and gateways. But these projects in SMEs often fail due to astronomical software license fees and rigid integration structures.
This is where n8n enters as a revolutionary alternative. As an open-source-based process automation platform, n8n closes the gap between physical hardware (Operational Technology, OT) and the digital business world (Information Technology, IT) – at a fraction of the cost of traditional providers.
This article is an in-depth expert contribution from our content cluster. Discover the complete overview on our main page: n8n Automation →
- Introduction
- The Cost Trap of Classic Industrial Interfaces
- n8n as a Bridge: From Sensor to Cloud
- Technical Foundations: MQTT, Modbus & OPC UA
- B2B Comparison: n8n vs. Proprietary Gateways
- System Architecture: How Pragma Code Builds the Software Layer
- Practical Use Cases: Automation in Reality
- Security, Latency, and Edge Computing
- Roadmap: 5 Steps to a Connected Factory
- Conclusion: Start Your IoT Automation
- Frequently Asked Questions (Glossary)
The Cost Trap of Classic Industrial Interfaces
Anyone wishing to extract and use machine data in a factory inevitably encounters established industry standards. Whether OPC Router, Kepware, or other proprietary middleware solutions – these programs are extremely powerful, but they pose significant hurdles for SMEs:
High Entry Barriers Through Licensing Costs
A single gateway to couple OPC UA data with an SQL database often costs several thousand euros to purchase, plus annual mandatory maintenance fees.
Cost per Connection/Tag
Many vendors license by the number of connected machines (tags) or data points. As your machine park grows, licensing costs skyrocket.
Rigid Programming Logic
If an API in your ERP system changes or you want to connect a new cloud service, you have to pay for expensive certifications or external integrators to adapt the system.
Lack of Modernity
Much industrial interface software feels like it's straight out of the 2000s. Modern JSON-based REST APIs, webhooks, or AI nodes are foreign concepts there.
In the era of n8n, SMEs no longer have to submit to these licensing dictates. With open source and smart protocols, the data flow can be designed freely.
n8n as a Bridge: From Sensor to Cloud
n8n is at its core a workflow automation software. It works with an intuitive, node-based model (Low-Code). This means workflows are designed visually by connecting blocks (Nodes), but can be extended at any time with custom JavaScript code (Pro-Code).
What makes n8n so attractive for Industry 4.0 is its ability to act as a bridge between the field level (machines) and the software level (business applications). n8n can:
Poll sensor data or PLC states cyclically or receive them via real-time protocols (events).
Transform, filter, and clean this data on-the-fly (e.g., filtering out erroneous readings or converting units).
Forward the processed data via API to any target systems (e.g., Salesforce, SevDesk, Slack, or a custom Web App).
Thanks to the Self-Hosting option, n8n runs directly on your own local servers (on-premise) or in your private cloud. This keeps sensitive production data 100% in your hands and avoids recurring task or volume fees.
Technical Foundations: MQTT, Modbus & OPC UA with n8n
To read data from physical hardware into n8n, we leverage modern, open communication standards. In the industrial sector, three protocols have established themselves, which we can connect seamlessly to n8n:
MQTT MQTT (Telemetry)
Perfect for IoT sensors. An extremely lightweight publish/subscribe protocol, ideal for unstable networks and high data density.
OPC UA OPC UA
The global standard for machine language. Provides semantic data descriptions and high security standards out-of-the-box.
Modbus TCP Modbus TCP / RTU
The classic for legacy assets. Direct reading of register addresses (PLCs, counters) without complex software layers in between.
How n8n Communicates with These Protocols
n8n features native nodes for MQTT triggers and MQTT actions. This means n8n listens permanently on an MQTT broker (e.g. Mosquitto) and immediately launches an automatic workflow as soon as a machine sends new telemetry data.
For OPC UA and Modbus, we typically set up a slim local connector in professional deployments (e.g., Node-RED or Telegraf running as a container) that gathers the machine data and forwards it to n8n via a REST API or MQTT. This keeps the architecture modular, scalable, and absolutely stable.
B2B Comparison: n8n vs. Proprietary Industry Interfaces
To understand why more and more innovative SMEs are turning to n8n, a direct system comparison is helpful.
Comparison: Traditional Gateways vs. n8n
- Expensive: High upfront costs and mandatory annual maintenance contracts.
- License limits: Restricted by the number of connected data points.
- Siloed worlds: Tailored for raw industrial databases (SQL), hard to connect to modern web APIs.
- Proprietary: Black-box code, custom changes only via vendor or integration partner.
- Cost-effective: No licensing fees for standard features when self-hosted.
- Unlimited: Any number of nodes, data points, and workflows without additional costs.
- API-First: Native integration of REST APIs, Slack, Microsoft 365, webhooks, and AI tools.
- Flexible & open: Transparent code, easy import/export as JSON, custom node development possible.
System Architecture: How Pragma Code Builds the Software Layer
A critical point in industrial automation is the separation of responsibilities. At Pragma Code, we are not PLC programmers or hardware electricians. We do not directly intervene in the physical controllers or mechanics of your machinery – that remains the responsibility of your maintenance team or machine manufacturer.
Pragma Code builds the software layer above the machines. We take over where the data leaves the machine (e.g., at an OPC UA interface, an MQTT broker, or a database) and integrate it into intelligent IT workflows:
Database Architectures & Data Warehouses
We set up high-performance time-series databases (e.g. InfluxDB, TimescaleDB) specifically optimized to store massive amounts of sensor data efficiently.
Real-time Dashboards & Visualization
We build web frontends (e.g., using Astro or React) or configure professional Grafana dashboards so you can monitor your factory's live status on any device.
ERP & API Integrations
We develop interfaces to post machine data (like completed cycle counts) directly into your ERP system (e.g., SAP, proALPHA, Odoo) to keep stock levels and manufacturing runtimes accurate down to the second.
Practical Use Cases: Automation in Reality
What does the deployment of n8n look like in a modern SME manufacturing setup? Here are three typical scenarios:
1. Predictive Maintenance
A temperature sensor on a critical spindle bearing sends readings via MQTT every minute. n8n checks these values against a defined threshold. If the temperature exceeds 75°C, n8n automatically triggers an alert: it creates a maintenance ticket in the ERP, looks up the technician on duty in the Google Calendar, and sends an urgent SMS with the error details and machine ID.
2. Automated OEE Tracking (Overall Equipment Effectiveness)
Via a Modbus coupling, n8n registers every completed production cycle (cycle pulse). The data flows into a data warehouse. n8n automatically calculates the OEE metric (availability x performance x quality) and updates a dashboard in the breakroom every hour. Production management immediately spots when an asset loses efficiency.
3. ERP Feedback & Stock Booking
When a CNC milling machine reaches the target quantity of a production order, it reports this event via webhook. An n8n workflow catches the event, updates the ERP system, books the completed parts into inventory, and flags the manufacturing step as 'completed'. No manual scanning or keying in at the office is required.
Security, Latency, and Edge Computing
In OT, security is paramount. A system must never allow direct access to the machine bus from the public internet. At Pragma Code, we rely on strict network segregation and edge computing:
Strict OT/IT Segregation
The machine controllers reside in a separate VLAN without internet access. An edge gateway reads the data locally.
On-Premise Deployment
n8n runs locally in a Docker container within the factory network. Data is processed locally – no sensitive manufacturing metrics escape to foreign public clouds.
Latency Optimization
n8n is not designed for real-time control loops (millisecond range latency) – that is what PLCs are for. n8n shines in monitoring and IT coupling tasks operating in the second or minute range.
Roadmap: 5 Steps to a Connected Factory
The journey to automating hardware data does not have to be a slow-moving, massive project. We proceed in an agile and structured manner:
Together with your maintenance team, we check: which interfaces (OPC UA, Modbus, MQTT) are already available on your machines and which registers need to be read?
We install a secure local edge gateway (e.g. on an industrial PC) that taps the raw machine data and translates it into an IT-friendly format (JSON/MQTT).
We deploy your on-premise n8n instance and an optimized database. The initial workflows ingest, transform, and store the data permanently.
We build the user interfaces: Grafana dashboards for the shop floor or direct interface mappings to your ERP and accounting systems.
After thorough testing in parallel operation, we take the system live. From that point on, OEE calculation and maintenance alerts run fully automatically.
Quick-Check: Is Your Machine Park Ready?
Conclusion: Start Your IoT Automation with n8n
Production digitization in SMEs fails not from lack of will, but from expensive, complex software interfaces. n8n breaks this barrier. It gives SMEs back the freedom to use hardware data flexibly, cost-effectively, and independently – without the licensing trap.
Pragma Code builds the foundation of this modern IT/OT bridge. We design the databases, structure the APIs, and build the dashboards so that your machine data is finally used profitably.
Unsere Expertise vor Ort
Wir sind Ihr digitaler Partner – regional verankert und überregional erfolgreich.
Do you have questions about machine and hardware integration with n8n?
Arrange a free consultationFrequently Asked Questions (Glossary)
n8n
An open-source, node-based workflow automation software that enables companies to flexibly connect various APIs, databases, and services via visual workflows without high licensing costs.
Industry 4.0
The fourth industrial revolution, characterized by comprehensive digitization, networking, and automated data exchange between machines, plants, and IT systems in production.
OPC UA
A standardized, platform-independent industrial protocol for secure and reliable data exchange between machines, controllers, and software systems.
MQTT
An extremely lightweight network protocol for machine-to-machine (M2M) communication, optimized for resource-constrained IoT devices and unstable networks.
Modbus
An established, open industrial communication protocol designed for simple and reliable transmission of measurement and control data between PLCs and sensors/actuators.