• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
petermillspaugh

petermillspaugh

docs

markdown docs site
Public
Like
docs
Home
Code
5
components
4
images
1
pages
6
styles
1
H
index.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
pages
/
vals
/
cron.md
Code
/
pages
/
vals
/
cron.md
Search
10/16/2025
Viewing readonly version of main branch: v515
View latest version
cron.md
title:
Cron
description:
Schedules let code on Val Town run every day, every hour, or whenever you'd like

Cron triggers let you schedule code to run repeatedly on a schedule.

Some common examples include:

  • Checking an RSS feed every hour
  • Getting notified when a website updates
  • Sending a reminder email every morning

Crons can be configured with cron syntax, or simple intervals like "once an hour"

Functions can run up to once every 15 minutes, or once a minute, with the Pro plan.

Type Signature

Crons take an Interval object as a parameter, and can return anything as a result. The return value is ignored.

Create val
export function cronValHandler(interval: Interval) { console.log("Cron val ran!"); }

The Interval type has the following shape:

Create val
interface Interval { lastRunAt: Date | undefined; }

Schedule types

There are two kinds of schedules: either simple intervals, like "run every two hours", or you can use cron syntax to define more complex schedules.

You can consult crongpt.com for help on writing cron expressions. For example the following cron runs every two hours, on the first day of the month:

0 */2 1 * *

Note: 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.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.