Coming soon. The Wiki is in active development, so features and these docs may still change. Early adopters: contact us for access.

Scheduled Jobs

View, configure and run the background jobs the Wiki runs for you: publishing scheduled drafts, review reminders, the trash, analytics, Q&A and platform upkeep

1. Overview

The Wiki runs recurring work in the background with a built-in scheduler: publishing drafts at the time someone chose, reminding reviewers, emptying the trash, building analytics, sending email, delivering events and cleaning up. Administrators see every job, change its schedule, switch some off and run them by hand.

Go to Settings → Advanced → Scheduled jobs. You need scheduler:read to see jobs and scheduler:write to change or run them (super admins have both).

Settings → Advanced → Scheduled jobs, searched for wiki: each job's schedule, last and next run, and its edit and Run now buttons
Settings → Advanced → Scheduled jobs, searched for wiki: each job's schedule, last and next run, and its edit and Run now buttons

2. The job list

ColumnDescription
NameThe job's unique name
StatusEnabled or Disabled: whether it runs on schedule
ScheduleWhen it runs: a cron expression in UTC (marked UTC) or an interval such as every minute
Last runWhen it last ran and whether it succeeded
Next runWhen it will run next, in your own time zone
HealthGreen (healthy), yellow (failed recently), red (failed several times in a row)

Each run is recorded as Success, Failure, Timeout (it ran past its time limit and was cancelled) or Skipped (a plugin or policy skipped it, or it was already running).

3. Change a job

What you can change depends on the job (see the tables below):

  • Schedule: select the pencil next to the schedule, enter a cron expression (in UTC) or an interval, check Next run (shown in your time zone under the field) and select Save changes. It takes effect at once, without a restart.
  • Parameters: some jobs have settings such as how many days to keep something. Open the job, select Edit parameters, change the values (each has a description and a range) and Save. They apply from the next run.
  • On or off: jobs that can be switched off have a switch next to their name. A disabled job stays listed and runs again once switched on. Some jobs can't be switched off.
  • Run now: runs the job at once with its current parameters. If it's already running on another server, the run is refused with a conflict.
Cron expressionMeaning
0 * * * *Every hour at minute 0
30 3 * * *Daily at 03:30 UTC
0 0 * * 0Sundays at midnight UTC
0 */6 * * *Every 6 hours
0 9 * * 1-5Weekdays at 09:00 UTC

Cron schedules are in UTC on every server. Last and next run times are shown in your own time zone, so 0 8 * * * reads 13:30 for someone in India.

Editing a job's schedule, with the next run in the viewer's time
Editing a job's schedule, with the next run in the viewer's time

4. Run history

Open a job and select Run history. Each run shows when it started, how long it took, its status, the server that ran it, the attempt, the error of a failed run and the parameters it used. History is kept for 30 days, and at least the last 50 runs of each job are always kept.

Jobs that run every few seconds or every minute (such as wiki-scheduled-publish, mail-dispatch and event-dispatch) keep only failed and timed-out runs in their history, and the history panel says so. Their successful runs still update Last run in the list.

5. Wiki jobs

Every wiki job runs once per cluster. Times are UTC.

JobScheduleWhat it doesYou can
wiki-scheduled-publishEvery minutePublishes drafts whose scheduled publish time has come, as the person who scheduled them, while that person is still active and still edits the space. A publish that can never succeed drops the schedule and tells them; a passing failure is tried againRun now
wiki-review-remindersHourly at :20Reminds reviewers once when the date a review was asked for has passedChange schedule, run now
wiki-review-by-remindersHourly at :25Tells the person who set a page's review-by date, once, when that date has passedChange schedule, run now
wiki-page-trash-purgeDaily at 03:35Removes pages that have been in a space's trash for more than 30 days, for goodChange schedule, run now
wiki-draft-snapshotsEvery minuteSaves a snapshot of drafts that changed, for a page's draft history (once a draft has been idle for 2 minutes, or every 10 minutes while people keep editing)Run now
wiki-draft-snapshot-cleanupEvery hourDeletes draft snapshots older than 30 daysRun now
wiki-doc-compactionEvery 30 secondsMerges the edits stored for each page document, so pages open quicklyRun now
wiki-attachment-file-cleanupEvery 10 minutesDeletes the files of deleted attachments from storage. A file that can't be deleted yet stays queued and is tried againRun now
wiki-label-cleanupHourly at :50Removes labels that no page has carried for a dayChange schedule, run now
wiki-importsEvery 10 secondsRuns the next steps of imports in progress (each run at most an hour)Nothing (always on)
wiki-analytics-rollupEvery 15 minutesBuilds the daily page and space numbers analytics showsRun now
wiki-analytics-linksEvery hourReads the links of published pages, for the broken links reportRun now
wiki-analytics-retentionDaily at 02:45Deletes raw page views after 90 days, who read what after 25 months, and searches that found nothing after 90 days. The daily numbers are keptChange schedule, run now
wiki_qna_reputationEvery 15 minutesRecomputes people's Q&A reputationChange schedule, run now
wiki_qna_drafts_cleanupDaily at 03:23Deletes answer drafts nobody changed for 30 daysChange schedule, run now
wiki_qna_images_cleanupEvery 10 minutesDeletes question and answer images no post has shown for 31 days, and the files of deleted imagesRun now

6. Platform jobs

Jobs every installation runs. "Every server" jobs do only that server's own work and run on each server; the rest run once per cluster.

JobScheduleWhat it doesYou can
auth-session-cleanupHourlyRemoves sign-in sessions that ended more than retention_days (7) ago. A Remember me session is kept while it can still be renewedChange schedule and parameters, run now
apitoken-cleanupDaily at 03:30Removes API tokens that expired or were revoked more than retention_days (90, API_TOKEN_RETENTION_DAYS) agoChange schedule and parameters, run now
token-usage-flushEvery minute, every serverSaves API token request counts and last-used times a quiet server still holds (servers also save them every API_TOKEN_USAGE_FLUSH_INTERVAL, 5s)Nothing
oauth-cleanupHourly at :35Removes expired OAuth codes and tokensNothing
captcha-cleanupHourly at :25Removes expired CAPTCHA recordsNothing
mail-dispatchEvery 10 secondsSends queued email and retries failed deliveries (MAIL_DISPATCH_INTERVAL)Nothing
mail-cleanupDaily at 04:30Removes records of sent and failed email older than 30 daysChange schedule, run now
alert-cleanupDaily at 02:00Removes old alerts (see Managing alerts)Switch off, change schedule, run now
alert-tuningEvery minuteEnds mutes that ran out and looks at grouped alerts again (see Alert tuning)Nothing
event-dispatchEvery 5 secondsDelivers events to automation and plugins, retrying failures (EVENT_DISPATCH_INTERVAL)Nothing
event-outbox-cleanupDaily at 04:15Removes delivered events after 7 days (EVENT_OUTBOX_RETENTION_DAYS) and failed ones after 30 (EVENT_DEAD_RETENTION_DAYS)Change schedule, run now
index-events-pruneHourly at :25Deletes search index changes older than a day, once every server has applied themChange schedule, run now
policy-compliance-scanDaily at 03:30Checks existing items against each policy and lists what they would affect (read only)Switch off, change schedule, run now
policy-decision-cleanupDaily at 04:45Removes old policy decisionsChange schedule, run now
automation-run-cleanupDaily at 04:50Removes automation runs older than AUTOMATION_RUN_RETENTION_DAYS (30) and closes runs a stopped server left openChange schedule, run now
directory-syncEvery minuteSyncs each LDAP or other directory that is due, at its own interval. Switching it off stops all directory syncsSwitch off
directory-sync-run-cleanupDaily at 04:40Removes directory sync runs older than 90 daysChange schedule, run now
audit-log-retentionDaily at 03:20Deletes audit log entries past their retentionChange schedule and parameters, run now
logging-applyEvery minute, every serverApplies logging settings and ends temporary log levelsNothing
log-alerts-evaluateEvery minuteChecks log alert rulesNothing
diagnostics-runEvery minute, every serverCollects each server's part of log exports and profilesNothing
diagnostics-cleanupHourly at :15Removes old log exports and profilesNothing
system-checkEvery hourRuns the system check (SYSTEM_CHECK_INTERVAL)Switch off, change schedule, run now
system-check-nodeEvery minute, every serverEach server's part of the system checkNothing
node-health-reportEvery minute, every serverEach server checks itself for cluster healthNothing
cluster-healthEvery minuteDecides the cluster's health statusSwitch off
storage-settings-refreshEvery minute, every serverPicks up changed storage settingsNothing
branding-cleanupHourly at :45Removes logos and images no longer used by brandingNothing
download-usageEvery 5 minutesSaves the day's download totals for download quotas and deletes old ones (DOWNLOAD_USAGE_RETENTION_DAYS, 90). The Wiki counts no downloads today, so it has little to doChange schedule and parameters, run now
backup-scheduledDaily at 02:00, offTakes a backup; switch it on to start taking them. A run missed while every server was down runs once when one startsSwitch on or off, change schedule, run now
backup-cleanupDaily at 03:00Deletes backups past retention_days (7)Switch off, change schedule and parameters, run now
backup-test-restoreSundays at 04:00Test-restores the newest verified backup (Enterprise)Switch off, change schedule, run now
backup-upload-cleanupEvery 15 minutesTakes over backup uploads whose server stopped and drops expired onesNothing
backup-restore-watchEvery minute, every serverLets each server follow a restore that is runningNothing
plugin-dataEvery 5 minutesMeasures plugin databases against their quotas and finishes data deletions that failed (PLUGIN_DATA_CHECK_INTERVAL)Run now
plugin-endpoint-usage-flushEvery minute, every serverSaves counts of calls to plugins' protected endpointsNothing
plugin-endpoint-usage-retentionDaily at 03:55Deletes those counts after 90 daysRun now
scheduler-run-history-cleanupDaily at 03:00Deletes run history older than retention_days (30), keeping min_runs_per_job (50) per jobSwitch off, change schedule and parameters, run now

A job can ship switched off (the scheduled backup does): it stays listed and runs once you switch it on. Switching a job on or off, or changing its schedule, reaches every server of a cluster within one tick of the job.

7. Clusters

  • A once-per-cluster job runs on exactly one server each time; any server can pick it up.
  • If a server stops in the middle of a job, its lock runs out and another server runs the job at its next time.
  • The lock is kept in PostgreSQL, so jobs keep running once per cluster while Redis is unavailable.
  • The run history's Node column shows which server ran each run.

8. Health and alerts

A job that fails several times in a row (3 by default, SCHEDULER_UNHEALTHY_THRESHOLD) turns red and super admins and organization admins get a Job failing alert; when it succeeds again they get Job recovered. The job keeps running on schedule: it is never switched off for failing. These alerts are built-in automation rules, and the system check also reports failing and overdue jobs. Events: scheduler.job.unhealthy, scheduler.job.recovered, scheduler.job.run, scheduler.job.trigger and scheduler.job.update (see Events).

9. Troubleshooting

ProblemWhat to do
"Job is currently executing" (conflict)It's running on another server. Wait for it to finish, or check its history to see whether it is stuck.
A run ends in TimeoutIt ran past its time limit and was cancelled; the next run carries on. If it keeps happening, look at the run's error and the server's logs.
A job keeps failingRead the error in its run history. Common causes are the database, storage or mail server being unreachable.
A schedule can't be changedYou need scheduler:write, and the job must allow it (see You can above). The editor checks the expression before saving.
A job doesn't run when expectedCheck that it is switched on, and remember schedules are in UTC.
Scheduled publishes don't happenCheck wiki-scheduled-publish in the list. The person who scheduled the publish must still be active and edit the space; otherwise the schedule is dropped and they are told.

Switching off a cleanup job lets what it would remove pile up. Switch it back on once the problem is solved.

10. Environment variables

VariableDefaultDescription
SCHEDULER_RUN_HISTORY_RETENTION_DAYS30Default days to keep run history
SCHEDULER_UNHEALTHY_THRESHOLD3Failures in a row before a job is marked unhealthy
SCHEDULER_SHUTDOWN_GRACE_PERIOD30sHow long running jobs may finish when a server stops; after that they are cancelled and recorded as timeouts
API_TOKEN_USAGE_FLUSH_INTERVAL5sHow long a server keeps API token request counts before saving them (up to 1m)
API_TOKEN_RETENTION_DAYS90Default retention for expired and revoked API tokens

Custom jobs can't be added from the web app: jobs come with the Wiki and its plugins.