encore-cron
Installation
SKILL.md
Encore Cron Jobs
Instructions
A CronJob declaration in Encore.ts ties a schedule to an existing api(...) endpoint. The endpoint runs at the chosen cadence. Declare the CronJob at package level — not inside a function.
import { CronJob } from "encore.dev/cron";
import { api } from "encore.dev/api";
// 1. The endpoint to call (typically internal: expose: false)
export const aggregateDailyOrders = api(
{ expose: false },
async (): Promise<void> => {
// Aggregation logic
}
);