sorel-database

Record operations and polling triggers for the Sorel Energies database API

Package Information

Released: 2 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.2

Documentation

Sorel Database node for n8n

n8n community node for reading, writing, and polling records from the Sorel Energies database API.

It uses the existing Sorel API routes:

  • GET /api/database/tables
  • POST /api/database/tables/:tableId/records
  • PATCH /api/database/tables/:tableId/records/:recordId
  • DELETE /api/database/tables/:tableId/records/:recordId

Features

  • Search, Get, Create, Update, Delete, and Create or Update record operations.
  • Sorel Database Trigger polls for created or updated records.
  • Database and table fields are selectable from n8n dropdowns. Tables are loaded from GET /api/database/tables.
  • Optional legacy mapping keeps old workflow field names stable while sending the new Sorel table and field names to the API.
  • Search supports simple formulas like {Status} = 'Active', AND(...), and OR(...), plus sorting, field projection, and maximum record count.
  • Attachment downloads are supported by the trigger when the Sorel API exposes /api/database/attachments/:attachmentId/content.

The Base input is intentionally kept for imported workflows, but ignored: Sorel currently exposes a single database.

Credential Mapping

Put this in Legacy Mapping (JSON) when table or field names changed:

{
  "Clients": {
    "table": "Entreprises",
    "fields": {
      "Nom": "Raison sociale",
      "Telephone": "Telephone principal"
    }
  }
}

Workflows may continue to send and read fields.Nom; the node sends and reads Raison sociale in Sorel.

Local Install

cd n8n-nodes-sorel-database
npm install
npm run build
npm pack

For a self-hosted n8n instance, install the produced archive in n8n's custom-nodes directory, then restart n8n:

mkdir -p ~/.n8n/nodes
npm install --prefix ~/.n8n/nodes /path/to/n8n-nodes-sorel-database-0.1.0.tgz

For Docker, copy or mount the archive and run the same install command inside the container:

npm install --prefix /home/node/.n8n/nodes /path/to/n8n-nodes-sorel-database-0.1.0.tgz

Create one Sorel API token with data:read and data:write, then create the Sorel Database API credential in n8n.

Legacy Workflow Converter

The package includes a converter for exported n8n workflow JSON files. It replaces old table nodes with Sorel Database nodes, keeps node names and connections stable, maps known tables and fields, and writes a report for anything that needs manual review.

sorel-n8n-migrate --input workflow.json --mapping mapping.json --credential-name "Sorel Database API"

Mapping example:

{
  "tables": {
    "Clients": {
      "id": "tbl_clients",
      "fields": {
        "Nom": "Raison sociale"
      }
    }
  }
}

The converter writes:

  • workflow.sorel.json: the converted workflow to import in n8n.
  • workflow.sorel.migration-report.json: warnings and manual fixes.

Backend Contract

The nodes are compiled and usable against the current Sorel API. Exact migration parity for existing automations also requires backend support for formula evaluation, batch semantics, attachment upload, schema mutation, and legacy-record-ID resolution. The required contract and migration rules are recorded in MIGRATION_CONTRACT.md.

Discussion