Durable job scheduling

Jobs that survive the crash.

POST work over HTTP. Flint keeps it in Postgres, leases it to a worker, and retries until it is done.

Get started
flint/ scheduler
Live
Queue2 waiting
log_processingp3
0f5f2f25ready
job_retentionp3
0f5f2f4aready

ordered by priority, then due time

Workerspolling
No active lease.
Polling every 500ms.

leases renew while the work runs

Outcomes3 in DLQ
log_processingp3
0f5f2f6f38ms
job_retentionp3
0f5f2f9442ms

failed jobs park with their last error

queued2
processing0
completed981
DLQ3

Work cannot quietly vanish.

Every guarantee below is enforced in Postgres or in the claim query. None of it depends on a convention holding.

Admission

Committed before you hear back

The job is a Postgres row before the response leaves. Workers can crash, restart, or vanish. The row cannot.

POST /jobs→201 durable→row committed

Dispatch

One worker owns the lease

A single locked read picks the next eligible row. No coordinator to run, and no chance of two workers executing the same job.

ORDER BY effective_priority, available_at
FOR UPDATE SKIP LOCKED

Recovery

Retries that spread out

Failures return to pending with a jittered delay. Attempts that run out park in the DLQ with the last error kept.

attempt 1+5s
attempt 2+25s
attempt 3+125s

Graphs

Dependencies hold the chain

A job runs only after every upstream job completes. A failure cancels the pending branches instead of leaving half a result.

extractreportnotify

From POST to settled.

Five states, one eligibility clock, and a lease a worker has to keep renewing. A job settles once, as completed, failed, or cancelled.

pending

processing

completed

failed

cancelled

re-queued → pending
parks in DLQ

pending

A committed row with a due time. Claimable once available_at passes.

Retry

failed + attempts left → pending, available_at = now + backoff

Cancel

pending → instant. processing → cancellation_requested

More than a delayed call.

Priority, future runs, recurrence, and dependency graphs are first-class options on the same request.

POST /api/v1/jobsjson
{
  "type": "webhook_delivery",
  "payload": { "url": "https://example.com/hook" },
  "priority": 1,
  "scheduled_at": "2026-11-01T09:00:00Z",
  "interval": "15m",
  "dependency_ids": ["0f5f2f5e"]
}

One endpoint for all of it. A 201 means the work is durable, not queued in memory.

Priority with aging

1 is urgent, 3 is background. Old low-priority rows age up, so they cannot starve behind a stream of new work.

Scheduled runs

Set a future time once. The row waits until it is due, survives restarts, and needs no clock process to wake it.

Recurring work

Pass an interval and the next run is inserted in the same commit as completion. A chain cannot duplicate itself.

Dependency graphs

Fan out to many jobs, then fan back in. Downstream work waits for every parent, and failures cascade.

Built for the pager.

The UI is optional. Counts, worker controls, retries, and queue health are already in the API.

DLQ alerts

Set a threshold and recipients. The running fleet reads both without a restart.

dlq_threshold

One-call replay

Reset attempts and revive the dependents a failure cancelled along the way.

POST /dlq/{id}/retry

Worker control

Stop or restart a worker calmly. Presence lives in Redis with a 60 second TTL.

POST /workers/{id}/stop

Honest probes

Readiness fails only when Postgres is unreachable. A degraded Redis stays up.

/health/ready

Operator callsX-API-Key
GET /api/v1/dlq
POST/api/v1/dlq/{id}/retry
GET /api/v1/workers

Running in about a minute.

Compose brings up Postgres, Redis, the API, and a worker. Then schedule a job and inspect the result.

API
127.0.0.1:8000
Local API key
dev-api-key
MailHog
127.0.0.1:8025
API not attached

Set API_URL and API_KEY at runtime to show this deployment’s service facts here.

Docker Compose runs Postgres, Redis, the API, a worker and MailHog.

git clone https://github.com/muizzyraning/flint.git
cd flint
cp .env.example .env
docker compose up -d --build
bash127.0.0.1:8000

Start with a job, not a platform.

Compose brings up Postgres, Redis, the API, and a worker. The docs cover everything after that.