I am using node js api for twilio to send outbound messages. I have a cron job going in google cloud which runs in each one minute. I am using a firestore function which triggered by the a pubsub topic. I send sms inside the firestore function.
I want to figure out how to control over the messages. I faced the issue and more than 10000 messages has been queued in twilio.
const client = require('twilio')(accountSid, authToken);
client.messages.create({
from: msgFromNum,
to: uNA.mobile_num,
body: uNA.message
})
.then(message => console.log(message.sid));