Use CTERA Portal from n8n: log in, check session, list tenants, list devices, and run other Admin API actions from your workflows.
This repo is the CTERA n8n app that customers add to n8n (via GitHub / npm). It provides:
- CTERA node — An n8n community node with a dropdown of Admin API actions (Current session, List tenants, List filers, etc.).
- App service — A small API used by the node for login and Portal calls (you run it yourself or host it).
- Example workflows — CTERA login and usage examples.
After this app is published to npm from this repo:
- In n8n: Settings → Community nodes → Install.
- Enter the package name (e.g.
n8n-nodes-cteraor@your-org/n8n-nodes-ctera). - Restart n8n if prompted. Search for CTERA when adding a node.
- Clone this repo:
git clone https://github.com/ronier83/ctera-n8n.git cd ctera-n8n - Build and run n8n with the CTERA node loaded:
cd n8n-nodes-ctera && npm install && npm run build && npx @n8n/node-cli dev
- Open http://localhost:5678 and search for CTERA when adding a node.
If the app is published to npm (e.g. n8n-nodes-ctera):
-
Using the n8n UI (easiest)
Open your n8n (e.g. http://localhost:5678) → Settings → Community nodes → Install → entern8n-nodes-ctera→ Install. Restart the container if n8n asks. -
Persist custom nodes so they survive container restarts. Run Docker with a volume for n8n’s data (including community nodes):
docker run -it --rm --name n8n -p 5678:5678 \ -v n8n_data:/home/node/.n8n \ n8nio/n8n
After you install the CTERA app from the UI, it lives under
~/.n8n/nodesand is kept by the volume.
If the app is not on npm yet (install from your local build):
-
Build and pack the node (on your machine):
cd ctera-n8n/n8n-nodes-ctera npm install && npm run build npm pack
This creates
n8n-nodes-ctera-1.0.0.tgz(or similar). -
Copy the tarball into the running n8n container and install it inside the container:
docker cp n8n-nodes-ctera-1.0.0.tgz n8n:/tmp/ docker exec -it n8n sh -c "mkdir -p /home/node/.n8n/nodes && cd /home/node/.n8n/nodes && npm install /tmp/n8n-nodes-ctera-1.0.0.tgz"
-
Restart the n8n container so it loads the new node. Use a volume for
/home/node/.n8n(as above) so the install is kept after restart.
Then open n8n and search for CTERA when adding a node.
-
Run the app service (required for the CTERA node to call your Portal):
cd services/ctera-portal && npm install && npm run build cd ../app && npm install && npm run build && npm start
Default: http://localhost:3000. If n8n runs in Docker, use
http://host.docker.internal:3000in credentials. -
Create a CTERA App API credential — App Service URL (e.g.
http://localhost:3000orhttp://host.docker.internal:3000), Host, Context, Username, Password; enable “Allow self-signed” if needed. You can leave Session Cookie empty when using the CTERA node chain below. -
Run a workflow — Either:
- workflows/02-ctera-login.json — HTTP-based login (Manual Trigger → Set → HTTP Request). Use this to get a cookie to paste into the credential if you prefer cookie-based runs.
- workflows/04-ctera-node-login-set-portal-list-users.json — Full CTERA node chain: CTERA (Login) → CTERA (Set portal context) → CTERA (List users). Import it, assign the CTERA App API credential to each CTERA node, then run. The node passes the session cookie from Login to the next nodes automatically.
- workflows/06-ctera-metadata-list-longpoll-loop.json — Metadata list → longpoll → loop: optional folder_ids and cursor; when longpoll returns, calls list again with the new cursor in an endless loop. First run uses Manual Trigger (Login → List → Longpoll → Loop again). After importing, open the Loop again node and set it to run this workflow so the loop works.
| Path | Purpose |
|---|---|
| n8n-nodes-ctera/ | n8n community node (the CTERA “Action in an app”). Install this in n8n. |
| services/ | App service + CTERA Portal client. Run the app so the node can log in and call the Portal. |
| workflows/ | Example CTERA workflows: HTTP login (02); HTTP login → set portal → list users (03); CTERA node Login → Set portal → List users → List domain users (04); CTERA node List all devices (05); CTERA Metadata list-longpoll loop (06). Import into n8n. |
- n8n-nodes-ctera/README.md — Install options (npm, Docker, local dev), credential setup, and available actions.
- services/README.md — How to run the app service and use its API.
- Node.js 18+ (for the app service and for building the node).
- n8n (Docker or local).
- CTERA Portal (Admin or Services Portal) reachable from where the app service runs.
When you call the Portal API directly (e.g. with curl) or inspect raw responses, the XML can be hard to read. The CTERA node and app already return clean JSON for list actions (users, portals, devices, etc.), so you usually don’t need to handle XML in workflows. These tips help when you work with raw Portal XML outside n8n.
- Pretty-print XML — Pipe the response through
xmllint --format -(macOS/Linux), or use a small Python script withxml.dom.minidom.parseString(raw).toprettyxml(indent=" "). - Convert any XML to JSON — Use a generic converter (e.g. Python with
xml.etree.ElementTree: walk the tree and build a dict/list structure, thenjson.dumps(..., indent=2)). Handy for one-off inspection. - CTERA SDK format — If the response matches the CTERA SDK XML schema, you can parse it with the SDK (e.g. Python:
from cterasdk import fromxmlstr, tojsonstr) and print clean JSON.
MIT.