The configuration for the scheduled function
Configuration for defining a scheduled function.
OptionaldisplayName?: stringHuman-readable display name for the function
Optionalenv?: Record<string, string>Environment variables provided to the function
Event configuration specifying when the function is triggered
Optionalmemory?: numberMemory allocation in gigabytes
The name of the resource. Unique within the blueprint. e.g. 'sync-webhook'
OptionalrobotToken?: stringToken provided during function invocation
Optionalruntime?: "node" | "nodejs22.x" | "nodejs24.x"The runtime environment for the function (currently only Node.js is supported)
Optionalsrc?: stringPath to the function source code
Optionaltimeout?: numberExecution timeout in seconds
Optionaltimezone?: IanaTimezoneThe validated scheduled function resource
Using a cron expression:
defineScheduledFunction({
name: 'daily-cleanup',
event: {expression: '0 9 * * *'},
})
Using explicit cron fields:
defineScheduledFunction({
name: 'daily-cleanup',
event: {minute: '0', hour: '9', dayOfMonth: '*', month: '*', dayOfWeek: '*'},
})
The event.expression field accepts standard cron expressions or natural language:
'every 15 minutes', 'weekdays at 8am', 'fridays in the evening',
'mon, wed, fri at 9am', 'first of the month at noon'
defineScheduledFunction({
name: 'daily-cleanup',
event: {expression: 'every day at 9am'},
})
Defines a function that is triggered on a schedule. Supports cron expressions or natural language schedules.