Snowflake#
Snowflake is a cloud data platform that provides a data warehouse-as-a-service designed for the cloud.
Credentials
You can find authentication information for this node here.
Basic Operations#
- Execute an SQL query.
- Insert rows in database.
- Update rows in database.
Example Usage#
This workflow allows you to create a table, insert, and update data in a table in Snowflake. You can also find the workflow on n8n.io. This example usage workflow would use the following nodes. - Start - Set - Snowflake
The final workflow should look like the following image.
1. Start node#
The start node exists by default when you create a new workflow.
2. Snowflake node (Execute Query)#
This node will create a table named docs
with id
and name
columns.
- First of all, you'll have to enter credentials for the Snowflake node. You can find out how to do that here.
- Select 'Execute Query' from the Operation dropdown list.
- Enter the following SQL query in the Query field:
CREATE TABLE docs (id INT, name STRING);
. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node creates a table named docs
in Snowflake.
3. Set node#
We will use the Set node to set the values for the id and name columns for a new record.
- Click on the Add Value button and select 'Number' from the dropdown list.
- Enter
id
in the Name field. - Enter an id in the Value field.
- Click on the Add Value button and select 'String' from the dropdown list.
- Enter
name
in the Name field. - Enter the value for the name in the Value field.
- Toggle Keep Only Set to
true
. We set this option to true to ensure that only the data that we have set in this node get passed on to the next nodes in the workflow. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node sets the value for id
and name
.
4. Snowflake1 node (Insert)#
This node will insert the data that we set in the previous node into the docs
table in Snowflake.
- Select the credentials that you entered in the previous Snowflake node.
- Enter
docs
in the Table field. - Enter
id, name
in the Columns field. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node inserts the data in the table that we created using the Snowflake node.
5. Set1 node#
We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow. We will set the value of name
in this node.
- Click on the Add Value button and select 'Number' from the dropdown list.
- Enter
id
in the Name field. - Enter
1
in the Value field. - Click on the Add Value button and select 'String' from the dropdown list.
- Enter
name
in the Name field. - Enter
nodemation
in the Value field. - Toggle Keep Only Set to
true
. We set this option to true to ensure that only the data that we have set in this node get passed on to the next nodes in the workflow. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node sets the value of name
. This value is passed to the next node in the workflow.
6. Snowflake2 node (Update)#
This node will update the value of the name
column for the id 1
.
- Select the credentials that you entered in the previous Snowflake node.
- Select 'Update' from the Operation dropdown list.
- Click on the gears icon next to the Table field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > Snowflake1 > Parameters > table. You can also add the following expression:
{{$node["Snowflake1"].parameter["table"]}}
. - Enter
name
in the Columns field. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node updates the value of the name field for the record with id 1
.