Skip to main content
Executes a custom SQL query against your connected data warehouse and uses the results as a data source in your workflow. Use it when you need to pull data using complex SQL that goes beyond what Get Data provides.

Configuration

SettingDescription
QuerySQL SELECT statement to execute against the data warehouse
DWH Auth IDData warehouse authentication ID (default: 0)
Result FieldsExpected result columns and types (auto-detected if omitted)
Virtual Object NameNamespace prefix for output fields (default: query)

Result Field Types

TypeDescription
strString/text
intInteger
floatDecimal number
boolBoolean
dateDate
datetimeDate and time

How It Works

1

Write your SQL query

Write a SELECT statement using your DWH’s SQL syntax. Reference tables with bare names, schema-qualified names ("schema"."table"), or fully qualified names.
2

Define result fields (optional)

Specify expected output columns and their types. If omitted, BonData auto-detects them from the query results.
3

Use as a data source

The query results become the starting point for your workflow, available as Mentions in downstream nodes.

Output

A dataset containing the query results. Each column becomes available as a Mention in downstream nodes, named as {virtual_object_name}.{column_name}.
The Query node acts as a workflow starting point — it does not have an input. Only SELECT statements are supported.

Example

Pull a custom report from Snowflake:
SELECT
  account_id,
  account_name,
  SUM(revenue) as total_revenue,
  COUNT(DISTINCT contact_id) as contact_count
FROM accounts
JOIN contacts ON accounts.id = contacts.account_id
WHERE created_at > '2024-01-01'
GROUP BY account_id, account_name
HAVING SUM(revenue) > 10000

Best Practices

  • Use Query when you need JOINs, aggregations, or complex WHERE clauses that Get Data doesn’t support
  • Specify Result Fields explicitly for predictable downstream behavior
  • Keep queries efficient — add WHERE clauses to limit the dataset size
  • Test your query directly in your DWH console before using it in a workflow
  • Get Data — simpler data fetching without writing SQL
  • Code Execution — run Python code for transformations that SQL can’t express
  • Transform — apply SQL expressions to data already in the workflow