jobs: One Console for Every Background Job
Every app we run has work that happens out of sight: scheduled tasks, crawls, AI runs. jobs gives all of it one place to be queued, retried and watched, so "did it run, and why did it fail?" has one answer.
- First commit
- 23 November 2026
- In production for
- advert.cafe
- API endpoints
- About 88
- Tests
- 171 + integration suite
Every app had its own queue, and its own way of failing
Background work is where software quietly breaks. A scheduled task stops running and nobody notices. A crawl fails halfway. An email is sent twice because a worker restarted. Each of our apps solved this on its own, with its own jobs table, its own cron containers and its own retry rules.
Our own design notes show what that cost. advert.cafe had about 25 cron containers. One of its lead-finding pipelines passed work through 11 hand-offs and kept state in 9 places, and its incidents were all hand-off problems. CarFast has 49 publish/subscribe topics, and one booking fans out into about 25 recalculations.
The rule we set: if anyone would ever ask "did it run, why did it fail, run it again", the work belongs in one place.
A job plane: apps hand off work, jobs keeps the record
jobs does not run any app's code. Each app keeps its own workers; jobs decides what runs when, hands it out, and records every attempt. We designed it against eight real cases from our own apps, four from advert.cafe and others from CarFast, RentFast, ReelsFast and our AI agents, and checked each against the design before writing the engine.
- Every run moves through queued, running, done, failed or cancelled. Retries back off, each attempt has a timeout, and work held by a dead worker is taken back.
- Schedules with second precision that never overlap, events between apps, child runs, fair turns between apps, concurrency limits, and worker labels such as GPU.
- Duplicate control: idempotency keys and one open run per subject. Tasks that send or charge something are marked as not safe to repeat; if their outcome is unknown, they wait for a person under "Needs review" instead of running again.
- Late work expires before it runs, and run records expire after 30 days by default.
- One trace follows an action across apps. Webhooks are signed and retried from one minute up to twelve hours.
- A console with runs, traces, apps, workers, schedules, webhooks and events, and a Python SDK that apps install to connect.
How it is built and run
Architecture
A Flask API and an engine loop that runs every two seconds, on PostgreSQL. Workers in each app ask for work over a long-polling endpoint, and the database hands each run to exactly one of them (row locks with SKIP LOCKED), so there is no separate message broker to keep consistent. Redis carries notifications. The console is a Next.js app with Material UI.
Apps connect through a small Python SDK, published on GitHub.
Testing and hosting
171 automated tests, plus an integration suite that runs the real engine with two real apps. It runs on its own small DigitalOcean server behind Caddy, hardened with a firewall, fail2ban and key-only SSH. GitLab CI builds and tests every push and deploys it with operations.do. The console is private; this page is its public description.
One answer to "did it run?"
advert.cafe runs on jobs in production, starting with its scheduled lead-signal checks, with three of its workers connected. The Travel Suite's sync service and our invoicing app already have workers written for it.
It now handles hundreds of runs a day.
It went from first commit to production in under a week, because it reuses the same stack and deployment pipeline as all our apps. That is the kind of internal platform work we also do for clients whose background jobs have outgrown cron.