Openflow Connector for Salesforce Bulk API: Set up Snowflake

Note

This connector is subject to the Snowflake Connector Terms.

This topic describes the steps to set up Snowflake for the Openflow Connector for Salesforce Bulk API.

Prerequisites

Before you begin, ensure you have completed the following:

Create objects and grant privileges

As an Openflow administrator, perform the following tasks. With the default SNOWFLAKE_MANAGED authentication strategy, the runtime’s execute-as role is the identity the connector uses to access Snowflake, so you grant it the privileges below.

  1. Use a role with ACCOUNTADMIN privileges to set the role:

    USE ROLE ACCOUNTADMIN;
    
  2. Create the destination Snowflake database, if it does not exist:

    CREATE DATABASE IF NOT EXISTS <my_salesforce_db>;
    
  3. Create the destination schema in the database, if it does not exist:

    CREATE SCHEMA IF NOT EXISTS <my_salesforce_db>.<my_salesforce_schema>;
    
  4. Grant the required privileges to the runtime’s execute-as role.

    GRANT USAGE ON DATABASE <my_salesforce_db> TO ROLE OPENFLOW_<RUNTIME_NAME>_EXECUTE_AS_RL;
    GRANT USAGE ON SCHEMA <my_salesforce_db>.<my_salesforce_schema> TO ROLE OPENFLOW_<RUNTIME_NAME>_EXECUTE_AS_RL;
    GRANT CREATE TABLE, CREATE PIPE ON SCHEMA <my_salesforce_db>.<my_salesforce_schema> TO ROLE OPENFLOW_<RUNTIME_NAME>_EXECUTE_AS_RL;
    
  5. Create a warehouse for the connector (or use an existing one) and grant usage privileges to the execute-as role:

    -- Create a warehouse (skip if you wish to use an existing warehouse)
    CREATE OR REPLACE WAREHOUSE MY_WAREHOUSE WITH
     WAREHOUSE_SIZE = 'XSMALL'
     AUTO_SUSPEND = 300
     AUTO_RESUME = TRUE;
    
    GRANT USAGE, OPERATE ON WAREHOUSE MY_WAREHOUSE TO ROLE OPENFLOW_<RUNTIME_NAME>_EXECUTE_AS_RL;
    

Note

If you’re deploying the connector in Openflow - BYOC Deployments and using the KEY_PAIR authentication strategy instead of the recommended SNOWFLAKE_MANAGED, you’ll also grant this same execute-as role to a service user rather than relying on the runtime’s managed token. See Set up key-pair authentication for Openflow - BYOC Deployments to create the service user.

Next steps

Configure the connector in Openflow:

Openflow Connector for Salesforce Bulk API: Configure the connector

To use Iceberg tables as the destination, see Openflow Connector for Salesforce Bulk API: Iceberg table destinations.