Snowflake

A data warehouse built for the cloud

Integrate the Snowflake API with the HTTP / Webhook API

Setup the Snowflake API trigger to run a workflow which integrates with the HTTP / Webhook API. Pipedream's integration platform allows you to integrate Snowflake and HTTP / Webhook remarkably fast. Free for developers.

Insert Row with Snowflake API on New Requests from HTTP / Webhook API
HTTP / Webhook + Snowflake
 
Try it
Insert Row with Snowflake API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Snowflake
 
Try it
Custom Request with HTTP / Webhook API on New Row from Snowflake API
Snowflake + HTTP / Webhook
 
Try it
Custom Request with HTTP / Webhook API on Query Results from Snowflake API
Snowflake + HTTP / Webhook
 
Try it
GET Request with HTTP / Webhook API on New Row from Snowflake API
Snowflake + HTTP / Webhook
 
Try it
New Requests from the HTTP / Webhook API

Get a URL and emit the full HTTP event on every request (including headers and query parameters). You can also configure the HTTP response code, body, and more.

 
Try it
New Query Results from the Snowflake API

Emit new event with the results of an arbitrary query

 
Try it
New Requests (Payload Only) from the HTTP / Webhook API

Get a URL and emit the HTTP body as an event on every request

 
Try it
New Row from the Snowflake API

Emit new event when a row is added to a table

 
Try it
New event when the content of the URL changes. from the HTTP / Webhook API

Emit new event when the content of the URL changes.

 
Try it
Insert Row with the Snowflake API

Insert a row into a table

 
Try it
Send any HTTP Request with the HTTP / Webhook API

Send an HTTP request using any method and URL. Optionally configure query string parameters, headers, and basic auth.

 
Try it
Send GET Request with the HTTP / Webhook API

Send an HTTP GET request to any URL. Optionally configure query string parameters, headers and basic auth.

 
Try it
Send POST Request with the HTTP / Webhook API

Send an HTTP POST request to any URL. Optionally configure query string parameters, headers and basic auth.

 
Try it
Send PUT Request with the HTTP / Webhook API

Send an HTTP PUT request to any URL. Optionally configure query string parameters, headers and basic auth.

 
Try it

Connect Snowflake

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module.exports = defineComponent({
  props: {
    snowflake: {
      type: "app",
      app: "snowflake",
    }
  },
  async run({steps, $}) {
    // Example query
    const sqlText = `SELECT CURRENT_TIMESTAMP();`
    
    const { promisify } = require('util')
    const snowflake = require('snowflake-sdk')
    
    const connection = snowflake.createConnection(this.snowflake.$auth)
    
    const connectAsync = promisify(connection.connect)
    
    try {
      await connectAsync()
    } catch (err) {
      console.error('Unable to connect: ' + err.message)
    }
    
    // util.promisify requires the last argument of the function you pass to 
    // it be the callback function, according to Node convention — see the docs at
    // https://nodejs.org/dist/latest-v8.x/docs/api/util.html#util_util_promisify_original .
    // Since Snowflake's connection.execute function accepts a single argument — 
    // options, an object — using promisify won't work. So we wrap the callback 
    // with a Promise and await it below.
    //
    // Pass the same options object (e.g. sqlText, binds), _except_ for the callback
    // parameter. Instead, you'll want to await the result, which contains the 
    // stmt and rows object the callback version of the function passes, using 
    // a catch block to catch any errors, e.g.
    //
    //   try {
    //     const { stmt, rows } = await connExecuteAsync({
    //       sqlText: `insert into your_table select parse_json('{"foo": "bar"}')`,
    //     })
    //   } catch (err) {
    //     console.error(`Failed to execute statement due to the following error: ${err.message}`)
    //   }
    //
    async function connExecuteAsync(options) {
      return new Promise((resolve, reject) => {
        const statement = connection.execute({
          ...options,
          complete: function(err, stmt, rows) {
            if (err) {
              reject(err)
            } else {
              resolve({stmt, rows})
            }
          }
        })
      })
    }
    
    try {
      const { stmt, rows } = await connExecuteAsync({
        sqlText,
        fetchAsString: ['Number', 'Date'],
      })
      console.log(JSON.stringify(rows, null, 2))
    } catch (err) {
      console.error(`Failed to execute statement due to the following error: ${err.message}`)
    }
  },
})

Connect HTTP / Webhook

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export default defineComponent({
  props: {
    http: {
      type: "http_request",
      default: {
        method: "GET",
        url: "http://api.open-notify.org/iss-now.json",
      }
    }
  },
  async run({steps, $}) {
    return await this.http.execute()
  },
})

Community Posts

A Look at Pipedream
A Look at Pipedream
I'm going to build a workflow that will search Twitter every hour for a keyword. It will take the results, format them nicely, and then email it.
Building a Traffic-Based Workflow in Pipedream
Building a Traffic-Based Workflow in Pipedream
Normally I don't like to blog about stuff that isn't generally available to all, but as it will be available sometime soon, I decided to go ahead anyway. And I built something really cool I want to share so that's another reason to talk about this now!