Skip to content

cron

Runs a pipeline periodically according to a cron expression.

cron schedule:string { … }

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 schedule. If the pipeline runs longer than the interval to the next scheduled time point, the next run immediately starts.

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* , -JANDEC
days of week0-6* , - ? L #SUNSAT

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

Fetch the results from an API every 10 minutes

Section titled “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"

every