Login
Free Sign Up
Docs
/

Integration - SQL Query

Type identifier: integration:sql:query Category: Integration Operations

Description

The Integration - SQL Query node executes SQL queries against a database connection established by an Integration - SQL Connect node. It supports parameterised queries to prevent SQL injection, validates queries for dangerous operations, and returns results matching a configurable schema.

Input Handles

Handle

Type

Description

connection

SQL connection

Database connection from Integration - SQL Connect node.

query

string

(Dynamic) The SQL query to execute.

<parameter>

varies

Dynamic handles for query parameters.

Output Handles

Handle

Type

Description

rows

array

Array of result rows matching the row schema.

success

control

Triggered when query completes successfully.

error

control

Triggered when query fails.

Configuration Options

Option

Type

Default

Description

Connection Mode

enum

handle

Use incoming connection handle or shared SQL credential.

SQL Credential

credential id

-

Required when Connection Mode is shared credential.

Query

string or dynamic

-

SQL query with optional named parameters (:paramName).

Parameters

array

-

Parameter definitions with names and types.

Rows Schema

object schema

-

Schema defining the structure of result rows.

Allow Dangerous Operations

boolean

false

Allow DDL operations (such as DROP and CREATE).

Query Parameters

Parameters are referenced in queries using colon prefix (:paramName) and defined in the configuration:

Field

Type

Description

Name

string

Parameter name (matches :name in query).

Type

schema

Data type of the parameter.

Row Schema

Defines the expected structure of each result row. Properties should match the column names or aliases in the query.

Behaviour

  1. Resolves connection source:
  • handle: uses the connection input handle
  • shared_credential: resolves the selected SQL credential

    • if the shared credential is suspended and still within its cooldown window, the node fails immediately on the error path without making an outbound connection attempt
  1. Resolves query string and all parameter values
  2. Validates the query:

    • Maximum length: 100KB
    • Blocks dangerous operations unless explicitly allowed
    • Checks that all referenced parameters are defined
  3. Executes the query with parameters
  4. Maps results to the configured row schema
  5. Returns validated result rows

Shared credential mode updates connection health status automatically based on runtime outcomes. Repeated connection failures can place a credential into a suspended state; once the cooldown expires, the next run automatically probes the connection again.

Query Validation

Blocked operations (unless Allow Dangerous Operations is enabled):

  • DROP TABLE/DATABASE/SCHEMA
  • TRUNCATE TABLE
  • ALTER TABLE/DATABASE/SCHEMA
  • GRANT / REVOKE
  • CREATE TABLE/DATABASE/SCHEMA/ROLE/USER

Parameterised Queries

Parameters prevent SQL injection:

SELECT * FROM users WHERE email = :email AND status = :status

Result Mapping

Results are converted to match the row schema:

  • Column names (or aliases) are matched to schema property names
  • Values are coerced to schema types
  • Time values are parsed according to database format

Examples

Simple SELECT Query

Configuration:

  • Query: SELECT id, name, email FROM users WHERE active = true
  • Rows Schema:

    {
      id: number,
      name: string,
      email: string
    }

Parameterised Query

Configuration:

  • Query: SELECT * FROM orders WHERE customer_id = :customerId AND created_at > :since
  • Parameters:

    • customerId (number)
    • since (datetime)
  • Rows Schema: Order Schema

INSERT With Returning

Configuration:

  • Query: INSERT INTO logs (event, data) VALUES (:event, :data) RETURNING id, created_at
  • Parameters:

    • event (string)
    • data (object)
  • Rows Schema:

    {
      id: number,
      created_at: datetime
    }

Aggregate Query

Configuration:

  • Query: SELECT status, COUNT(*) as count FROM orders GROUP BY status
  • Rows Schema:

    {
      status: string,
      count: number
    }

Related pages