Scheduler service schedules Confect functions to run in the future. It wraps Convex’s scheduler with Effect-native types: delays use Duration and timestamps use DateTime.
Both runAfter() and runAt() accept a ref to a mutation or action and an optional args object matching the ref’s args schema. They return an ID from the _scheduled_functions system table. Pass this ID to cancel() to cancel the scheduled function.
Run after a delay
Run at a specific time
Cancel a scheduled function
Callscheduler.cancel(id) to cancel a previously scheduled function. It returns an Effect<void> and is available wherever the Scheduler service is provided, including mutations and actions.
runAfter and runAt.
For the full scheduling APIs, see the Effect Duration documentation, the Effect DateTime documentation, and the Convex scheduling documentation.