Skip to main content

Infrastructure

Background Jobs & Queues

Managed job queues, reliable cron, and dead-letter handling. Async processing without the infrastructure.

The Problem

Async processing is one of the first things every SaaS app needs and one of the most tedious to operate. You stand up Redis for queues, write workers, configure retries, set up monitoring, and then spend your time debugging why jobs are stuck, why cron didn’t fire, and what’s piling up in the dead-letter queue.

The infrastructure is solved. Running it well — reliably, observably, at scale — is ongoing toil that doesn’t ship features.

How Flux Handles It

Flux provides a fully managed job system that integrates directly with the rest of your platform:

  • Durable queues: Jobs are persisted before acknowledgment — no lost work during deploys or crashes
  • Reliable cron: Scheduled jobs with exactly-once semantics, missed-run detection, and jitter to avoid thundering herds
  • Automatic retries: Configurable backoff policies with a dead-letter queue for jobs that exhaust their retries
  • Concurrency controls: Per-queue and per-tenant concurrency limits so one customer’s bulk export doesn’t block another’s real-time updates
  • Observability: Job history, failure reasons, queue depth, and throughput — all in the Flux dashboard and queryable via the SDK

What Makes It Different

Flux jobs run in the context of the platform. A job that fails three times creates an audit log entry. A scheduled job can read tenant config to decide what to do. Rate limiting and entitlements apply to jobs the same way they apply to API requests — the same rules, the same enforcement, no separate configuration.

use flux_sdk::Flux;

let flux = Flux::init("your-api-key");

// Enqueue a job
flux.jobs().enqueue("send_invoice", json!({
    "org_id": org_id,
    "invoice_id": invoice_id,
}))?;

// Register a cron — runs daily at 9am UTC
flux.jobs().cron("daily_report", "0 9 * * *", |ctx| async move {
    let orgs = ctx.flux.orgs().list_active()?;
    for org in orgs {
        ctx.flux.jobs().enqueue("generate_report", json!({ "org_id": org.id }))?;
    }
    Ok(())
})?;

Async processing without the infrastructure. When something goes wrong, you have the context to understand why.

Ready to try Background Jobs & Queues?

Get started in minutes. No credit card required.