Scheduled Jobs & Cron

Run background tasks on a cron schedule. Your code runs on schedule, nothing runs between runs, and you pay only for execution time.

How It Works

A Telbase scheduled job is a Google Cloud Run job that Telbase starts on a cron schedule. It runs once, does its work, and exits; exit code 0 is a success. Between runs nothing is running.

Your coding agent sets one up when the app has a task that runs on a timer: a script the README or a crontab runs on a schedule, a GitHub Actions schedule: workflow, or a scheduler inside the web process (node-cron, APScheduler, setInterval). A scheduler inside the web process does not run reliably on Telbase, so the agent offers to move it into a job.

Paid plans only
Scheduled jobs require a paid plan. Starter includes 1 slot (5 min timeout), Builder includes 3 slots (10 min), and Pro includes 10 slots (30 min). See pricing below.

Creating a Scheduled Job

  1. Reserve the job: five cron fields, in the time zone given (UTC by default). The answer gives the job's deploy command.
bash
telbase jobs create my-app nightly-report --schedule "0 6 * * *" --timezone Europe/Paris
  1. Deploy it from the directory that holds its code, with the command from the answer. What runs is the image's start command: a Procfile line, the Dockerfile's CMD, or --command / --args.
bash
telbase gcloud run jobs deploy <name> --source . --region us-central1   --task-timeout 300s --max-retries 0 --quiet   --command python --args scripts/report.py
  1. Run it once and check that the run succeeded. Telbase creates the schedule as soon as the job exists.
bash
telbase jobs run nightly-report
telbase jobs executions nightly-report

Vercel crons

A Vercel app can instead have Vercel call one of its routes on a schedule, with crons in vercel.json (UTC; the work must finish within the function's time limit). Each cron takes one job slot. telbase jobs list shows whether they are on.

vercel.json
{
  "crons": [{ "path": "/api/digest", "schedule": "0 6 * * *" }]
}

Workers that never exit

A job must exit. A worker that runs forever (a queue consumer, a scheduler loop) is not hosted: Cloud Run scales to zero between requests. When all its work is periodic, it becomes a one-shot dispatcher that runs, does its work, and exits:

python
# worker.py — one-shot dispatcher for a scheduled job
import sys
from tasks import fetch_data, generate_report, sync_inventory

dispatch = {"fetch": fetch_data, "report": generate_report, "sync": sync_inventory}
task = sys.argv[1] if len(sys.argv) > 1 else "fetch"
dispatch[task]()

Deployed with --command python --args worker.py,fetch, one job per task.

Managing Jobs

bash
telbase jobs list                                  # jobs, Vercel crons and slots
telbase jobs info nightly-report
telbase jobs run nightly-report                    # run it now
telbase jobs schedule nightly-report --schedule "0 12 * * *"
telbase jobs pause nightly-report
telbase jobs resume nightly-report
telbase jobs delete nightly-report --yes           # removes it with its schedule

Execution History

bash
# A job's recent runs, newest first
telbase jobs executions nightly-report

# Its logs
telbase gcloud logging read 'resource.type="cloud_run_job" AND resource.labels.job_name="<name>"' --freshness=1d

Circuit Breaker

If your job fails 5 consecutive times, Telbase automatically pauses the schedule and sends you an email notification. This prevents runaway costs from a broken job.

To resume: fix the underlying issue, then run telbase jobs resume <job>.

Pricing

Each scheduled job uses one slot. Slots are included in your plan. Extra slots and execution compute are charged via credits. A job holds its slot until you delete it: a paused job keeps its slot, and an extra slot is charged every month, paused or not.

PlanIncluded SlotsMax TimeoutExtra Slot Cost
Free0 (not available)——
Starter ($5/mo)15 minutes20 credits/mo ($2)
Builder ($19/mo)310 minutes20 credits/mo ($2)
Pro ($79/mo)1030 minutes20 credits/mo ($2)

Execution compute: 1 credit = 25 compute-minutes. Fractional credits accumulate within a billing cycle.

Cost example
A daily job that runs for 2 minutes costs approximately 2.4 credits/month ($0.24) in compute. Compare this to an always-on worker at $10/mo — scheduled jobs are dramatically cheaper for periodic workloads.

Cron Syntax Reference

Telbase uses standard 5-field cron format: minute hour day month weekday.

ExpressionMeaning
0 * * * *Every hour at minute 0
*/15 * * * *Every 15 minutes
0 9 * * *Daily at 9:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
0 0 1 * *First day of every month at midnight
30 2 * * 0Sundays at 2:30 AM

MCP Tools

When using Claude Code with the Telbase MCP server, five tools are available for scheduled jobs:

Next Steps