Schedules
Schedules let you run a job — or instantiate a template — on a recurring cron expression. They live in the control plane, fire even if no client is connected, and can be paused, resumed, or triggered on-demand from the portal, the CLI, or the API.
Cron format
Tanvrit Compute uses the standard 5-field cron expression:
┌──── minute (0–59)
│ ┌── hour (0–23)
│ │ ┌── day-of-month (1–31)
│ │ │ ┌── month (1–12)
│ │ │ │ ┌── day-of-week (0–6, 0 = Sunday)
│ │ │ │ │
* * * * *
Supported syntax (MVP)
The MVP parser is intentionally minimal. In each field you may use:
*— every value- A single number, e.g.
5 - A comma-separated list of numbers, e.g.
0,15,30,45
That's it. Ranges (1-5) and step values (*/15) are not parsed yet.
Examples that work today
| Expression | Meaning | | --- | --- | | 0 9 * * 1 | Every Monday at 09:00. | | 0 0 * * * | Every day at midnight. | | 30 14 1 * * | The 1st of every month at 14:30. | | 0,15,30,45 * * * * | Every 15 minutes (use a comma list — */15 is not supported). | | 0 9 * * 1,2,3,4,5 | Weekdays at 09:00 (use a list — ranges are not supported). |
Examples that don't work yet
| Expression | Why it's rejected | | --- | --- | | */15 * * * * | Step syntax (*/N) is not parsed. Use a comma list. | | 0 9 * * 1-5 | Range syntax (a-b) is not parsed. Use a comma list. | | @hourly | Named macros are not parsed. |
These will land in a future release; for now, the parser will return a 400 if you try to create a schedule with one of them.
Creating a schedule
From the CLI
tanvrit-compute schedules create \
--name "nightly tests" \
--cron "0 2 * * *" \
--template pytest \
--param repoUrl=https://github.com/me/myproj \
--param ref=main
From the API
POST /api/compute/schedules
Content-Type: application/json
Authorization: Bearer <jwt>
{
"name": "nightly tests",
"cron": "0 2 * * *",
"templateId": "pytest",
"params": { "repoUrl": "...", "ref": "main" }
}
A schedule can also reference an inline job spec instead of a template — set spec instead of templateId.
Pausing, resuming, running now
Every schedule has three lifecycle actions, callable from the CLI:
tanvrit-compute schedules pause sched_42
tanvrit-compute schedules resume sched_42
tanvrit-compute schedules run-now sched_42
- pause flips
enabledtofalse. The schedule stays in the database - resume flips
enabledback totrue. - run-now triggers an immediate one-off job from the schedule's spec
but the cron tick will skip it.
(or template + params), without waiting for the next cron tick. This is the fastest way to verify a schedule does what you think it does.
The same actions are available as buttons on every row in the portal's Schedules tab.
Templates + schedules
A schedule can reference a template_id instead of an inline job spec. When the cron fires (or when you call run-now), the control plane:
- Resolves the template by id.
- Substitutes the schedule's stored
paramsinto the template's - Submits the resulting job exactly as if you had called
${placeholder} slots.
tanvrit-compute templates run by hand.
This is the recommended pattern: define the what once as a template, then have many schedules reference it with different parameters (e.g. one schedule per repo for a CI template).
Audit & history
Every cron tick is recorded in the schedule's run history with the resulting job id, the start time, the duration, and the exit status. You can browse it in the portal or query it via:
GET /api/compute/schedules/{id}/runs?limit=50