with Google Chat (Service Account Key) and Schedule?
module.exports = defineComponent({
props: {
google_chat_service_account_key: {
type: "app",
app: "google_chat_service_account_key",
}
},
async run({ steps, $ }) {
// Required workaround to get the @google-cloud/storage package
// working correctly on Pipedream
require("@dylburger/umask")();
const { google } = require("googleapis");
const key = JSON.parse(this.google_chat_service_account_key.$auth.key_json);
const auth = new google.auth.JWT({
email: key.client_email,
key: key.private_key,
scopes: ["https://www.googleapis.com/auth/chat.bot"],
});
const chat = google.chat({ version: "v1", auth });
// Returns spaces the bot has access to
return await chat.spaces.list();
},
})
The Schedule app in Pipedream is a powerful tool that allows you to trigger workflows at regular intervals, ranging from every minute to once a year. This enables the automation of repetitive tasks and the scheduling of actions to occur without manual intervention. By leveraging this API, you can execute code, run integrations, and process data on a reliable schedule, all within Pipedream's serverless environment.