Skip to content
Docs

Database Insert

Database Insert writes the incoming JSON as rows into a table in an external database (PostgreSQL, MySQL/MariaDB or SQL Server). A single object becomes one row; an array becomes one row per element. It always inserts, so a row whose unique key already exists fails the run; use Database Upsert to update existing rows instead. You find it on the node picker’s Storage shelf.

The node connects with a secret of type Database credentials. Create one under Connections → Secrets first; see Secrets.

The Database Insert node's settings form, with the fields described below
The Database Insert node's settings form, with the fields described below
FieldTypeDefaultDescription
Secret credential (secretCredentialId)string ✦ (required) — The database credentials to connect with, chosen from your secrets.
Extra credentials (extraCredentials)key-value map (optional) — Extra connection settings merged on top of the chosen secret’s config.
Table (table)string ✦ (required) — The table to insert the incoming rows into.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

extraCredentials entries are merged into the connection config as written and are not expression-resolved. To choose the credentials at runtime, switch the credentials field to expression mode and resolve the id of a credential secret from flow data.

Publicus reads the table’s schema and maps the incoming JSON keys to column names:

  • A key matching a column supplies that column’s value; extra keys are ignored.
  • A nullable column missing from the input is written as NULL.
  • A non-nullable column with a database default, and primary key columns, are left to the database when missing.
  • A non-nullable column without a default that is missing from the input fails the run, naming the column.

If the incoming shape does not match the table, place a Mapper or Transformer upstream to reshape the JSON.

The node emits the rows it wrote, after column mapping, as a JSON array.

An Agent can call this node as a tool. It writes to an outside system, so agent calls are approval-gated in every mode below Autopilot; see Add human approval.

The Database / Insert template in the template gallery creates a smoke_customers table, then inserts one row from this upstream output:

{
"id": "ins-1",
"name": "Smoke Insert",
"email": "ins@example.com"
}

The Insert node only needs the credential secret and the table name (smoke_customers); the columns come from the JSON keys.