n8n
The n8n-nodes-basedb package adds three nodes to n8n:
| Node | Role |
|---|---|
| basedb | read and write a table’s rows, comment on a row; usable as a tool by an n8n AI agent |
| basedb Trigger | run a workflow for each row created — or created or updated — since the last poll |
| basedb Webhook Trigger | run a workflow the instant a row is created, updated or deleted |
Install
Section titled “Install”In n8n: Settings › Community Nodes › Install, then n8n-nodes-basedb.
Without the interface — queue mode, a Docker image built in advance —: npm install n8n-nodes-basedb in the ~/.n8n/nodes folder, then restart n8n.
Credentials
Section titled “Credentials”Create a basedb API credential in n8n:
| Field | Value |
|---|---|
| Instance URL | the address where you open basedb: https://basedb.exemple.fr |
| Workspace | the workspace’s reference, the one in the API addresses (/api/v1/<workspace>/…): t4z56fq, unless the instance sets BASEDB_TENANT |
| Token | an integration token: the base’s ⋯ menu → API and agents → API and MCP tokens… |
| Environment | optional: the base’s environment to work in — recette, production… Empty: production |
A token opens one base — all its environments, or just one if it was limited when created. It reads its rows, writes them if it was created with write access, and never has more permissions than the person who created it. On save, n8n tries the connection and says if the token is refused.
To work on both production and staging, create two credentials with the same token, one with
Environment empty, the other with recette. With no environment chosen, the node’s list of
bases shows every environment, its name in parentheses.
Reading and writing: the basedb node
Section titled “Reading and writing: the basedb node”| Operation | What it does |
|---|---|
| Row › Create | adds a row |
| Row › Create or Update | updates the row whose chosen fields carry these values, or adds it if none do |
| Row › Get | reads a row by its _id |
| Row › Get Many | reads the rows of a filter, in the requested order, up to a limit or all of them, page after page |
| Row › Update | updates a row, found by its _id or by other fields |
| Comment › Create | comments on a row; an @mention notifies the person |
The base and the table are chosen from lists, the ones the token opens. The fields to write show with their name in basedb, a single select with its options, a Person field with the workspace’s members; a computed field — formula, lookup, rollup, autonumber — does not appear there, since basedb writes it itself. A value the field rejects stops the node with basedb’s code and what it means.
- The filter and the sort use the fields’ technical names, the SQL ones:
statut eq "gagne" and montant gte 10000,-montant,nom. The grammar is that of the REST API. - Numbers arrive as decimal text (
"1250.50"), to lose no digit; the Numbers as Numbers option converts them to numbers. - A relation reads as
{ "id": …, "display": … }and is written by the linked row’s_id. - Create or Update never updates several rows: if several carry the values, the node stops rather than guess.
- No Delete operation: to remove rows, mark them (a status “Archived”), hand deletion to an automation, or call the REST API with a token created to delete.
Running a workflow
Section titled “Running a workflow”On every poll: basedb Trigger
Section titled “On every poll: basedb Trigger”The node asks basedb, at the chosen pace (every minute, every hour…), for the rows created — or created or updated — since last time, plus a filter if needed. It works everywhere, even when basedb cannot reach n8n. On its first poll, it notes where the table stands and emits nothing; a test run from the editor returns the last row, so there is something to wire the following nodes to.
Instantly: basedb Webhook Trigger
Section titled “Instantly: basedb Webhook Trigger”Every row created, updated or deleted — even by SQL written directly in PostgreSQL — runs the workflow at once:
- Add the node and copy its Production URL.
- In basedb, the base’s ⋯ menu → API and agents → Webhooks…: create a webhook to that address, choose its tables and its events.
- basedb shows the signing secret once: put it in an n8n basedb Webhook credential.
- Turn the workflow on.
Each event becomes one item: its type (record.created, record.updated, record.deleted),
the table, the row before and after, and the fields changed (changed). The node checks
the signature of each delivery and answers 401 to one with none, a wrong one, or one more
than five minutes old. basedb delivers at least once: deduplicate on the event’s id if the
workflow must not process it twice.
Without the node
Section titled “Without the node”n8n’s HTTP Request node also talks to basedb: an Authorization: Bearer <token> header,
JSON both ways, pagination by meta.next_cursor passed as after
({{ $response.body.meta.next_cursor }}), and resuming after an outage with a filter on
_updated_at and by …/<table>/deleted?since=.
basedb is open-source software by Eodia, an AI-native software studio.