Skip to main content
Use Snowflake workload identity federation to connect as a service user that trusts your Trigger.dev environment. The Snowflake driver sends the OIDC token itself, so there’s no exchange step and no SNOWFLAKE_PASSWORD or private key stored anywhere. Follow the OIDC prerequisites, then go to the OIDC page for your environment and copy the issuer URL and subject.

Configure Snowflake

Create a service user for each environment. Replace the issuer and subject with the values from the dashboard:
With no OIDC_AUDIENCE_LIST, Snowflake expects the audience snowflakecomputing.com, which the task requests below. SUBJECT can be up to 255 characters, which fits every Trigger.dev subject in practice.

Connect in your task

Workload identity needs the Snowflake Node.js driver with WORKLOAD_IDENTITY support:
Set the authentication options authenticator, workloadIdentityProvider, and token:
/trigger/query-snowflake.ts
The token is only used to open the connection, so request it right before connecting. Open the connection inside run and close it before the run ends.

Remove the old credential

Once runs in every deployed environment connect this way, delete SNOWFLAKE_PASSWORD, SNOWFLAKE_PRIVATE_KEY, SNOWFLAKE_PRIVATE_KEY_PATH, and SNOWFLAKE_PRIVATE_KEY_PASSPHRASE from those environments on the Environment Variables page, then remove the password or key from the old Snowflake user. SNOWFLAKE_ACCOUNT isn’t a secret and can stay. Local Development runs can’t mint OIDC tokens. Use your own Snowflake login there when ctx.environment.type === "DEVELOPMENT".