Description

n8n-nodes-totvs-rm
Native n8n nodes for TOTVS ERP Linha RM
Connect your n8n workflows directly to TOTVS RM โ with automatic JWT authentication, access to any DataServer, and dedicated operations for HR, Payroll, Stock, Finance, Accounting, and more.



—
โจ Features
- ๐ Automatic JWT authentication โ token obtained and cached automatically (renewed before expiry)
- ๐๏ธ Generic DataServer access โ call any of the 1,000+ DataServers via
RMSRestDataServer - ๐ฆ 12 dedicated modules with pre-built operations
- ๐ SQL filter support โ
LIKE,AND,OR,IN, field selection, pagination, ordering - ๐ Bilingual interface (PT-BR / EN)
—
๐ฆ Modules & Operations
| Module | Key Operations |
|——–|—————|
| Framework | Get JWT Token, Health Check, List DataServers |
| DataServer (Generic) | List, Read, Create, Update, Delete any DataServer |
| Employees (HR) | List, Get by Badge, Create, Update, Dismiss |
| Payroll | List Calculations, Get Calculation |
| Invoice (Stock) | List, Get, Create, Cancel |
| Stock Movement | List, Get, Create |
| Accounts Payable/Receivable | List, Get, Create, Mark as Paid |
| Accounting Entry | List, Get, Create |
| Customers / Suppliers | List, Get, Create, Update |
| Users | List, Get, Create, Update |
| Companies | List, Get |
| Enrollment (Education) | List, Get, Create |
—
๐ Installation
Option 1 โ n8n self-hosted
Go to your n8n custom nodes directory
cd ~/.n8n/nodesClone the repository
git clone https://github.com/espindolavinicius/n8n-nodes-totvs-rm.git
cd n8n-nodes-totvs-rmInstall and build
npm install
npm run buildRestart n8n
Option 2 โ via npm (after publishing)
npm install n8n-nodes-totvs-rm
Option 3 โ Docker
Add to your Dockerfile or docker-compose.yml:
RUN cd /home/node && npm install n8n-nodes-totvs-rm
Or with docker-compose.yml:
services:
n8n:
image: n8nio/n8n
environment:
- N8NNODESINCLUDE=n8n-nodes-totvs-rm
volumes:
- n8n_data:/home/node/.n8n
—
โ๏ธ Credential Setup
In n8n, go to Settings โ Credentials โ New โ TOTVS RM API and fill in:
| Field | Example | Description |
|——-|———|————-|
| RM Host URL | http://10.0.0.1:8051 | Address of RM.Host.Service |
| Username | admin | RM system login |
| Password | ** | User password |
| Default Company Code | 1 | CODCOLIGADA |
| Default Branch Code | 1 | CODFILIAL |
> Tip: Make sure port 8051 is accessible from the n8n server. For HTTPS, use https://your-server:port.
—
๐ก Usage Examples
List active employees
CODCOLIGADA=1 AND CODSITUACAO='A'NOME ASCGet a specific invoice
CODCOLIGADA=1 AND NUMERONF='000001234'Use a custom DataServer
SmtAtestadoDataCODCOLIGADA=1Discover all available DataServers
—
๐๏ธ Common DataServers Reference
| Module | DataServer | Description |
|——–|———–|————-|
| HR / Employees | FopFuncData | Employee register |
| HR / Payroll | FopFolhaCalcData | Payroll calculation |
| HR / Medical | SmtAtestadoData | Medical certificates |
| Stock / Invoice | FisNfData | Invoices |
| Stock / Movement | TMovData | Stock movements (TMOV) |
| Stock / Items | TITMMovData | Movement items |
| Financial | MovData | Financial entries |
| Accounting | CttLancData | Accounting journal |
| Global / Person | GlbPessoaData | Customers and suppliers |
| Global / User | GlbUsuarioData | System users |
| Global / Company | GlbColigadaData | Companies |
| Education | EduMatriculaData | Student enrollments |
—
๐ ๏ธ RM Host Configuration
In RM.Host.exe.config or RM.Host.Service.exe.config, ensure:
For custom SSL certificate:
—
๐ How Authentication Works
1. On the first call, the node sends POST /api/connect/token with username and password
2. The JWT token is cached in memory with its expiry time
3. The token is automatically renewed 60 seconds before expiry
4. Every request includes Authorization: Bearer
—
๐ค Contributing
Pull requests are welcome! To add a new module:
1. Add the resource option in TotvsRm.node.ts
2. Add the operations block with displayOptions
3. Map the DataServer in dsMap
4. Update this README
—
๐จโ๐ป Author
Vinicius Espindola
—
๐ License
MIT ยฉ Vinicius Espindola