Snowflake with key pair icon

Snowflake with key pair

Get, add and update data in Snowflake

Overview

This node allows executing SQL queries and performing data manipulation operations on a Snowflake database. It supports three authentication methods: password-based, JWT key pair, and browser-based authentication. The primary operation covered here is Execute Query, which runs arbitrary SQL queries against the Snowflake instance.

Typical use cases include:

  • Running SELECT queries to retrieve data for further processing or analysis.
  • Executing complex SQL statements that may involve joins, filters, or aggregations.
  • Quickly querying Snowflake data warehouses from within an n8n workflow without writing custom code.

Example:
You want to fetch product IDs and names where the ID is less than 40:

SELECT id, name FROM product WHERE id < 40

This node executes the query and returns the results as JSON objects.

Properties

Name Meaning
Authentication Method used to authenticate with Snowflake. Options: "Snowflake Password", "Snowflake JWT", "Browser"
Query The SQL query string to execute. Supports full SQL syntax. Example: SELECT * FROM table

Output

The output is a JSON array of objects representing the rows returned by the executed SQL query. Each object corresponds to one row, with keys matching the column names from the query result.

For example, if the query is:

SELECT id, name FROM product WHERE id < 40

The output might look like:

[
  { "id": 1, "name": "Product A" },
  { "id": 2, "name": "Product B" }
]

No binary data output is produced by this operation.

Dependencies

  • Requires a valid Snowflake account and connection credentials.
  • Needs proper configuration of authentication credentials in n8n (password, JWT key pair, or browser-based).
  • Uses internal helper functions to create and manage connections and execute queries.

Troubleshooting

  • Authentication failures: Ensure the selected authentication method matches the configured credentials and that credentials are valid and have sufficient permissions.
  • SQL syntax errors: Invalid SQL queries will cause execution errors. Verify the query syntax directly in Snowflake or another SQL client.
  • Connection issues: Network problems or incorrect account details can prevent connecting to Snowflake. Check network access and credential correctness.
  • Empty results: If the query returns no rows, the output JSON array will be empty. Confirm the query logic and data availability.
  • Long-running queries: Complex queries may take time; consider optimizing SQL or using asynchronous patterns if supported.

Links and References

Discussion