Is this really the version you are looking for? Kentico Xperience 8.1 Documentation is no longer updated. Use the switcher in the header to choose your product version.
This page explains how to configure execution of scheduled tasks. Scheduled tasks can be executed:
You can have both approaches enabled and execute some tasks directly in Kentico and other tasks via the external Windows service.
Scheduling reliability
Task execution by the Kentico application runs within the ASP.NET process, so tasks cannot be executed if the web application is not running. The application stops running when the process is recycled without being started again (after a long period of website inactivity).
If you want to run the scheduling reliably, we recommend using the Windows scheduling service.
To achieve reliable task execution without using the Windows scheduling service, you need to ensure that your website is always running. For example, you can prepare a utility or service that requests the home of your website on a regular basis.
By default, all scheduled tasks are executed by the Kentico application.
There are two levels of settings that determine when the system executes tasks:
To configure the interval that determines when individual scheduled tasks are ready to be executed:
To configure how frequently the application checks if there are any tasks ready to be executed:
Execution of scheduled tasks by the Kentico application has two modes.
Request-based scheduler mode
This is the default mode. The application performs checks at the end of each standard page request. This means that tasks are only executed when user activity on your website generates requests.
In this case, the Application scheduler interval sets the minimum time between the checks:
Automatic scheduler mode
You can configure the scheduler to process tasks regularly according to an automatic internal timer, regardless of website activity. To enable this mode, add the CMSUseAutomaticScheduler key into the /configuration/appSettings section of your web.config file:
<add key="CMSUseAutomaticScheduler" value="true" />In this case, the Application scheduler interval sets the precise interval between the checks:
Executing tasks using the external Windows service is recommended for resource‑consuming tasks, because the execution does not affect the performance of the Kentico application.
Prerequisites
You need to have the Kentico Scheduler Windows service installed and running.
Note
Only some of the default scheduled tasks support this option. The tasks that do not have the option available in the editing interface must be processed by the application itself.
Open the Settings application.
Select the System category.
Enable the Use external service setting.
In the Scheduled tasks application, enable the Use external service option for individual tasks.
Resolving context macros when executing tasks by the Windows service
Tasks that are executed by the Windows service cannot resolve macros dependent on application context (for example {% ApplicationPath %}). The context is not available when tasks are executed outside the application. Therefore, you cannot execute such tasks using the Windows service.
There are two levels of settings that determine when the Windows scheduler service executes tasks:
To configure the interval that determines when individual scheduled tasks are ready to be executed:
To configure how frequently the Windows scheduler service checks if there are any tasks ready to be executed:
This setting only applies to tasks that are configured to be executed by the Windows service, not by the application itself.
The Service scheduler interval sets the precise interval between the checks:
Additional low-level scheduled task settings can be done by adding the keys listed in the Scheduler settings section of the Web.config application keys reference.