StyloDocs
Workflow blocks

Database Query

Execute SQL queries against your database

View as Markdown

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

FieldTypeRequiredDefaultDescription
dbQuerycodeYesSQL 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.
dbSchemaJSON schemaNoOptional 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>.

NameTypeDescription
successbooleanWhether query succeeded
rowsarrayQuery result rows
countnumberRow count
errorstringError 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 error output is populated; downstream blocks that reference other outputs may not receive values.

On this page