serverpod-scheduling

Schedule database-backed FutureCalls for one-off and recurring background tasks.

3.2k|369|Updated May 22, 2021
One-click install
npx skills add https://github.com/serverpod/serverpod --skill serverpod-scheduling
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: serverpod-scheduling
Source: https://github.com/serverpod/serverpod/tree/main/packages/serverpod/skills/serverpod-scheduling
Command: npx skills add https://github.com/serverpod/serverpod --skill serverpod-scheduling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you run background work at specific times without losing jobs during restarts or across a server cluster.

Core Features & Use Cases

  • One-off future calls: Schedule work to run after a delay or at a specific UTC time, with an optional identifier for cancellation.
  • Recurring tasks: Run periodic jobs using an interval-based schedule or a cron expression.
  • Cluster-safe execution: Store scheduled calls in the database so exactly one execution is claimed across the cluster.
  • Use case: Delay sending a notification until a user’s signup cooldown expires, or run hourly maintenance jobs that must persist even if the server restarts.

Quick Start

Use the serverpod-scheduling skill to create a FutureCall that performs your work and schedule it via pod.futureCalls.callWithDelay or pod.futureCalls.callAtTime.

Frequently Asked Questions about serverpod-scheduling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule recurring background jobs in a server cluster that survive restarts?▼

Database-backed recurring jobs survive restarts by storing scheduled FutureCalls in the database, ensuring exactly one execution is claimed across the cluster even after a server restart.

What's the best way to run delayed background tasks at a specific UTC time?▼

Delayed background tasks run at a specific UTC time by defining a FutureCall and scheduling it via callAtTime, with an optional identifier for later cancellation.

Can I use cron expressions for recurring task scheduling?▼

Cron expressions can be used for recurring task scheduling by defining a FutureCall and scheduling it with callRecurring using a cron expression or an interval-based schedule.

How do I cancel a scheduled future call before it executes?▼

Scheduled future calls are canceled by assigning an optional identifier during scheduling, which can then be referenced to cancel the pending task before execution.

Do I need to handle idempotency for database-backed recurring jobs?▼

Idempotency requirements must be honored for safe retries of database-backed recurring jobs, ensuring that retried cluster executions do not cause duplicate side effects.

When should I not use database persistence for background task scheduling?▼

Database persistence for background task scheduling is unnecessary for trivial in-memory tasks that do not require survival across restarts or cluster-wide execution guarantees.