Articles in this section

Snowflake Integration Guide

Snowflake is a cloud-based data platform that provides data warehouse-as-a-service (DWaaS) capabilities, allowing businesses to store, process, and analyze large volumes of data efficiently.

Integrating Snowflake with Forethought lets you use Actions to make API calls to your Snowflake database and retrieve data for use in Solve.

Setup Guide

To connect Snowflake to Forethought, first create a custom OAuth client in Snowflake. Then, obtain your Account, Client ID, and Client Secret. Once you have these credentials, use them to complete the integration with Forethought.

Create a Snowflake OAuth integration

First, you need to create a Snowflake OAuth integration. For reference, see Create a Snowflake OAuth integration.

1. Log in to your Snowflake account. 

2. On the left side of your homepage, click + Create > SQL Worksheet.
SQL worksheet.png

3. Copy and paste this SQL command:

CREATE SECURITY INTEGRATION forethought
      TYPE = oauth
      ENABLED = true
      OAUTH_CLIENT = custom
      OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
      OAUTH_REDIRECT_URI = 'https://integrations-api.forethought.ai/snowflake/authorize/success'
      OAUTH_ISSUE_REFRESH_TOKENS = TRUE
      OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;  

Note: The above query will set the expiry of any OAuth session to a maximum 7776000 seconds (90 days) allowed by Snowflake. This means that you will have to return to this page and re-authenticate a minimum of every 90 days to ensure uninterrupted service. Please contact your Snowflake support to have this limit raised if you want. 

4. Click the Run button.

5. You have now created an OAuth integration for Forethought.

Find your Account

In Snowflake, the Account is a unique identifier assigned to your Snowflake instance. To find your Account, follow these steps:

1. Create a SQL worksheet.

2. Copy and paste this SQL command:

SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();

3. Copy your Account and paste it into the Forethought Integrations page.

Retrieve the OAuth client ID and secret

1. Create a new SQL worksheet. 

2. Copy and paste the command below into your SQL worksheet:

SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS( 'FORETHOUGHT' );  

3. You will see the client ID and secret.

4. Copy the Client ID and Secret and paste these to the Forethought Integrations page.

Integrate with Forethought

1. In your Forethought dashboard, go to Settings > Integrations.
integrations1.png

2. Search for Snowflake.

3. Enter your Account, OAuth Client ID, and Client Secret.
Credentials.png

Note: When copying the Client ID and Client Secret, do not include quotation marks to prevent errors.

4. Click Connect.

5. Sign in to your Snowflake account when prompted.

6. Wait a few seconds for the connection to complete. You’ll be redirected back to your Forethought dashboard.
Snowflake 3.png

Your Snowflake is now connected with Forethought!

Using Snowflake in Actions

Now that you've integrated with Snowflake you can use it to authorize requests in Action Builder. Follow these steps:

  1. Navigate to Solve > Action Builder > + Create new action. For more details on creating actions, refer to this guide.

  2. Click Authorization.
    Authorization.png
  3. Select Integration as the authentication type.
    integration.png
  4. Choose Snowflake as the authentication value.
    Snowflake.png

This action will now use the Snowflake Credentials you setup to authenticate API Requests to your Snowflake Database.

If you encounter any issues, contact our support team.

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.

Support

  • Need help?

    Click here to submit a support request. We are here to assist you.

  • Business hours

    Monday to Friday 8am - 5pm PST excluding US holidays

  • Contact us

    support@forethought.ai