Snowflake Block
Connect to Snowflake Data Warehouse and execute SQL operations
The Snowflake block connects to your Snowflake Data Warehouse to execute SQL queries, insert/update/delete data, manage tables, and run advanced data operations. Reach for it when a workflow needs to read from or write to Snowflake, with support for dynamic schema detection, parameterized queries, bulk loads, and connection pooling.
Overview
| Property | Value |
|---|---|
| Type | snowflake |
| Category | tools |
| Color | #29B5E8 |
When to Use
- Query a Snowflake warehouse and feed results into downstream blocks.
- Insert, update, or delete rows in Snowflake tables from a workflow.
- Create, drop, or truncate tables, or run stored procedures.
- Bulk load data from a stage using CSV, JSON, Parquet, Avro, or XML formats.
- Inspect schema info or list tables for dynamic, schema-aware automations.
- Test connectivity to a Snowflake account before running heavier operations.
Configuration
Connection Mode
How to authenticate to Snowflake. Options:
| Label | ID |
|---|---|
| Credentials | credentials |
| OAuth | oauth |
| Key Pair | keypair |
Defaults to credentials. The relevant credential fields appear or hide based on this selection.
Account Name
Your Snowflake account identifier (e.g. mycompany.eu-central-1). Required.
Database
The Snowflake database to connect to. Required.
Warehouse
The virtual warehouse to use for query execution. Required.
Schema
The schema within the database. Required.
Username
Username for authentication. Required when connectionMode is credentials.
Password
Password for authentication (stored securely). Required when connectionMode is credentials.
Role
Optional Snowflake security role to assume for the session.
OAuth Token
OAuth token for authentication. Required when connectionMode is oauth.
Private Key
RSA private key for key pair authentication (stored securely). Required when connectionMode is keypair.
Private Key Passphrase
Passphrase for an encrypted private key. Only shown when connectionMode is keypair.
Keep Session Alive
Toggle to keep the Snowflake session alive indefinitely. Defaults to off.
Connection Timeout (seconds)
How long to wait when establishing a connection before failing. Range: 30–300 seconds. Default: 60.
Query Timeout (seconds)
Maximum time allowed for a query to run before it is aborted. Range: 30–3600 seconds. Default: 300.
Operation
The action to perform. Required. Options:
| Label | ID |
|---|---|
| Execute Query | query |
| Insert Rows | insert |
| Update Rows | update |
| Delete Rows | delete |
| Create Table | create_table |
| Drop Table | drop_table |
| Truncate Table | truncate |
| Bulk Load | bulk_load |
| Execute Procedure | procedure |
| Get Schema Info | schema_info |
| List Tables | list_tables |
| Test Connection | test_connection |
SQL Query
The SQL statement to execute. Shown for query, create_table, drop_table, and truncate operations. Required for those operations. Includes an AI wand that generates Snowflake-correct SQL (CTEs, window functions, VARIANT type, etc.) from a plain-English prompt.
Table Name
Target table (table_name or schema.table_name). Required for insert, update, delete, drop_table, truncate, and bulk_load.
Data Mode
How data is provided for insert and update operations. Options:
| Label | ID |
|---|---|
| JSON Object | json |
| Key-Value Pairs | pairs |
| SQL Values | sql |
Insert Data
JSON object or array of objects representing the rows to insert. Shown for insert when dataMode is json.
Update Data (SET clause)
JSON object whose keys are column names and values are the new values. Shown for update when dataMode is json.
WHERE Clause
Filter condition for update and delete operations (e.g. id = 123 AND status = 'active').
Stage Name
Snowflake stage reference for bulk load (e.g. @my_stage or @%table_name). Shown for bulk_load.
File Format
File format of the data in the stage. Shown for bulk_load. Options:
| Label | ID |
|---|---|
| CSV | csv |
| JSON | json |
| Parquet | parquet |
| Avro | avro |
| XML | xml |
Procedure Name
Name of the stored procedure to call. Shown for procedure.
Procedure Parameters
JSON array of positional arguments passed to the stored procedure (e.g. ["param1", 123]). Shown for procedure.
Use Parameterized Query
Toggle to use parameterized (bind-variable) queries for security. Shown for query, insert, update, and delete.
Query Parameters
JSON object of parameter bindings for the parameterized query (e.g. {"param1": "value1"}). Shown when useParameterizedQuery is on.
Output Format
How query results are returned. Shown for query, schema_info, and list_tables. Default: json. Options:
| Label | ID |
|---|---|
| JSON | json |
| CSV | csv |
| Table Preview | table |
| Raw Result | raw |
Enable Pagination
Toggle to paginate large result sets. Shown for query.
Page Size
Number of rows per page. Range: 10–10000. Default: 1000. Shown when pagination is on.
Page Number
Which page to retrieve (1-based). Range: 1–1000. Default: 1. Shown when pagination is on.
Enable Retry
Toggle to automatically retry failed operations.
Max Retries
Maximum retry attempts. Range: 1–10. Default: 3. Shown when retry is on.
Retry Delay (ms)
Milliseconds to wait between retry attempts. Range: 100–10000. Default: 1000. Shown when retry is on.
Enable Connection Pooling
Toggle to reuse database connections across invocations for better performance.
Max Connections
Maximum number of connections in the pool. Range: 1–50. Default: 10. Shown when pooling is on.
Enable Schema Detection
Toggle to automatically detect table schemas. Shown for insert, update, and schema_info.
Schema Table
Table name to run schema detection against. Shown when schema detection is on.
Enable Query Logging
Toggle to log all executed queries for debugging purposes.
Enable Metrics
Toggle to collect execution metrics and performance statistics.
Inputs & Outputs
-
Inputs:
accountName(string) — Snowflake account namedatabase(string) — Database namewarehouse(string) — Virtual warehouse nameschema(string) — Schema nameusername(string) — Username for authenticationpassword(string) — Password for authenticationrole(string) — Security role to assumeconnectionMode(string) — Authentication methodoauthToken(string) — OAuth token for authenticationprivateKey(string) — Private key for key pair authenticationprivateKeyPassphrase(string) — Private key passphraseclientSessionKeepAlive(boolean) — Keep session aliveconnectionTimeout(number) — Connection timeout in secondsqueryTimeout(number) — Query timeout in secondsoperation(string) — Operation to performsqlQuery(string) — SQL query to executetableName(string) — Target table namedataMode(string) — Data input formatinsertData(json) — Data to insertupdateData(json) — Data to updatewhereClause(string) — WHERE clause for update/deletestageName(string) — Stage name for bulk operationsfileFormat(string) — File format for bulk loadprocedureName(string) — Stored procedure nameprocedureParams(json) — Procedure parametersuseParameterizedQuery(boolean) — Use parameterized queriesparameters(json) — Query parametersoutputFormat(string) — Output formatenablePagination(boolean) — Enable result paginationpageSize(number) — Number of rows per pagepageNumber(number) — Page number to retrieveenableRetry(boolean) — Enable retry on failuremaxRetries(number) — Maximum number of retriesretryDelay(number) — Delay between retries in millisecondsenableConnectionPooling(boolean) — Enable connection poolingmaxConnections(number) — Maximum number of pooled connectionsenableSchemaDetection(boolean) — Enable automatic schema detectionschemaTable(string) — Table for schema detectionenableQueryLogging(boolean) — Enable query loggingenableMetrics(boolean) — Enable performance metrics
-
Outputs:
success(boolean) — Whether the operation was successfuldata(json) — Query results or operation datarowCount(number) — Number of affected or returned rowsexecutionTime(number) — Query execution time in millisecondsqueryId(string) — Snowflake query ID for trackingerror(string) — Error message if the operation failedschema(json) — Table schema informationtables(json) — List of tables in the databasecolumns(json) — Column information for the tablehasNextPage(boolean) — Whether there are more pages availabletotalPages(number) — Total number of pagescurrentPage(number) — Current page numberconnectionInfo(json) — Connection status and detailswarehouseInfo(json) — Warehouse utilization informationmetrics(json) — Performance metrics and statisticsqueryLog(json) — Query execution logloadStatus(json) — Bulk load operation status
Tools
Snowflake Data Warehouse (snowflake_connector) — Connects to Snowflake via the snowflake-sdk, establishes a connection (credentials, OAuth, or key pair), executes the requested SQL operation, and returns structured results including row data, row count, execution time, query ID, schema info, pagination metadata, and performance metrics. All parameters from the block are forwarded directly to this tool via a POST request to /api/tools/snowflake.
YAML Example
snowflake_1:
type: snowflake
name: "Snowflake"
inputs:
connectionMode: "credentials"
accountName: "mycompany.eu-central-1"
database: "ANALYTICS"
warehouse: "COMPUTE_WH"
schema: "PUBLIC"
username: "{{SNOWFLAKE_USER}}"
password: "{{SNOWFLAKE_PASSWORD}}"
operation: "query"
sqlQuery: "SELECT * FROM customers LIMIT 100;"
outputFormat: "json"
connections:
outgoing:
- target: next-block-id