auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// Sendgrid events arrive as an array in the HTTP payload, for example:
// [
// {"smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","sg_event_id":"qTgCwJWfdwCw_PSs46Khrg==","event":"processed","category":"cat facts","email":"example@test.com","timestamp":1560406642},
// {"smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","sg_event_id":"qTgCwJWfdwCw_PSs46Khrg==","event":"processed","category":"cat facts","email":"example2@test.com","timestamp":1560406643}
// ]
//
// This workflow saves each event as a new record in the sendgrid_engagement_events table.
// You can run SQL on this data in the SQL tab at the top of this page. See
// https://docs.pipedream.com/destinations/sql/ for docs on the SQL service and running queries.
for (const row of event.body) {
$send.sql({
table: "sendgrid_engagement_events",
payload: row,
})
}