Configuration
Define cron schedules directly in your function’sconfig. No external configuration needed.
index.ts
Local testing
Start the server withjelou functions dev. You can send an HTTP request to the function, but the isCron guard will reject it because it is not a real cron trigger:
You cannot simulate a real cron trigger from curl — the platform injects
ctx.isCron and the cryptographic signature automatically. To test cron logic, use createMockContext({ isCron: true }) in your tests.Syntax
Each schedule has two fields:| Field | Type | Required | Description |
|---|---|---|---|
expression | string | Yes | Standard 5-field cron |
timezone | string | No | IANA timezone. Default: UTC. |
Expression format
Common examples
| Expression | Description |
|---|---|
0 9 * * * | Every day at 9:00 AM |
0 9 * * 1-5 | Monday to Friday at 9:00 AM |
*/30 * * * * | Every 30 minutes |
0 0 1 * * | First day of each month at midnight |
0 */2 * * * | Every 2 hours |
30 14 * * 3 | Wednesday at 2:30 PM |
Timezones
Use any valid IANA zone:isCron guard
Your function can receive both HTTP requests and cron triggers. Use ctx.isCron to distinguish them:
How it works
- You define the schedules in
config.cron - When you run
jelou functions deploy, the platform reads your configuration and creates the schedules - When a schedule fires, your function receives a request with
ctx.isCron === trueandctx.trigger.cronwith the expression that triggered it - Cryptographic signature verification prevents unauthorized invocations
Limits
- Maximum 10 cron schedules per function
- Exceeding this limit throws an error at definition time
Management
Schedules are declarative — they are defined in code and synchronized on each deployment. To modify a schedule, changeconfig.cron in your code and redeploy.
To view active schedules:
Multi-tool cron
When you useapp(), each tool can have its own independent cron schedules. Cron requests are sent to the specific route of each tool.
Common issues
- Cron does not fire
- Cron logic executes via HTTP
Cron schedules are synchronized on deploy. If you changed the cron expression, you need to redeploy:Verify that the schedule is active:If the
Enabled column shows no, check that the cron expression is valid.