Hey there! I’m trying to set up a simple workflow to upgrade the warehouse size before a prod run, using a webhook generated from a job start in DBT, but I’m noticing there isn’t just a simple action to “run snowflake SQL”. I’ve asked the AI code generator but seems like a lot of code just to run a simple select. Anyone here done something similar and can advise?
To set up a workflow in Pipedream that upgrades the warehouse size in Snowflake before a production run, triggered by a webhook from a DBT job start, you can use a custom code step in Pipedream. While it’s true that there isn’t a pre-built “run Snowflake SQL” action, you can achieve this by writing a small amount of Node.js code within a Pipedream workflow. This code will connect to Snowflake, run the SQL command to resize the warehouse, and then proceed with the rest of your workflow.
Here’s an example of how you could write this code using the Snowflake SDK in a Pipedream workflow:
Hi @mike.melanson , not sure if this would be helpful for you, but we have a Snowflake Trigger which allows you to run a query, and this emits the results when the query completes:
Hey @michael — I notice that we definitely have a lot more snowflake functionality as a trigger, and a lot less actions “mid workflow”. I added a step in my workflow to alter the warehouse size to XL before a DBT job runs, and then drop it back down to Large after the DBT job. Ended up saving them to my actions so they are recyclable, but was just curious that there are so few “Actions” outside of the initial triggers!
Hey @mike.melanson, if there are any discrete Snowflake actions that you would find useful, we’d be more than happy to get these on our radar to our component developers to build - just let us know!
hey @michael – I’d say the main use cases I can think of right now would be :
changing warehouse size
Just a simple function to run a query to return some results to compare to would be cool, instead of having to build a custom NodeJs function (not that it’s too complicated… but sometimes in house simplicity is quicker! )
Check to see when a specific table was last updated\altered
That’s right – that’s an early version of much deeper database support we’re rolling out within the builder, and across MySQL and PostgreSQL in addition to Snowflake (with more database types coming soon). Here are the docs for it, please let us know if you have any feedback!
hey @danny ! I had a question. Trying to use the sql query function to execute a stored proc. I am triggering the workflow by slack— " Trigger Clone Odin_Mike " — I want to take this “Odin Mike Text” to then pass into the variable for the stored proc : “call odin.public.Odin_clone(‘odin_mike’)” — but when I try and use the step variable in the snowflake query I get errors. Am I missing something simple, or is this potentially outside the scope of the simple SQL query? Thanks!