How do I use CRON pattern for agenda?

How do I use CRON pattern for agenda?

In the newAgenda and updateAgenda method, there is a parameter called pattern for you to implement a scheduled push. For constructing the CRON pattern, we are using later npm package. Please note that we the CRON pattern is a 5 digits string, which can be constructed through crontab guru.

To check whether your CRON is correct or not, you can use the runkit in npm. Please replace the cron pattern and use the code below for testing:

var later = require("later")

const date = new Date()
date.setDate(date.getDate() + 10);

const sched = later.schedule(later.parse.cron("* * * * *"))
const range = sched.next(10, new Date(), date)

console.log("range", range)
    • Related Articles

    • Could we send responses when the user is inactive for a certain time (e.g. 30mins.) ?

      You may use the agenda function. Agenda is a scheduling system within Stella that will run a specific node for a member in a specific time. In simple words, it is a timer, when the countdown is finished, a message is sent. You can make use of it if ...
    • How to send a delay message?

      Agenda is a function to send a delayed message. Basically, you can set a timer to trigger a tree node. 1. Create a tree node for the delayed message to be sent. Set up the corresponding response. 2. Copy the Composite ID on top of the node-inspector. ...
    • How should I choose a phone number for WhatsApp?

      You must use a valid phone number and include the country and area code. The phone number must be able to receive calls or SMS for account verification. There are 3 types of eligible phone numbers: - Landlines - Cell phones – can be used as long as ...
    • Where can we find the return error if we are using API to send template messages?

      You can add your webhook to the channel to receive all the events from Stella, including the return error. Please note that the Core Version has to be v2.2 or above in order to apply webhooks. Please click here for more details regarding Webhook.
    • Can we use Stripe with Stella?

      Yes, you can. Our Standard Procedures will show you a step-by-step guideline on how to use Stripe with Stella. It will also highlight tips you should pay attention to during your chatbot building journey. For more details, please click here.