Skip to main content
Version: 4.48.0

Cron

The Cron component can be used to schedule messages based on specific moments in time. It uses cron tabs to indicate when to send a message into the flow.

This component stays in a waiting state until a message is received. Once the component is running, jobs will start executing.

Configuration

Cron Jobs The list of jobs with their respective cron tabs, and the message they output.

Syntax: cron tab | data (only string supported) | comment

Examples: */5 * * * * *| ping - Will send the message ping every 5 seconds.

As Object Whether or not to send the output as an object, or as a raw string. If this is set to true a message in the format { message: "ping"} will be sent.

Cron tab:

*    *    *    *    *    *
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ |
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
│ │ │ │ └───── month (1 - 12)
│ │ │ └────────── day of month (1 - 31, L)
│ │ └─────────────── hour (0 - 23)
│ └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, optional)

Some examples:

tabdescription
0 0 1 1 *Run annually, at First of January at 00:00
0 0 1 * *Run once a month, at 00:00 on the first day of the month
0 0 * * 0Run once a week, at Sunday 00:00
0 0 * * *Run once a day, at 00:00
0 * * * *Run once an hour, at XX:00
*/5 * * * *Run once every 5 minutes

Inputs

Input Any message that is sent to the Cron component will set it to an running state.

Outputs

Output

Examples:

  • ping if asObject is false.
  • { message: "ping" } if asObject is true.