Task scheduling

Schedule background work in Dart without cron: future calls run your code later, survive restarts, and are queued in your database, so no jobs are lost.

Get Started

Future calls

Every backend eventually needs work that runs later: a reminder 24 hours after an order, a cleanup at midnight, a retry in five minutes. Cron jobs and job queues can do it, but they live outside your application, are awkward to test, and add another moving part to your system.

Serverpod's future calls are plain Dart functions scheduled with a delay or run at a specific time. They are persisted in your database and executed by the server, so they survive restarts and can run across your server cluster without an external scheduler.

How it works

1Define it

Extend FutureCall and add the method you want to run later. It takes a Session and any typed payload.

class ReminderFutureCall extends FutureCall {
  Future<void> send(Session session, Order order) async {
    // Send the reminder for this order.
  }
}

2Run serverpod start

serverpod start regenerates the type-safe interface for your future calls as you save, and the running server registers them on start.

serverpod start

3Schedule it

Queue the call to run after a delay or at a specific time, passing the payload it needs.

await session.serverpod.futureCalls
    .callWithDelay(const Duration(hours: 24))
    .reminder
    .send(order);

Flexible scheduling

Schedule work a fixed duration from now, at a specific timestamp, or on a recurring schedule from a cron expression or a fixed interval.

await session.serverpod.futureCalls
    .callRecurring(identifier: 'daily-reminder')
    .cron('0 8 * * *')
    .reminder
    .send(order);

Survives restarts

Scheduled calls are stored in your database, so a deploy or a crash does not drop pending work; the server picks it back up.

Distributed execution

Future calls run across your cluster, so scheduled work scales with your servers rather than being pinned to a single machine.

Everything included

Run after a delay
Run at a specific timestamp
Typed model payloads
Cancel by identifier
Survives restarts
Distributed across the cluster
No external scheduler
Type-safe scheduling

Why Serverpod

Full-stack type safety. A future call is a true Dart method, and its arguments, including your generated models, are checked at compile time.
Open source. The queue is a set of plain rows in your own database that you can inspect.
Zero-configuration deployments. Scheduled work runs on Serverpod Cloud with nothing extra to set up.

Works with

Postgres

Frequently asked questions

Does Serverpod replace cron jobs?

Yes, for application-level scheduled work. Future calls run your Dart code on a delay or at a timestamp.

Do scheduled jobs survive a restart?

Yes. Future calls are persisted in the database, so pending work is not lost on deployment or crash.

Can I run recurring jobs?

Yes. Schedule a call as recurring with a cron expression or a fixed interval, and the server runs it on that schedule.

Can I pass data to a scheduled job?

Yes. A future call takes typed arguments, including your generated models.

When should I not use this?

For very high-frequency, sub-second scheduling or heavy job pipelines, a dedicated message broker may be a better fit.

Stay up-to-date

Our mailing list keeps you up-to-date with new Serverpod releases and features. You will get an email about once a month or when something big is happening. We promise to keep it relevant and we have a strict no-spam policy.

© 2026 Serverpod AB
Built with Serverpod - Hosted on Serverpod Cloud