Skip to content

Scheduled Jobs and Background Processing

intermediate

A content management system accumulates work that nobody wants to do by hand. Expired content needs unpublishing. Search indexes need rebuilding after bulk imports. Broken links need detecting before visitors find them. Trash bins need emptying.

Doing these tasks manually wastes time and invites mistakes. Optimizely CMS handles them through scheduled jobs β€” background tasks that run automatically on a defined schedule.

A scheduled job is a unit of work that the CMS executes in the background. Each job has a name, a schedule (how often it runs), and a task (what it does). Jobs run independently of user requests. They do not block the editor interface or affect page delivery.

You can think of scheduled jobs as cron tasks built into the CMS. They run at intervals you define, perform their work, and report success or failure in the admin interface.

Optimizely CMS ships with several jobs that handle common maintenance needs:

Job nameWhat it doesWhy it matters
Publish Delayed ContentPublishes content items that have a future publish dateEnables scheduled publishing workflows
Remove Abandoned BLOBsCleans up orphaned binary files (images, documents)Prevents storage bloat
Remove Permanent EditingClears stale content locks from crashed sessionsPrevents editors from being locked out
Subscription NotificationSends email notifications for content changesKeeps stakeholders informed
Clear Thumbnail PropertiesRegenerates content thumbnailsFixes broken previews after migrations
Link ValidationScans content for broken internal and external linksCatches dead links before visitors do
Trash EmptyPermanently removes items in the trashReclaims storage space
Notification DispatcherProcesses queued notification messagesDelivers assignment and approval alerts

Not every built-in job needs to run. Disable jobs you do not use to reduce background processing overhead.

Each scheduled job has three scheduling options:

  • Interval β€” Run every N minutes, hours, or days
  • Time of day β€” Run at a specific time daily
  • Manual only β€” Only run when an administrator triggers it

Set intervals based on urgency. Link validation can run weekly. Publish Delayed Content should run every few minutes so scheduled posts go live on time.

Sometimes you need a job to run immediately. After a large content import, you might want to trigger search reindexing right away instead of waiting for the next scheduled run. The admin interface lets you start any job manually with a single click.

When built-in jobs do not cover your needs, you can create custom ones. Common use cases include:

  • Content archival β€” Move outdated content to an archive section after a set period
  • Data synchronization β€” Pull product data from an external PIM or ERP system
  • Report generation β€” Compile content statistics and email them to stakeholders
  • Cache warming β€” Pre-render high-traffic pages after a deployment

A custom scheduled job is a class that inherits from ScheduledJobBase. You define the Execute method with your logic. The CMS handles scheduling, execution tracking, and error reporting.

  • Idempotency. Your job might run twice if the previous execution overlaps. Design it so running twice produces the same result as running once.
  • Progress reporting. For long-running jobs, report progress so administrators can see what the job is doing. Use the OnStatusChanged method to update the status message.
  • Error handling. Catch exceptions and log meaningful messages. A silent failure is worse than a loud one.
  • Execution time. Keep jobs focused and fast. A job that takes three hours blocks other jobs in single-threaded environments. Break large tasks into smaller batches.

The CMS admin interface shows the status of all scheduled jobs:

  • Last run time β€” When the job last executed
  • Last result β€” Whether it succeeded, failed, or was stopped
  • Next scheduled run β€” When the job will run next
  • Running status β€” Whether the job is currently executing

Check job status regularly. A silently failing job can cause cascading problems. If Publish Delayed Content stops running, scheduled posts never go live. If Link Validation stops, broken links accumulate undetected.

For production environments, do not rely on manual monitoring alone. Configure alerts that notify your team when a critical job fails. On PaaS, integrate with your application monitoring stack (Application Insights, Datadog, or similar). On SaaS, check the platform’s built-in notification options.