Query `pending` tasks with `run_at <= now()`. Mark as `running`, simulate execution, then `done`. Handle failures → `failed`.
Query
pendingtasks withrun_at <= now(). Mark asrunning, simulate execution, thendone. Handle failures →failed.