Cron
A cron trigger lets you schedule code to run repeatedly on a schedule. For example, you could set up a cron to:
- Deliver a Hacker News daily digest
- Get notified when folks update their social bio
- Send a weekly reminder message or email
Crons can run up to once every 15 minutes on a Free account, or once a minute, with the Pro plan.
Adding a cron trigger
To add a cron trigger, click the + button in the top right of your val editor
and select CRON. You can also use the triple dots menu next to the Run
button, or use our MCP server.

Once you've added a cron trigger, you'll see it atop your file editor. You may edit or pause the cron by selecting the setting icon, or remove it using the triple dots menu in the top right.

Cron schedule types
There are two kinds of cron schedules:
- Simple intervals like "run every two hours"
- Cron syntax like 8pm on Thursdays
You can consult crongpt.com for help writing cron expressions. For example the following cron runs every two hours, on the first day of the month:
0 */2 1 * *Crons run in UTC
Cron expressions are always evaluated in the UTC timezone, so if you want to specify a certain hour in your local timezone, you may need to adjust the cron expression.
Example
This example polls an RSS feed for new items since the last run. This val runs every 1 hour.
Type signature
Crons take an Interval object as a parameter, and can return anything as a
result. The return value is ignored.
export function cronValHandler(interval: Interval) {
console.log("Cron val ran!");
}The Interval type has the following shape:
interface Interval {
lastRunAt: Date | undefined;
}Last updated