Umbral
Back to plugin directory
UT

Umbral Tasks

Official by Umbral contributors

durable jobs, workers, retries, priorities, periodic beat

official alpha

About

Some work shouldn't happen inside the request — sending the welcome email, resizing the upload, calling the flaky third-party webhook. Umbral Tasks is the Celery-equivalent: annotate an async function with #[task], enqueue it from a handler, and a separate worker drains the queue durably. The queue is a DB table, so a crash doesn't lose jobs, and retries back off exponentially instead of hammering a service that's already down.

Install

cargo add umbral-tasks

Wire it up

use umbral::prelude::*;
use umbral_tasks::TasksPlugin;

let app = App::builder()
    .database("default", pool)
    .plugin(TasksPlugin::default())
    .build()?;

Run the worker beside your web process:

cargo run -- worker        # drains the queue
cargo run -- tasks-beat    # fires periodic / cron schedules

Target: offload the welcome email

Define the job once, enqueue it from anywhere, and let the worker deliver it.

use umbral_tasks::{enqueue, EnqueueOptions};

#[umbral::task]
async fn send_welcome(payload: WelcomePayload) -> Result<(), String> {
    email_user(payload.user_id).await.map_err(|e| e.to_string())
}

// From a signup handler:
register_send_welcome();  // once at startup
enqueue("send_welcome", &WelcomePayload { user_id }, EnqueueOptions::default()).await?;

What you get

  • #[task] macro turns an async fn into an enqueueable job
  • DB-backed queue that survives a process crash
  • Retries with exponential backoff + per-task timeouts
  • Priority queues and future eta / delay scheduling
  • Periodic "beat" tasks (cron or fixed interval)
  • Read-only queue browser in the admin, with "Retry selected"

Usage

Register `TasksPlugin` in the app, annotate handlers with `#[umbral::task]`, and call `register_<fn>()` at startup so the worker knows them. Enqueue with `enqueue(...)` from any handler, then run `cargo run -- worker` (and `tasks-beat` for schedules) beside the web process.

plugin setup
cargo add umbral-tasks

Feature tracker

Per-feature shipping status, recorded in the directory.

7 of 9 shipped
#[task] macro usable Alpha

Annotate a function as an enqueueable background job.

DB-backed queue usable Alpha

Jobs persisted to a table and drained by a worker.

Worker process usable Alpha

cargo run -- worker consumes and executes jobs.

Retries and backoff usable Alpha

Failed jobs retry with exponential backoff.

Scheduled tasks planned Design

Run a job at a future eta.

Priority queues usable Alpha

Higher-priority jobs are claimed before lower-priority work.

Beat schedules usable Alpha

tasks-beat fires periodic jobs on interval schedules.

Result records usable Alpha

Stores task outcomes for inspection and retry decisions.

Admin queue browser experimental Alpha

Admin-facing task rows for monitoring and manual retry.

Compatibility

Declared support per Umbral version and database backend.

No compatibility rows declared yet.

Community notes

1 note in the discussion thread.

AN
Anonymous
community note · Jul 9, 2026

Retry backoff is configurable, which covered our flaky-webhook case.

Reported issues

Bugs and abuse reports filed against this plugin.

Report an issue

No open issues

No issues have been reported against this plugin. Track upstream bugs on the maintainer's tracker, or report a directory problem to the Umbral team.