n8n RouterOS Middleware Node

raw JSON →
1.1.6 verified Sat May 09 auth: no javascript

n8n community node for automating MikroTik RouterOS operations via a middleware service. Version 1.1.6 provides five key operations: Change PPP Profile, Enable/Disable Users, Force Reconnect, Get Active Sessions, and Test Connection. Designed for ISP billing automation workflows (e.g., isolating overdue customers, restoring service on payment). Requires the separate MikroTik Billing Automation Middleware service (Go-based) and an API key. Ships TypeScript definitions. Maintained on GitHub, MIT licensed.

error Error: Cannot find module 'n8n-nodes-routeros-middleware'
cause npm install failed or node_modules not available in n8n's custom node path.
fix
Run 'npm install n8n-nodes-routeros-middleware' from the n8n user directory (~/.n8n) and restart n8n.
error TypeError: Cannot read properties of undefined (reading 'baseUrl')
cause Credentials are missing or incorrectly configured.
fix
In n8n, ensure the node's credentials have both 'baseUrl' and 'apiKey' fields filled.
gotcha The node requires a separate middleware service (golang-routeros-middleware) to be running. It does not communicate directly with RouterOS.
fix Deploy and configure the middleware service per its documentation before using this node.
deprecated Node v1.0.0 had a breaking credential schema; credentials from v0.x will not work.
fix Recreate credentials in n8n after upgrading. The new schema requires 'baseUrl' and 'apiKey'.
npm install n8n-nodes-routeros-middleware
yarn add n8n-nodes-routeros-middleware
pnpm add n8n-nodes-routeros-middleware

Demonstrates programmatic usage of the RouterOsMiddleware node with credential config and a change profile operation.

import { RouterOsMiddleware } from 'n8n-nodes-routeros-middleware';

// The node is used within n8n workflows via UI or code.
// Below is a programmatic example for testing (not typical usage).
const node = new RouterOsMiddleware();

const result = await node.execute({
  operation: 'changeProfile',
  routerName: 'main-router',
  username: 'customer123',
  newProfile: 'HOME-20MB',
  forceReconnect: true,
  credentials: {
    baseUrl: process.env.MIDDLEWARE_URL ?? 'http://localhost:3000',
    apiKey: process.env.API_KEY ?? ''
  }
});

console.log(result);