> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake

> This page outlines how to use the Snowflake integration to create and manage your data warehouse in Cargo.

Snowflake is a cloud-native data platform that provides fast, scalable data warehousing and analytics. Cargo's native integration with Snowflake allows you to use it as your system of record—powering data models, plays, and automated workflows.

<Note>
  To use Snowflake as your **system of record**, follow the full setup guide:
  [Set up Cargo on Snowflake](/reference/system-of-record/snowflake). It covers
  the required roles, RSA key authentication, IP allowlist, and the SOR
  settings form.
</Note>

## How to set up Snowflake

### Connecting your own Snowflake

To connect your existing Snowflake instance, you'll need:

* An active Snowflake account
* A dedicated database, warehouse, and user for Cargo
* Proper role permissions configured

### Connection details

To set up the connection, provide the following details when creating the connector:

| Field               | Description                                                |
| ------------------- | ---------------------------------------------------------- |
| **Account**         | Your Snowflake account identifier                          |
| **Database**        | The database created for Cargo (e.g., `cargo_db`)          |
| **Warehouse**       | The warehouse for Cargo operations (e.g., `cargo_wh`)      |
| **Role**            | The role with appropriate permissions (e.g., `cargo_role`) |
| **User**            | The Cargo service user (e.g., `cargo_user`)                |
| **Password**        | The user's password (for password authentication)          |
| **RSA Private Key** | The user's private key (for RSA key pair authentication)   |

### Authentication methods

Cargo supports two authentication methods for Snowflake:

1. **Password authentication** – Use a username and password to connect
2. **RSA key pair authentication** – Use a public/private key pair for enhanced security

To use RSA key pair authentication, provide your private key instead of a password when configuring the connection. This method is recommended for production environments as it provides stronger security.

***

## Snowflake actions

Once connected, you can use Snowflake in your workflows with the following actions:

### Insert

Insert new records into a Snowflake table.

**Configuration**

| Field        | Description                                        |
| ------------ | -------------------------------------------------- |
| **Database** | The Snowflake database containing the target table |
| **Schema**   | The schema containing the target table             |
| **Table**    | The table to insert data into                      |
| **Mappings** | Map columns to values using expressions            |

**Use cases**

* **Lead capture** – Insert new leads from form submissions or enrichment workflows
* **Event logging** – Record workflow events and outcomes
* **Data aggregation** – Store computed results for reporting

### Update

Update existing records in a Snowflake table based on a matching column.

**Configuration**

| Field               | Description                                        |
| ------------------- | -------------------------------------------------- |
| **Database**        | The Snowflake database containing the target table |
| **Schema**          | The schema containing the target table             |
| **Table**           | The table to update                                |
| **Matching Column** | The column to match records against                |
| **Matching Value**  | The value to match (supports expressions)          |
| **Mappings**        | Map columns to new values using expressions        |

**Use cases**

* **Data enrichment** – Update records with enriched data from external sources
* **Status updates** – Mark records as processed or update stages
* **Sync external changes** – Keep Snowflake in sync with CRM or other systems

### Upsert

Create new records or update existing ones based on a matching column.

**Configuration**

| Field               | Description                                        |
| ------------------- | -------------------------------------------------- |
| **Database**        | The Snowflake database containing the target table |
| **Schema**          | The schema containing the target table             |
| **Table**           | The table to upsert into                           |
| **Matching Column** | The column to match records against                |
| **Matching Value**  | The value to match (supports expressions)          |
| **Mappings**        | Map columns to values using expressions            |

**Use cases**

* **Data sync** – Keep your warehouse updated regardless of whether records exist
* **Idempotent operations** – Safely retry operations without creating duplicates
* **Master data management** – Maintain a single source of truth

### Delete

Delete records from a Snowflake table based on a matching column.

**Configuration**

| Field               | Description                                        |
| ------------------- | -------------------------------------------------- |
| **Database**        | The Snowflake database containing the target table |
| **Schema**          | The schema containing the target table             |
| **Table**           | The table to delete from                           |
| **Matching Column** | The column to match records against                |
| **Matching Value**  | The value to match (supports expressions)          |

**Use cases**

* **Data cleanup** – Remove outdated or invalid records
* **GDPR compliance** – Delete personal data on request
* **Workflow automation** – Remove processed records from staging tables

***

## Snowflake data models

Cargo allows you to create data models on top of your Snowflake data that can be used to trigger Plays and power workflows.

### Creating Snowflake data models

To create a Snowflake data model:

1. Navigate to **Data Models** in Cargo
2. Click **Create data model**
3. Select **Snowflake** as the source
4. Configure the following fields:

| Field             | Description                                                 |
| ----------------- | ----------------------------------------------------------- |
| **Name**          | Choose a descriptive name for your model                    |
| **Slug**          | Set a unique identifier that cannot be changed once created |
| **Database**      | Select the Snowflake database containing your data          |
| **Schema**        | Select the schema containing your data                      |
| **Table**         | Select the table or view to model                           |
| **ID Column**     | The column containing unique record identifiers             |
| **Title Column**  | The column to display as the record title                   |
| **Cursor Column** | (Optional) Column for incremental syncing (date or number)  |

### Using Snowflake data models

Once created, your Snowflake data model can be used to:

* **Trigger Plays** – Start automated workflows when data changes
* **Power enrichment** – Use Snowflake data to enrich records in workflows
* **Create segments** – Filter and target specific records from your data

***

## Network configuration

If you're using Snowflake's Allowed IPs network policy, add these Cargo IP addresses to your whitelist:

* `3.251.34.134`
* `54.220.135.99`
* `79.125.105.52`

***

## Security

* All Snowflake connections are encrypted using SSL/TLS
* Credentials are securely stored and encrypted at rest
* Cargo supports RSA key-pair authentication for enhanced security
* Cargo never overwrites existing tables—it always creates its own
