Create a Snowflake User for Contextflo

Step-by-step SQL script to create a dedicated Snowflake user, role, and warehouse for Contextflo

Last updated: 2/6/2026

Create a dedicated Snowflake user with read-only access for Contextflo. This script sets up a role, user, warehouse, and grants the necessary permissions.

Prerequisites

  • Admin access to Snowflake (ACCOUNTADMIN or SECURITYADMIN role)
  • Knowledge of which database(s) and schema(s) you want Contextflo to access

Complete Setup Script

Run this script in a Snowflake worksheet. Update the variables at the top before running.

Loading code sample...

What This Script Does

  1. Creates a dedicated role - CONTEXTFLO_ROLE
  2. Creates a user - CONTEXTFLO_USER with the role assigned
  3. Creates an X-Small warehouse - With auto-suspend after 60 seconds
  4. Grants database and schema access - Usage permissions on your database/schema
  5. Grants SELECT on existing objects - All tables, views, materialized views, and external tables
  6. Grants SELECT on future objects - New tables/views are automatically accessible

Connection Details for Contextflo

After running the script, use these details to connect in Contextflo:

  • Account: Your Snowflake account identifier (e.g., orgname-accountname)
  • Username: CONTEXTFLO_USER
  • Password: The password you set in the script
  • Warehouse: CONTEXTFLO_WAREHOUSE
  • Role: CONTEXTFLO_ROLE (optional)

Verify Permissions

To check what permissions were granted:

Loading code sample...

To test as the new user:

Loading code sample...

Security Notes

  • Read-only access: This setup only grants SELECT permissions. Contextflo cannot modify or delete your data.
  • Auto-suspend: The warehouse automatically suspends after 60 seconds of inactivity to minimize costs.
  • Strong password: Use a secure password with at least 16 characters including numbers and symbols.

Troubleshooting

"Insufficient privileges" Error

Run the grants again using SYSADMIN role:

Loading code sample...

User Cannot Access Warehouse

Ensure the warehouse grant was applied:

Loading code sample...

New Tables Not Accessible

The FUTURE grants only apply to tables created after the grant. For existing tables, run:

Loading code sample...

Next Steps