auths
objectThe ID of the spreadsheet to insert rows into. The spreadsheetID can be found in the URL when viewing your Google sheet. E.g., https://docs.google.com/spreadsheets/d/[spreadsheetId]/edit#gid=0
The A1 notation of the values to retrieve. E.g., A1:E5 or Sheet1!A1:E5
return
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params, auths) => {
}
const { google } = require('googleapis')
const axios = require('axios');
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const auth = new google.auth.OAuth2()
auth.setCredentials({ access_token: auths.google_sheets.oauth_access_token })
const sheets = await google.sheets({ version: 'v4', auth });
const response = await sheets.spreadsheets.values.get({
spreadsheetId: params.spreadhsheetId,
range: params.range
})
const urlData = response.data.values;
for (const [currentIndex, currentUrl] of urlData.entries()) {
const config = {
url: '<<webhook url to next workflow>>',
method: 'POST',
data: {
currentUrl: currentUrl[0],
currentIndex
}
}
await delay(2500);
const response2 = axios(config);
console.log(response2.data);
}