Snowflake Analytics — Usage Guide
Legion analytics data is replicated from MongoDB into Snowflake via DMS and Snowpipe. This doc covers how to access, explore, query, and build dashboards.
Table of Contents
- Access
- Inviting New Users
- Data Architecture
- Exploring Data (Data Preview)
- Canonical Organization ID
- Querying
- Dashboards
- Maintaining the Schema
- Infrastructure Reference
Access
- Go to app.snowflake.com and sign in
- Select the LEGION_ANALYTICS database from the left sidebar
Inviting New Users
Users with the ACCOUNTADMIN or USERADMIN role can invite new users to Snowflake.
- Go to Governance & Security → Users tab
- Click Invite
- Enter the user's Legion email address
- Assign the
SYSADMINrole - Send the invite
After accepting the invite, the new user should enable MFA on their account.
Data Architecture
Two schemas are relevant:
| Schema | Purpose |
|---|---|
RAW_CLEAN | Pipeline objects — raw tables, deduplication, pipe, stage. Do not query directly unless debugging ingestion. |
ANALYTICS | Views for everyday querying — start here. |
┌─────────────────────────────────────────────────────────────────┐
│ RAW_CLEAN schema │
│ │
│ S3/GCS Stage │
│ │ │
│ │ PIPE_EVENTS (Snowpipe — auto-ingests JSON files) │
│ ▼ │
│ RAW_EVENTS append-only, one row per DMS event │
│ │ │
│ │ deduplication (keep latest per object, every 1h) │
│ ▼ │
│ EVENTS_DEDUPED latest snapshot per (type, id, region) │
│ │
└──────────────────────────────┬──────────────────────────────────┘
│ views read from EVENTS_DEDUPED
▼
┌─────────────────────────────────────────────────────────────────┐
│ ANALYTICS schema │
│ │
│ AUDIT_V audit events (recordings, runs) │
│ WORKFLOWS_V workflow records │
│ WORKFLOW_GRAPHS_V workflow graph versions │
│ USECASES_V use case / template records │
│ USERS_V user records │
│ DECISIONS_V AI step decisions │
│ INVESTIGATION_STEP_EVENTS_V step lifecycle events │
│ ORGANIZATIONS_V org name + ID mapping │
│ │
└─────────────────────────────────────────────────────────────────┘