Skip to main content
FastAPI + Huey . Self-hosted . Open source

FastAPI Huey Dashboard

Run Huey inside a FastAPI app and you have working background jobs. Run Huey with z4j and you also have a dashboard, persistent history, the task controls this adapter can execute safely, scheduler integration, RBAC with invitations, and a tamper-evident audit log. z4j is one container or one Python process; the agent is one pip extra in your existing FastAPI venv.

Huey is the simplest of the bunch: small surface, no result backend by default, file-backed scheduler optional. FastAPI + Huey + z4j gives you a dashboard for a stack that traditionally has none, safe submit, replacement-input retry, and pending-only revoke controls, plus an audit log for operator actions. Revoke prevents pending work from starting; it does not interrupt running work.

install

Install z4j alongside FastAPI + Huey

1. Install the brain

bash
pip install z4j && z4j serve

First boot prints a setup URL to stderr. Open it, create the first admin, and mint a token + HMAC secret for this agent.

2. Add the agent to your FastAPI venv

bash
pip install z4j-fastapi[huey]

3. Wire it into FastAPI

python
from fastapi import FastAPI
from z4j_fastapi import z4j_lifespan

app = FastAPI(lifespan=z4j_lifespan())

What you get

  • Persistent Huey task history in Postgres or SQLite
  • Adapter-advertised controls: submit_task, retry_task (complete replacement inputs), cancel_task (pending revoke only)
  • Scheduler integration via huey periodic; available controls depend on that scheduler adapter
  • RBAC with invitations and password reset
  • HMAC-chained tamper-evident audit log
  • Notifications: email, Slack, Telegram, webhook
License

z4j-fastapi and z4j-huey are Apache 2.0. Importing them into your FastAPI app does not affect your application's licensing. z4j is AGPL-3.0-or-later, isolated in its own process.

Huey actions exposed

What the dashboard can actually do

Native actions

  • submit_task
  • retry_task (complete replacement inputs)
  • cancel_task (pending revoke only)

Event capture

huey.signals decorator, installed via adapter.connect_signals().

Reconciliation

Huey result store (peek_data). Returns pending/success/unknown.

other FastAPI stacks

FastAPI with a different engine

Huey on other frameworks

Same engine, different framework

Start using FastAPI Huey Dashboard

Self-hosted, open source, no SaaS, no telemetry. z4j runs anywhere Python or Docker runs.