Snowflake Connector - Plugin problem

Hello in a Server-Side Action Plugin i am trying to connect to the Snowflake API in this way:

function(properties, context) {
    var snowflake = require('snowflake-sdk');

    var connection = snowflake.createConnection({
    account: "*****",
    username: "*****",
    password: "******"

    function (err, conn) {
  var statement = connection.execute({
    sqlText: "select * from ******************* where CAMPAIGN_ID='*******************'",
    complete: function (err, stmt, rows) {   
      return {row: rows[0]}


But i don’t know why I cannot connect successfully. Basically snowflake.createConnection is executed correctly but connection.connect() is not even call, the action apparently return before or what I imagine is that I might have to await some action, but i am not an expert in node so I am asking if someone has an idea on how to do execute sql commands with the Snowflake SDK.

Kind Regards