A scheduled job is a cron expression plus a webhook URL. On each tick Canner sends an HTTP POST to that URL; your app does the work and returns a 2xx to report success. Because the job is just a request to your own endpoint, there is no separate runtime to learn — you write ordinary route code. To run SQL on a schedule instead of hitting a webhook, use scheduled SQL queries.
Create a job
Go to Compute → New job and fill in four things: the project the job belongs to, a name, where to call, and a cron schedule. An optional description helps you remember what it does.
Where to call is, by default, a path in this project, such as /api/cron, in production or on a preview branch. Canner builds the address from the project’s own host each time the job runs, so it can’t point at the wrong place and it follows the project if its domain changes; a preview branch also uses that branch’s own environment variables. Choose a full URL only to call something that isn’t this project. Either way the address must be public: Canner refuses addresses inside its own network or on a private one.
The schedule
Schedules use standard 5-field cron — minute hour day-of-month month day-of-week — and all times are UTC. The form shows you the next run time as you type so you can sanity-check it.
0 9 * * * # every day at 09:00 UTC */15 * * * * # every 15 minutes 0 0 * * 1 # every Monday at midnight UTC 0 */6 * * * # every 6 hours
Writing the handler
Your endpoint should accept a POST, do its work, and return a 2xx status. A non-2xx response, a timeout, or a connection error is recorded as a failed run. Because the URL is reachable on the public internet, protect it — the simplest way is a shared secret you store as an environment variable and check on each request:
// app/api/cron/route.ts (Next.js) — any framework works
export async function POST(req: Request) {
// the job sends the secret in x-cron-key, read from the CRON_KEY env var (see "Sending the secret")
if (req.headers.get("x-cron-key") !== process.env.CRON_KEY) {
return new Response("forbidden", { status: 403 });
}
await runDailyDigest();
return new Response("ok"); // 2xx = success
}Sending the secret
Canner does not send your project’s environment variables by itself. To authenticate a job, add a header to it (open the job, Edit, Headers) and make its value read one of the project’s variables: choose Environment variable and type its name, for example the header x-cron-key from CRON_KEY. The value is read each time the job runs, so changing the variable changes what is sent, and the secret is never copied into the job. Through the API the same thing is "headers": { "x-cron-key": "${CRON_KEY}" }.
- A variable that isn’t set for production fails the run before anything is sent, and the run says which one.
- If the project has a
CRON_SECRETvariable and the job sets noAuthorizationheader, Canner sendsAuthorization: Bearer <CRON_SECRET>automatically. - A value you type in directly is stored encrypted and shown hidden afterwards.
What Canner sends, and retries
Every call carries X-Canner-Run-Id, X-Canner-Attempt (1, 2 or 3), X-Canner-Schedule (the cron expression that fired),X-Canner-Job-Id and X-Canner-Project. A scheduled run is retried twice if there was no answer at all (connection refused or reset) or the answer was a 502, 503 or 504, which is usually your app restarting: the second attempt follows after 30 seconds, the third two minutes later. Every attempt has the same run id, so use it as an idempotency key and your handler can ignore a repeat. A timeout, a 4xx or a 500 is not retried, and neither is a manual run. Delivery is best effort, so make handlers safe to run twice.
To check that a call really comes from Canner, add a CRON_SIGNING_SECRET environment variable to the project. Each call then carries X-Canner-Signature: t=<seconds>,v1=<hex>, an HMAC-SHA256 of t.runId.body keyed with that secret:
// verify X-Canner-Signature (only sent if the project has a CRON_SIGNING_SECRET variable)
import { createHmac, timingSafeEqual } from "node:crypto";
function fromCanner(req: Request, body: string): boolean {
const m = /^t=(d+),v1=([0-9a-f]{64})$/.exec(req.headers.get("x-canner-signature") ?? "");
if (!m) return false;
if (Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false; // refuse a replay
const runId = req.headers.get("x-canner-run-id") ?? "";
const want = createHmac("sha256", process.env.CRON_SIGNING_SECRET!)
.update(m[1] + "." + runId + "." + body)
.digest("hex");
return timingSafeEqual(Buffer.from(want), Buffer.from(m[2]));
}Runs, retries & history
Open a job to see its run history — each run is marked Succeeded, Failed, Timeout, or Running. You can trigger a job manually from its detail page to test the endpoint without waiting for the next tick. Long-running requests are cut off at the platform timeout and recorded as a timeout, so design handlers to finish quickly (or kick off background work and return immediately). A job can only call a public URL: addresses inside Canner or on a private network are refused. Canner does not follow redirects, so use the final URL; a redirect (http to https, a missing trailing slash) is recorded as a failed run that shows where it pointed.
When a job keeps failing
If a job has failed every run since its last success, for at least three runs and six hours, your organization’s admins get an email listing the failing jobs. It is sent at most once a week per organization, so occasional failures and short outages never reach your inbox. On a job’s page, a failed run explains what to check.
Plans
Scheduled jobs are available on every plan, with no cap on how many you can create. Plans differ by execution priority: jobs run best-effort on Starter, prioritized on Live, and with unlimited dedicated capacity on Enterprise. See Plans & limits for the full comparison.