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

# Snowflake

> Query data from completed runs through read-only Snowflake views

Kadoa configures the destination for you through the [Support Center](/docs/support-center).

## Before you begin

* A Snowflake role with `IMPORT SHARE` and `CREATE DATABASE` privileges. `ACCOUNTADMIN` has both.
* Access to a Snowflake warehouse for queries.

Find your account details:

```sql theme={null}
select
  current_organization_name() as organization_name,
  current_account_name() as account_name,
  current_region() as snowflake_region;
```

If the query fails, open the account selector in Snowsight and select **View account details**.
Copy the **Account/Server URL** instead.

## Request the destination

Send these details or your Account/Server URL through the [Support Center](/docs/support-center):

| Detail            | Example               |
| ----------------- | --------------------- |
| Organization name | `<ORGANIZATION_NAME>` |
| Account name      | `<ACCOUNT_NAME>`      |
| Region            | `<SNOWFLAKE_REGION>`  |
| Activity log      | Off (default) or on   |

Historical activity events are not included.

Kadoa confirms availability for your region. Accounts in Kadoa's region use a direct share. Other regions or clouds require a private listing.

## Import the share

For a direct share, complete these steps:

<Steps>
  <Step title="Find the share">
    In Snowsight, open **Data sharing** > **External sharing** > **Shared with you**.
    Under **Ready to Get**, select the share whose name starts with `KADOA_SHARE_`.
  </Step>

  <Step title="Create a database">
    Enter a database name such as `KADOA`.
    Choose the roles that can query it.
    Select **Get Data**.
  </Step>

  <Step title="Send the verification code">
    In your new database, find the schema whose name starts with `TEAM_`.
    Replace `<KADOA_SCHEMA>` with that schema name.
    If you chose another database name, replace `KADOA` too:

    ```sql theme={null}
    select verification_nonce
    from KADOA.<KADOA_SCHEMA>.connector_verification;
    ```

    Send the returned code to Support. Kadoa then publishes data to the same database and schema.
  </Step>
</Steps>

For a private listing, open **Shared with you** > **Privately shared listings**.
Select the listing whose name starts with `KADOA_LISTING_`. Complete the [listing import steps](https://docs.snowflake.com/en/collaboration/consumer-listings-access).
Support provides the verification instructions for your listing.

## Verify the first delivery

Allow about 5 minutes after a workflow run completes.
Select your warehouse, database, and Kadoa schema in Snowsight.

Find the delivered run and its data view:

```sql theme={null}
select r.job_id, r.schema_version, r.row_count, r.shared_at, v.view_name
from workflow_runs r
join workflow_schema_versions v
  on r.workflow_id = v.workflow_id
  and r.schema_version = v.schema_version
  and r.schema_fingerprint = v.schema_fingerprint
where r.workflow_id = '<WORKFLOW_ID>'
order by r.shared_at desc
limit 20;
```

Use the returned `view_name` and `job_id` to count that run's rows:

```sql theme={null}
select count(*) as row_count
from <VIEW_NAME>
where job_id = '<JOB_ID>';
```

Confirm that `job_id` and the row count match the same run in the Kadoa dashboard.

## Query the shared views

| View                            | Contains                                                    |
| ------------------------------- | ----------------------------------------------------------- |
| `WORKFLOW_RUNS`                 | Delivered runs, schema versions, row counts, and timestamps |
| `WORKFLOW_SCHEMA_VERSIONS`      | Workflow IDs and their generated view names                 |
| `WORKFLOW_SCHEMA_FIELDS`        | Field names, types, and positions in `field_order`          |
| `WF_<GENERATED_ID>__V<VERSION>` | Workflow data for one schema version                        |
| `WF_<GENERATED_ID>__LATEST`     | Workflow data for the latest schema version                 |

Get exact view names from `WORKFLOW_SCHEMA_VERSIONS`. Do not substitute a workflow ID into a view name.

Each data view can contain multiple runs. Filter by `job_id` to query one run. Versioned views keep their schema when a new version appears.

Optional views include `ACTIVITY_LOG` and `TPL_<GENERATED_ID>__LATEST` for template data.

## Load cloud storage exports with Snowpipe

You can also load files from [Amazon S3](/docs/destinations/amazon-s3) or [Google Cloud Storage](/docs/destinations/google-cloud-storage) with a Snowpipe you manage.
This option uses bucket delivery instead of the native Snowflake share.

1. Complete a workflow run so a sample data file exists.
2. Limit the pipe to one workflow's path and one format, such as Parquet. Exclude other formats and workflow health files.
3. Configure storage access and automatic loading with Snowflake's [S3 guide](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-auto-s3) or [GCS guide](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-auto-gcs).

See [file paths](/docs/destinations/data-destinations#file-layout-and-path-template) for the default layout.
If Kadoa hosts your S3 bucket, send Support the pipe's `notification_channel` value to configure event notifications.

## What's next

<CardGroup cols={2}>
  <Card title="Amazon S3" icon="aws" href="/docs/destinations/amazon-s3">
    Set up bucket delivery.
  </Card>

  <Card title="Databricks" icon="database" href="/docs/destinations/databricks">
    Use Delta Sharing.
  </Card>

  <Card title="How data destinations work" icon="arrows-rotate" href="/docs/destinations/data-destinations">
    See delivery timing, formats, and file paths.
  </Card>
</CardGroup>
