Snowflake
The Snowflake piece in ZBrain Flow provides integration with Snowflake's cloud data platform, allowing you to interact with your data warehouse directly from your workflows. This powerful connector enables you to execute SQL queries and manipulate data without manual intervention. With Snowflake integration, you can build automations that retrieve analytics data, perform database operations, load information into data warehouses, and synchronize data between Snowflake and other business systems. This piece is ideal for data teams looking to automate reporting, streamline ETL processes, and incorporate data warehouse operations into their broader business workflows.
How to Use Snowflake in ZBrain Flow
Select Snowflake as Your Connection
Click on the '+' button in the Flow and search for Snowflake.
Select Snowflake.
Decide on the action you need, then select it. ZBrain Flow provides several options:
Run Query – Execute a single SQL query on your Snowflake instance.
Run Multiple Queries – Execute multiple SQL statements in sequence.
Insert Row – Add new data records to Snowflake tables.
How to Connect to Your Snowflake Data Warehouse
Before using any Snowflake actions in ZBrain Flow, you'll need to set up a connection to your Snowflake instance. This is a one-time setup that will allow you to access your data warehouse securely.
To create your Snowflake connection:
From any Snowflake action, click on the connection dropdown and select 'Create connection'.
In the popup window that appears, you'll need to:
Enter a descriptive 'Connection Name' to identify this Snowflake connection
In the 'Account' field, enter your Snowflake account identifier (e.g., xy12345.us-east-1)
In the 'Username' field, enter your Snowflake user login name
In the 'Password' field, enter your Snowflake password
In the 'Database' field, optionally specify the default database to use
In the 'Role' field, optionally specify the security role to use
In the 'Warehouse' field, optionally specify the virtual warehouse to use for the session after connecting.
Click 'Save' to store this connection
How to Run a Query in Snowflake
Configuration Steps:
Connect to your Snowflake instance following the steps in the "How to Connect to Your Snowflake Data Warehouse" section.
In the 'SQL query' field, enter the SQL statement you want to execute.
For example:
sqlSELECT * FROM customers WHERE region = 'Northeast' LIMIT 100;
You can use placeholders (:1, :2, etc. or ?) in your query for parameterized values.
If using parameters, click 'Add Item' in the 'Parameters' section for each value you need to pass. This prevents SQL injection by properly sanitizing inputs.
If your query may take longer to execute, you can optionally modify the 'Query timeout (ms)' value (default 30000). This integer indicates the maximum number of milliseconds a query must wait to complete before timing out.
The 'Application name' field identifies your connection in Snowflake logs.
How to Run Multiple Queries in Snowflake
Configuration Steps:
Connect to your Snowflake instance following the steps in the "How to Connect to Your Snowflake Data Warehouse" section.
Click 'Add Item' in the 'SQL queries' section for each SQL statement you want to execute.
Enter your statements in the order you want them executed.
For example:
sqlCREATE TABLE IF NOT EXISTS temp_data AS SELECT * FROM source_table WHERE date = :1;sqlUPDATE customers SET status = 'active' WHERE customer_id IN (SELECT customer_id FROM temp_data);
Use numbered placeholders (:1, :2, etc.) for parameterized values.
If using parameters, click 'Add Item' in the 'Parameters' section for each value you need to pass. These parameters are shared across all queries.
Toggle 'Use Transaction' on if you want all queries to be treated as a single operation. When enabled, if any query fails, all changes will be rolled back. This ensures database consistency for multi-step operations.
Optionally modify the 'Query timeout (ms)' value if your queries may take longer to execute.
The 'Application name' field identifies your connection in Snowflake logs.
How to Insert Rows into Snowflake Tables
Configuration Steps:
Connect to your Snowflake instance following the steps in the "How to Connect to Your Snowflake Data Warehouse" section.
In the 'Database' field, select the name of the database containing your target table.
In the 'Schema' field, enter the schema name where your table is located (e.g., 'PUBLIC').
In the 'Table' field, enter the name of the table where you want to insert data.
Last updated