Home / All Integrations / Scheduler

Connect Scheduler to your chatbot

Schedule planned events


Schedule an event to be triggered at a later time. Events can be of type broadcast or webhook.

Events can be scheduled at any time in the future, between 1 min and 1 month from the current time. Events can be cancelled anytime before their planned execution time (see below).

Scheduled actions will be executed in the next minute after their scheduled time.

Parameters:

  • action = "webhook|broadcast|cancel"
  • schedule_time = ISO-formatted time string OR unix timestamp integer describing when to schedule the event. Example: 1592843603, "2020-06-22T16:33:44.377Z"
  • delay = human-readable string OR amount of milliseconds integer describing in how much time should the event happen. Example: "5 min", 300000, "2 days", "1d"
  • schedule_id = unique identifying name for your schedule. If no schedule_id is given, a random ID will be generated and returned.

Either delay or schedule_time must be set. All times are given in UTC.

Returns an object containing the scheduled event's id, time, and scheduled data.


Webhook scheduled events

The given url will be called at the requested time with the given body.
If any authentication is required from your endpoint, it must be done in the URL's query parameters.
The Content-Type header will be set to "application/json"
If the call fails, it will be retried up to 5 times, then marked as completed.

Specific parameters for webhook scheduled events:

  • action = "webhook"
  • url = URL to call
  • body = optional data to send along in the body of the request

Example:

Fn("utils/scheduler", action="webhook", schedule_time="2020-03-12 12:33:00")

Broadcast scheduled events

At the given time, trigger a broadcast from the bot to the user. Available only on the following channels: messenger,

Specific parameters for broadcast scheduled events:

  • action = "broadcast"
  • flow_id = name of flow to trigger
  • metadata = {} - specific metadata to add to the request (see broadcasts documentation)

Example:

Fn("utils/scheduler", action="broadcast", delay="5 hrs", flow_id="myFlow", metadata={"some":"info"})

Cancelling a scheduled event

You can cancel a previously set broadcast by setting the action parameter to "cancel" and providing the event's schedule_id

Specific parameters for cancelling scheduled events:

  • schedule_id = id of scheduled event to cancel

Example:

Fn("utils/scheduler", action="cancel", schedule_id="some-unique-id")

Discover similar integrations:

Datetime
HTTP requests
QR Code
Regex
UUID

Many more integrations are coming!

If you have a cool integration in mind, drop us an email on contact@csml.dev and tell us all about it!

Many of our 43 currently available integrations come directly from your suggestions!

Join the Community
on Slack Slack

Come and learn all about CSML with other chatbot enthusiasts on the Slack CSML Community! 🤗