Jobs

Manage jobs

Watch, run, retry and cancel jobs in the admin, and choose who sees them.

The admin lists jobs under Manage → Jobs:

  • The tabs Upcoming, Running, Failed, Done and Cron sort the jobs by status. A filter narrows the list to one task.
  • A row shows the task, the document it belongs to, when it is due, its attempts and the last error. Details shows the payload and the result.
  • Run now runs a waiting or failed job at once. Retry queues a failed job again. Cancel deletes a waiting or failed job.
  • Cron lists each recurring entry with its next and last run, in your time zone.

Who sees jobs

By default only admins see jobs. access on a task changes that. It takes true, false, a list of roles or a function, like an access rule:

defineTask({ access: ["editor"], run: async () => {} });
  • A user sees only the jobs of tasks they may access. The page shows when they may access at least one task.
  • A scheduled publish follows the update rule of its document instead. An editor who may edit the document sees and cancels the schedule in its Schedule dialog, without the Jobs page.

From the client

The same actions are on the client: client.jobs.list(), cron(), run(id), retry(id) and cancel(id). They need a session. There is no route that queues a job: only server code queues.