Skip to main content
Skip table of contents

Snowflake - Download Query Results to Workflows

Overview

Turn the results of your SQL SELECT statement into a CSV file. Extract your Snowflake data into files for easier delivery to clients and partners.

Variables

NameReferenceTypeRequiredDefaultOptionsDescription
UsernameSNOWFLAKE_USERNAMEAlphanumericNone-The Snowflake Username that has access to the table, schema, and warehouse that you want to use.
PasswordSNOWFLAKE_PASSWORDPasswordNone-The password associated with your Username.
Account NameSNOWFLAKE_ACCOUNTAlphanumericNone-Typically found in the URL you use to access Snowflake, before `.snowflakecomputing.com`.
WarehouseSNOWFLAKE_WAREHOUSEAlphanumericNone-The name of the Warehouse you want your query to run in. If left blank, will use the default Warehouse associated with the Username.
DatabaseSNOWFLAKE_DATABASEAlphanumericNone-The name of the Database that you want to run a query against.
SchemaSNOWFLAKE_SCHEMAAlphanumericNone-The name of the Schema you want to run a query against. If left blank, it's expected that your query will include the schema in it.
QuerySNOWFLAKE_QUERYAlphanumericNone-A SQL query with a SELECT statement that returns data.
Workflows File NameSNOWFLAKE_DESTINATION_FILE_NAMEAlphanumericNone-The file name that you want your generated CSV to have.
Workflows Folder NameSNOWFLAKE_DESTINATION_FOLDER_NAMEAlphanumericNone-The folder structure that you want your CSV to be created in. If left blank, the file will be created in the home directory.
Include Column Names as Header?SNOWFLAKE_FILE_HEADERBooleanTrue-If checked, your CSV file will include a header row with column names.
User RoleSNOWFLAKE_USER_ROLEAlphanumeric--The optional role of the database user
Private KeySNOWFLAKE_PRIVATE_KEYAlphanumeric--The optional private key to use for authentication
Private Key PassphraseSNOWFLAKE_PRIVATE_KEY_PASSPHRASEPassword--The passphrase for the private key file. Is required only if authenticating with private key

YAML

Below is the YAML template

YAML

source:
  template: Snowflake - Download Query Results to Workflows
  inputs:
    SNOWFLAKE_USERNAME:
    SNOWFLAKE_PASSWORD:
    SNOWFLAKE_ACCOUNT:
    SNOWFLAKE_WAREHOUSE:
    SNOWFLAKE_DATABASE:
    SNOWFLAKE_SCHEMA:
    SNOWFLAKE_QUERY:
    SNOWFLAKE_DESTINATION_FILE_NAME:
    SNOWFLAKE_DESTINATION_FOLDER_NAME:
    SNOWFLAKE_FILE_HEADER: true
    SNOWFLAKE_USER_ROLE:
    SNOWFLAKE_PRIVATE_KEY:
    SNOWFLAKE_PRIVATE_KEY_PASSPHRASE:
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 200
    - 201
    - 202
    - 203
    - 204
    - 205
    - 206
    - 207
    - 208
    - 209
    - 249
    - 101
    - 102
    - 103
    - 104
    - 105
    - 106
    - 107

      
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.