SQL Query

storage.sql Storage v0.1.0

Runs a SQL query against PostgreSQL or MySQL with real server-side positional parameters ($1…$n / ?) — no string splicing. Outputs the rows, row count, and field types. Unlike the record nodes, this one does NOT fan a list out: its unit of work is ONE statement, and its parameters are already an array. A list on the input therefore does not become N statements — point Parameters field at the array you want bound, or turn on Run once per item to run the query once per item.

The SQL Query step on the Studio canvas
The SQL Query step as it appears on the Studio canvas — input pins on the left, output ports on the right.

Finding it in the library

Search the builder's node library for SQL Query (it lives under Storage). A single click opens the in-editor docs panel shown here — description, ports, and every property, without leaving the canvas. Double-click (or drag) to add it to the workflow.

SQL Query in the node library, with the in-editor docs panel open
The library entry and the in-editor docs panel for SQL Query — the same reference this page is generated from.

Wired up in the builder

SQL Query in a real, runnable flow — captured live from the Studio editor, exactly as it looks on your canvas. This is the same workflow used for the example input & output below.

SQL Query wired into a runnable workflow in the Studio builder
SQL Query wired into a runnable flow — input on the left, output on the right.

How it’s configured

The node’s settings as the builder shows them — every field laid out with real values. In the Studio these are edited on the node: click the chevron on the divider under its ports to open them.

The SQL Query node's settings in the Studio builder
The settings for SQL Query, showing the values from the flow above.

Ports

Ports are the node’s contract with its neighbours. In the editor a port label renders bold when wired and italic when optional; ports accept attachment carriers rather than data wires.

DirectionPortLabelWhat flows through it
InputinputInput
OutputoutputRows

How data flows through it

SQL Query consumes the content of the incoming envelope — when it is fed directly by a trigger, the trigger’s wrapper is unwrapped at the node boundary so the node sees the actual data, not the metadata shell. Its output becomes the payload for the next node, while the envelope (trace ids, correlation, binary refs) rides along untouched. In the Runs view you always see the whole envelope for both sides of this node.

Expressions in the config

String-typed properties accept {{ }} expressions evaluated against the incoming item at run time — e.g. {{ $json.customer.email }}. On this node that’s host, database, user, password. JSON- and code-typed fields never interpolate — they are passed through literally.

Build it with AI

Every node in this reference is reachable through Flowdrome’s AI Copilot and the MCP tools — say what you want, and the graph surgery happens server-side. Node types resolve fuzzily, so the catalog label (SQL Query) works as well as the exact type id (storage.sql).

In the Copilot panel (or any connected AI):

add a sql query node after the trigger

As a step in a create_chain_workflow call:

{"type":"SQL Query","config":{}}
Raw MCP call — add this node to a workflow with add_node
curl -s -X POST http://localhost:4800/mcp -H "content-type: application/json" -d '{ "jsonrpc": "2.0", "id": "1", "method": "tools/call", "params": { "name": "add_node", "arguments": { "workflowId": "<id>", "type": "SQL Query" } } }'

Example input & output

Hand-crafted example (captured shape — regenerating live needs a PostgreSQL server reachable from the capture machine).

Input — what the node received

{
  "kind": "json",
  "contentType": "application/json",
  "payload": {},
  "body": {}
}

Output — what the node produced

{
  "rows": [
    {
      "sum": 2,
      "tag": "docs"
    }
  ],
  "rowCount": 1,
  "command": "SELECT"
}

Property reference

Every setting, with its type and default — the same fields shown configured above.

PropertyTypeDefaultDescription
Credential
credentialId
credential "" Use a stored credential for this connection — its fields are filled in at run start. Pick "None" to enter the connection details manually.
accepts credential templates: postgresmysql
Dialect
dialect
select "postgres" Which database to talk to. SQLite/DuckDB are deferred until the worker baseline is Node ≥ 24.
mysqlpostgres
Host
host
string "localhost" Database server hostname.
Port
port
int 0 Server port. 0 = the dialect default (5432 / 3306).
Database
database
string "" Database name to connect to.
User
user
string "" Database user.
Password
password
string "" Database password — supports ${credential.NAME.FIELD}.
TLS
tls
select "disable" Protocol-native TLS upgrade. "Require" fails with SQL_TLS when the server refuses.
disablerequire
Query
query
code "" The SQL to run. Use positional parameters — $1…$n (PostgreSQL) or ? (MySQL) — never splice values into the text.
Parameters
params
json [] Positional parameter values as a JSON array, e.g. [42, "name", true, null].
Parameters field
paramsField
field "" Dot-path to an array on the input to use as the parameters at run time (overrides the static list).
Row limit
rowLimit
int 10000 Maximum rows to return; further rows are dropped and the result is marked truncated.
Timeout (ms)
timeoutMs
int 30000 Abort the whole connection + query after this many milliseconds.

Related nodes

The rest of the Storage group — the same folder you’d scan in the editor’s library.

This page is generated from the node registry by gen-node-docs.mjs on every site build — ports, properties, defaults and visibility rules cannot drift from the code. The screenshots and example data are captured from a live Flowdrome by npm run shots:nodes and npm run gen:examples.