Workflow blocks
Database Query
Execute SQL queries against your database
system/database-query — Execute SQL queries against your database.
Where it appears
The Database Query block lives in the Logic & control group of the Workflow Builder. Connect the Database integration before adding it.
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
dbQuery | code | Yes | — | SQL run against the connected database. Use positional placeholders like $1 for parameterized values rather than interpolating untrusted input directly. Returned rows are exposed on the rows output. |
dbSchema | JSON schema | No | — | Optional declaration of the shape of each returned row, so downstream steps can reference typed fields (under the rows prefix). Leave empty to return rows untyped. |
Inputs and outputs
Inputs are the configurable fields above. The block produces these outputs:
Outputs
Reference an output downstream with <Database Query.field>.
| Name | Type | Description |
|---|---|---|
success | boolean | Whether query succeeded |
rows | array | Query result rows |
count | number | Row count |
error | string | Error message if failed |
Example
A minimal configuration for this block:
{
"type": "system/database-query",
"config": {
"dbQuery": "..."
}
}Limits and failure modes
- Requires a connected Database integration. Calls fail if that integration is disconnected or its authorization has expired.
- Required field (
dbQuery) must be set, or the block fails validation before it runs. - On failure the
erroroutput is populated; downstream blocks that reference other outputs may not receive values.