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

# Snowflake

Snowflake is a cloud data warehouse used to store and analyze large volumes of structured data. Connecting Snowflake to Duvo lets your agents query your warehouse directly, pulling metrics, exploring tables, and using live data to inform decisions and reports.

<Note>
  Snowflake is **read-only** in Duvo. Agents can run `SELECT`-style queries but cannot modify your data.
</Note>

## Setup

<Steps>
  <Step title="Confirm prerequisites" icon="circle-check">
    <Check>A Snowflake account with key-pair authentication enabled for the connecting user.</Check>
    <Check>An RSA key pair generated for the user, with the public key registered in Snowflake. You provide the private key to Duvo.</Check>
    <Check>A compute warehouse available for the role you plan to use.</Check>

    <Tip>
      New to key-pair auth? Follow [Snowflake's key-pair authentication guide](https://docs.snowflake.com/en/user-guide/key-pair-auth) to generate the keys and register the public key.
    </Tip>
  </Step>

  <Step title="Grant the required permissions" icon="key">
    The Snowflake role you specify must have:

    * `USAGE` on the target warehouse, database, and schema
    * `SELECT` on any tables or views your agents need to read

    <Warning>
      The role determines exactly what data the agent can reach. Scope it to only the databases, schemas, and tables the agent needs.
    </Warning>
  </Step>

  <Step title="Add the connection in Duvo" icon="plug">
    On the [Connections page](https://app.duvo.ai/integrations), open Snowflake and fill in these fields:

    <ParamField body="Private Key" type="PEM" required>
      The RSA private key for authentication, in PEM format. Include the full key with the `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----` lines.
    </ParamField>

    <ParamField body="Account" type="string" required>
      Your Snowflake account identifier, either `orgname-accountname` (e.g. `myorg-myaccount`) or the legacy locator (e.g. `xy12345.us-east-1`). Find it in your account URL or under **Admin > Accounts**.
    </ParamField>

    <ParamField body="Username" type="string" required>
      The Snowflake user configured with your public key.
    </ParamField>

    <ParamField body="Database" type="string" required>
      The default database to connect to.
    </ParamField>

    <ParamField body="Schema" type="string" required>
      The default schema within the database.
    </ParamField>

    <ParamField body="Warehouse" type="string" required>
      The compute warehouse to use for queries.
    </ParamField>

    <ParamField body="Role" type="string" required>
      The Snowflake role to assume for the session. This determines what data the agent can access.
    </ParamField>

    <ParamField body="Private Key Passphrase" type="string">
      Optional. The passphrase used to decrypt the private key, if the key is encrypted.
    </ParamField>
  </Step>
</Steps>

<Accordion title="Third-party documentation" icon="book">
  * [Snowflake key-pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth) — generating RSA keys and assigning the public key to a user.
  * [Snowflake account identifiers](https://docs.snowflake.com/en/user-guide/admin-account-identifier) — how to find your account identifier.
  * [Snowflake access control](https://docs.snowflake.com/en/user-guide/security-access-control-overview) — roles, privileges, and granting SELECT access.
</Accordion>

## Capabilities

* **Run read-only SQL queries** — execute SELECT, WITH (CTEs), SHOW, DESCRIBE, and EXPLAIN statements against your warehouse. Write operations are not permitted.
* **Discover tables and schemas** — list all tables in a given database and schema, including row counts and comments, so agents can understand the data landscape before querying.
* **Verify connection details** — check the active user, role, database, schema, and warehouse to confirm the session is configured correctly.
* **Export large result sets** — query results exceeding 5,000 rows are automatically exported as CSV files for downstream analysis rather than returned inline.

## Key Benefits

* **Live warehouse data** — agents read directly from Snowflake instead of relying on stale exports or manual data pulls.
* **Safe by design** — only read-only operations are allowed, so your data cannot be modified through Duvo.
* **Role-scoped access** — the Snowflake role you specify controls exactly which databases, schemas, and tables the agent can reach.
* **Large-scale results** — automatic CSV export handles result sets of any size without truncation.
* **Key-pair authentication** — no passwords are stored; authentication uses RSA key pairs for stronger security.

## Works Well With

<CardGroup cols={3}>
  <Card title="Google Sheets" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/google-sheets.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=0ef8d55e05c34e7a4a618933bdf0ceb3" href="/user-guide/connections/available-connections/google-sheets" width="24" height="24" data-path="images/connections/google-sheets.svg">
    Query Snowflake and write the results into a spreadsheet for stakeholder review or recurring reports.
  </Card>

  <Card title="Gmail" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/gmail.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=ad4e229283f3fe2f26c0f96a49f28e13" href="/user-guide/connections/available-connections/gmail" width="88" height="66" data-path="images/connections/gmail.svg">
    Pull warehouse metrics and include them in automated email summaries or alerts.
  </Card>

  <Card title="Slack" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/slack.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=8a64bdd1af39e903923e4a273b4a4618" href="/user-guide/connections/available-connections/slack" width="512" height="512" data-path="images/connections/slack.svg">
    Monitor key business thresholds and post a notification to a channel when values change.
  </Card>
</CardGroup>

## Outcome Examples

<AccordionGroup>
  <Accordion title="Scheduled KPI report" icon="calendar">
    Every Monday, a summary of last week's revenue, order volume, and exception count is posted to your team's Slack channel or emailed to stakeholders. The agent queries your warehouse, calculates week-over-week changes, and distributes the formatted result automatically. No one needs to open Snowflake or prepare a report manually.
  </Accordion>

  <Accordion title="Threshold alert" icon="bell">
    An agent polls Snowflake every hour and fires a Slack notification when inventory drops below the reorder point, a fraud rate crosses a limit, or any other condition is met. It stays silent when everything is within bounds, so alerts stay signal, not noise.
  </Accordion>

  <Accordion title="On-demand data export to Google Sheets" icon="table">
    A stakeholder needs a fresh customer list, transaction export, or regional breakdown. The agent runs the query and writes the results into a named Google Sheet, including a "last refreshed" timestamp. Run on demand or on a schedule.
  </Accordion>
</AccordionGroup>

See [Snowflake Workflows](/user-guide/examples/snowflake-workflows) for step-by-step tutorials covering all three patterns.
