Connect Snowflake
Connect with a password or private key
Click the node to open its settings, then select New connection.

Enter the required connection details into the form according to the table and notes below:
Connection Name
This is whatever you want to name the connection
User
Your chosen Snowflake account username
Password (Optional)
Your chosen Snowflake account password
Private Key (Optional)
Only if using key-pair authentication
Account
Your account identifier (see where to find below)
Warehouse
Your warehouse name (see where to find below)
Role
A role granted to the user with access to the required data
Database
Your database name (see where to find below)
Schema
Your schema name (see where to find below)
Account
This is your account identifier. Find it here:


Warehouse
Find it here:

Role
Use a role granted to the connection user. For read queries, grant USAGE on the warehouse, database, and schema, plus SELECT on the required tables or views. Add write privileges only for actions that modify data. Do not use ACCOUNTADMIN as the runtime connection role simply to bypass missing permissions.
Find the available role here:

Database
Find it here:

Schema
Find it here:

Connecting to Snowflake — OAuth2
For your organization's users to connect to Snowflake using OAuth2, you must first create an OAuth2 App inside Snowflake. Once this app is created, users can use it to sign-into Snowflake via OAuth2 in third-party applications.
Have a Snowflake administrator create the security integration below. This setup task requires administrative privileges; it does not determine the role that StackAI should use to query data. Replace <STACKAI_REDIRECT_URI> with the redirect URI shown in your StackAI connector configuration before running the script.
Once the integration has been created, run the following to get a client_id and client_secret:
Store this information as you will need it to make an OAuth2 connection.
Creating a custom OAuth connector
To use your personal Snowflake OAuth client in StackAI, you need to first create a custom connector in Settings -> Connectors. Here, select + New Connector.

Select Snowflake (OAuth2) and Create Connector.
Once you've created a new connector, it will be in draft until you add the required fields. Edit the Connector and add the client ID and client secret from Snowflake.
You have the option of setting custom scopes for your connector. If you'd like the connections your users make to always use a specific Snowflake role, replace the placeholder session:role:PUBLIC scope with session:role:{YOUR_ROLE}. If you'd like your connection to inherit the user's default role, you can just delete this placeholder scope.
Make sure the required fields are filled in, then hit Save.
Creating a connection with your Connector
When entering the new connection dialog, select Snowflake, then select the Connector you created. You should be redirected to sign in to Snowflake.

Connection fields and action reference
See Snowflake for the current connector fields and supported actions.
Was this helpful?

