Skip to main content
Version: Next

cron

Runs a pipeline periodically according to a cron expression.

cron expression:string { … }

Description

The cron operator performs scheduled execution of a pipeline indefinitely according to a cron expression.

The executor spawns a new pipeline according to the cadence given by expression. If the pipeline runs longer than the interval to the next scheduled time point, the next run immediately starts.

expression:string

The cron expression with the following syntax:

<seconds> <minutes> <hours> <days of month> <months> <days of week>

The 6 fields are separated by a space. Allowed values for each field are:

FieldValue range*Special charactersAlternative Literals
seconds0-59* , -
minutes0-59* , -
hours0-23* , -
days of1-31* , - ? L W
months1-12* , -JAN ... DEC
days of week0-6* , - ? L #SUN ... SAT

The special characters have the following meaning:

Special characterMeaningDescription
*all valuesselects all values within a field
?no specific valuespecify one field and leave the other unspecified
-rangespecify ranges
,commaspecify additional values
/slashspecify increments
Llastlast day of the month or last day of the week
Wweekdaythe weekday nearest to the given day
#nthspecify the Nth day of the month

Examples

Fetch the results from an API every 10 minutes

Pull an endpoint on every 10th minute, Monday through Friday:

cron "* */10 * * * MON-FRI" {
  from "https://example.org/api"
  publish "api"
}

See Also

every