Skip to main content

Snowflake: Export guide

Configure your Snowflake environment and set up a direct export from Funnel using a programmatic access token.

If you would like to access your Funnel data in a Snowflake data warehouse, you can do so by setting up a new Snowflake Export. This article covers how to configure your Snowflake environment with a dedicated user and permissions, and how to authenticate the connection in Funnel using a programmatic access token (PAT).

​

To export data to Snowflake, first run a series of SQL commands in your Snowflake account to create a specific user, role, and network policy. This ensures Funnel has the correct permissions and network access to write data to your specified database.

​

Tip: You can also create a Snowflake export from Claude, ChatGPT or another AI client connected to Funnel MCP. See Manage exports using Funnel MCP.

​

Step 1. Configure Snowflake

You will need to run the following SQL commands in a Snowflake worksheet to set up the necessary environment. If you already have a user and created the required roles granted permissions to the user, go to step 1.3.

​

(Optional) Step 1.1 Create user and database

Set up the service user and the database where Funnel will write your data.

-- Create a specific user for the Funnel export  
CREATE USER IF NOT EXISTS "funnel_export" LOGIN_NAME="funnel_export" TYPE = service;  
-- Create the database where data will be stored  
CREATE DATABASE funnel_database;  
-- (Optional) Create a specific warehouse for Funnel exports  
CREATE WAREHOUSE funnel_warehouse WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 30;

(Optional) Step 1.2 Create role and grant permissions

Create a specific role to manage permissions and assign it to the new user.

-- Create a new role  
CREATE ROLE funnel_role;  
-- Grant usage on the database and warehouse to the role  
GRANT USAGE ON DATABASE funnel_database TO ROLE funnel_role;  
GRANT ROLE funnel_role to USER "funnel_export";  
-- Set default role and warehouse for the user  
ALTER USER "funnel_export" SET DEFAULT_ROLE = funnel_role DEFAULT_WAREHOUSE = funnel_warehouse;  
-- Grant permissions to create schemas and use the warehouse  
GRANT USAGE ON WAREHOUSE funnel_warehouse TO ROLE funnel_role;  
GRANT CREATE SCHEMA ON DATABASE funnel_database TO ROLE funnel_role;

Step 1.3 Set up network rules (allowlist IP addresses)

Create a network rule to allow Funnel's IP addresses to access your instance. Choose the IP that matches the service you are using:

​

​

Run the following commands:

Note: The example uses the US IP 54.81.136.8.

-- Create the Network Rule  
CREATE NETWORK RULE FUNNEL_IP TYPE = 'IPV4' VALUE_LIST = ('54.81.136.8');  
-- Create the Network Policy  
CREATE NETWORK POLICY FUNNEL_NETWORK_RULE;  
-- Apply the rule to the policy  
ALTER NETWORK POLICY FUNNEL_NETWORK_RULE SET ALLOWED_NETWORK_RULE_LIST = (FUNNEL_IP);  
-- Apply the policy to the Funnel user  
ALTER USER "funnel_export" SET NETWORK_POLICY = FUNNEL_NETWORK_RULE;

Step 1.4 Generate authentication token

Generate the programmatic access token (PAT) required to authenticate the connection in Funnel.

​

Note: You can adjust the DAYS_TO_EXPIRY value, for example to 150 days, as needed for your security requirements.

ALTER USER "funnel_export" ADD PAT funnel_token ROLE_RESTRICTION = funnel_role DAYS_TO_EXPIRY = 150;

Important: Copy the generated token immediately. You will need to paste this into Funnel in the next step.

​

Step 2. Set up the export in Funnel

After you configure your Snowflake environment, you can set up the export in Funnel.

​

  1. Go to the Export page in Funnel, and click + Create Export.

    ​

  2. Select Snowflake as your destination. You can search for the destination in the search bar.

    ​

  3. Enter a name for this export.

    ​

  4. Enter your Snowflake Account Identifier. This is your unique account URL prefix. For example, it may look like ORGANIZATION-xy12345.

    ​

  5. Enter the table name, database name, schema name and user name you created.

    ​

  6. Paste the token you generated in step 1.4 in the Programmatic Access Token (PAT) field.

    ​

  7. Choose the data you want to export. You can customize this data using the following settings:

    ​

    • Import settings from a view

    • Choose fields and edit the field format

    • Filter data

    • Choose currency

    ​

  8. Select the time series for your export.

    ​

  9. Select a date range. Data will be overwritten so include the entire period you want to be visible in Snowflake. If you for example select Last 6 months data will not accumulate and you will always have exactly the last 6 months in your Snowflake table.

    ​

  10. Schedule your export.

    ​

  11. (Optional) Add any notes if required.

    ​

  12. Save the export, and click Run job to start sending data immediately.

​

Tip: Refer the Account identifiers section in Snowflake documentation to learn how to identify your account details that's needed in steps 2.4, 2.5 and 2.6.

​

After you run the export has run, your data will be available in the funnel_database or the specific database you created and is ready to be queried using standard SQL.

Did this answer your question?