Skip to content

Schedules

A schedule runs one of your function’s exported functions at set times: clean up old records every night, sync data every 15 minutes, send a weekly report. No HTTP request needed.

On the function page, open Settings, click Add schedule, enter the schedule and the function to run (empty means scheduled), and save. A function can have up to 10 schedules.

Every starter exports a scheduled function ready for this:

hive.define('scheduled', (event) => {
const runs = (db.get('runs') || 0) + 1
db.set('runs', runs)
console.log('scheduled run', runs, event.scheduled_time)
return { runs }
})

Each run appears in Logs. To try your scheduled function without waiting, use the Test card with scheduled in Function.

All times are UTC. The shortest interval is one minute.

Schedule Runs
*/15 * * * * Every 15 minutes
0 * * * * At the start of every hour
30 2 * * * Every day at 02:30 UTC
0 9 * * mon-fri Weekdays at 09:00 UTC
0 0 1 * * On the 1st of every month at midnight UTC
@every 5m Every 5 minutes
@every 2h Every 2 hours
@hourly, @daily, @weekly, @monthly Shorthands for the cron forms

Cron expressions have five fields: minute, hour, day of month, month and day of week. Each field takes *, a number, a list (1,15), a range (1-5) or a step (*/10). Months and days can also be written as names (jan, mon). @every takes whole minutes (m) or hours (h).

{
"cron": "*/15 * * * *",
"scheduled_time": "2026-10-19T09:15:00Z",
"function": { "name": "orders-k3x9", "version": 3 },
"input": null
}

input is the schedule’s own input, if you gave it one.

Through the API, a schedule can carry its own JSON input (up to 4 KB), which your function reads as event.input, so one function can serve several schedules:

Terminal window
curl -X PATCH "https://api.dockhive.io/api/v1/functions/functions/<function id>?region=eu" \
-H "Authorization: Bearer $DOCKHIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"schedules": [
{"cron": "0 2 * * *", "function": "cleanup", "input": {"older_than_days": 30}},
{"cron": "@every 15m"}
]}'

function defaults to scheduled. Sending schedules replaces the whole list.

  • Schedules run in the function’s region and use its latest version.
  • Each run counts as a request and uses compute like any other run, within the same time limit.
  • If a run can’t happen at its time (for example during maintenance), it isn’t run later; the next run happens on schedule. Write scheduled work so a skipped run catches up on the next one.