Cron Jobs
Cron Jobs
Schedule recurring HTTP calls into your own app. Deploxa fires a request to a path you choose on your deployment, on the cron schedule you set — useful for cleanups, digests, cache warming, or syncing external data.
How it works
You register a job with a schedule and a path. Every minute a scheduler checks which jobs are due, and for each due job Deploxa sends an authenticated GET request to https://your-project.deploxa.com/your/path. Your app does the work and returns a 2xx; anything else is recorded as a failed run.
Define a job
Create a job in the dashboard with two fields:
| Field | Example | Meaning |
|---|---|---|
| Schedule | 0 * * * * | Standard 5-field cron expression (UTC) |
| Path | /api/cron/cleanup | Path on your deployment that receives the request |
A few common schedules: * * * * * every minute, */15 * * * * every 15 minutes, 0 0 * * * daily at midnight, 0 9 * * 1 9am every Monday.
The CRON_SECRET
So your endpoint can tell a real cron call from a random internet request, Deploxa signs each call with a per-project secret. Set an environment variable named CRON_SECRET on your project, and Deploxa sends its value as a Bearer token (plus an x-deploxa-cron: 1 header) on every cron request.
GET /api/cron/cleanup Authorization: Bearer <your CRON_SECRET> x-deploxa-cron: 1
Example handler
Next.js (App Router)
// app/api/cron/cleanup/route.ts
export async function GET(req: Request) {
const auth = req.headers.get("authorization");
if (auth !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response("Unauthorized", { status: 401 });
}
await deleteExpiredSessions();
return Response.json({ ok: true });
}Express
app.get("/api/cron/cleanup", (req, res) => {
if (req.headers.authorization !== `Bearer ${process.env.CRON_SECRET}`) {
return res.status(401).send("Unauthorized");
}
runCleanup();
res.json({ ok: true });
});Run now & history
Use Run now on the Cron Jobs page to trigger a job immediately without waiting for its schedule — handy for testing. Every run (scheduled or manual) is logged with its status and duration; the last 100 runs per job are kept.

