Description
Mapepire IBM i Node for n8n
Run IBM i Db2 SQL queries and CL commands in n8n through a Mapepire server (@ibm/mapepire-js). Focused, fast, parameterized.
What It Does
- SQL query execution with automatic paging
- CL command execution
- Optional parameter binding via JSON (array or object)
- Connection reuse toggle for bulk item performance
- Include / exclude metadata & update counts
- Optional terse output (rows only)
- TLS: ignore self‑signed or provide custom CA
- Structured errors when workflow uses continueOnFail
Quick Start
1. Install deps & build
npm install
npm run build
2. Launch n8n with this node:
Fast path (build + run using dist/)
npm run dev:n8nWatch mode (rebuild on file save, then n8n runs with built code)
npm run dev:n8n:watchManual (if you prefer explicit commands)
npm run build
N8NCUSTOMEXTENSIONS="$(pwd)/dist" npx n8nIf n8n installed globally instead of npx
export N8NCUSTOMEXTENSIONS="$(pwd)/dist" && n8n startAlternative: point at project root (package.json -> dist)
N8NCUSTOMEXTENSIONS="$(pwd)" npx n8nClassic link into a local n8n clone
(cd /path/to/your/n8n && npm link n8n-nodes-ibmi-mapepire)
3. In n8n: add node named “Mapepire”.
Docker Compose
If you run n8n in Docker, mount the built extension and point n8n at it:
services:
n8n:
image: n8nio/n8n:1.109.2
environment:
- N8NCUSTOMEXTENSIONS=/extensions/n8n-nodes-ibmi-mapepire
volumes:
- ./dist:/extensions/n8n-nodes-ibmi-mapepire:ro
ports:
- '5678:5678'
Steps:
npm run build (generates dist/)/extensions/... inside the containerIf you previously installed this package via n8n’s Community Packages UI/ENV and see loader errors, remove the cached install inside the container and restart:
docker exec -it bash -lc 'rm -rf /home/node/.n8n/node_modules/n8n-nodes-ibmi-mapepire && exit'
docker compose restart n8n
Alternatively, if you prefer n8n to install from npm at startup, set:
environment:
- N8NCOMMUNITYPACKAGES=n8n-nodes-ibmi-mapepire@^0.2.4
Note: when installing from npm, ensure you’re using a version containing the latest manifest fixes.
Credentials
Host, port, user, password. For TLS:
Using the Node
Operation: choose SQL Query or CL Command.
For SQL:
@ibm/mapepire-js version) – Array example: ["ACME", 42]
– Object example: { "CUST_ID": 42, "STATUS": "A" }
For CL: just supply the command text. Result returns completion info & messages.
Errors: When continueOnFail is enabled, each item returns an error object instead of throwing.
Testing & Development
npm test # Run Vitest suite
npm run test:watch
Implementation mocks Mapepire classes—no live IBM i needed.
Code Style
This repo uses Prettier. Format all files before committing (release script enforces it):
npm run format # write changes
npm run format:check # verify only
Releasing (Summary)
Use semantic scripts (patch | minor | major):
npm run release:patch
They bump version + tag; CI (with NPM_TOKEN secret) builds, tests, publishes. See CHANGELOG.md for history.
Troubleshooting
Node missing in n8n:
dist/ exists (rebuild if not)N8NCUSTOMEXTENSIONS path is absolute & exportedParameter issues: verify placeholder style matches library version.
TLS failures: try Ignore Unauthorized first; if that works, add proper CA.
License
MIT
—
Lean README version: detailed release & CI notes moved to history / scripts. Check CHANGELOG.md for full enhancement log.