Editor’s note: While this blog contains relevant information for creating scheduled tasks in Sitecore, we know the platform has undergone upgrades in the past few years. Take a look at our new 2020 blog for updated instructions and key information for developing scheduled tasks and seamless customer experiences with Sitecore.

To create a scheduled task in Sitecore, first you must create the .NET class that will contain the logic that you wish to execute.  In the example below I’m simply logging a message whenever the task is run.

Your method must accept three arguments:

  1. An array of items that can be specified in a later step when you define the command’s schedule
  2. The Sitecore task CommandItem
  3. The Sitecore task ScheduleItem

Once you have your logic defined, you can then create your task command in Sitecore. To do this, navigate to the commands folder under System/Tasks and create a new command as shown below.


In the Type field, enter the assembly qualified type name as shown above, and in the Method field enter the name of the method to be called in your class.

Now you must define the task schedule for your command in Sitecore. To do this, navigate to the Schedules folder under System/Tasks and create a new schedule as shown below.


To define your schedule

  1. Under the Command field select the command you just created
  2. If you wish to define items that will populate the items array in your class, you can do so under the Items field. This can be done using a Sitecore query without the ‘query:’ prefix or a pipe (“|”) delimited list of items.
  3. The Schedule field can be a bit tricky. You’ll notice in my example above that I have several piped values. They are defined as follows:
    1. The start date in yyyyMMdd format.
    2. The end date in yyyyMMdd format.
    3. The days of the week that the task should be run. Each day is assigned a value: 1 = Sunday, 2 = Monday, 4 = Tuesday, 8 = Wednesday, 16 = Thursday, 32 = Friday, and 64 = Saturday. For example to run a task Monday through Friday you’d enter 62 (2 + 4 + 8 + 16 + 32). I have my task set up to run every day (1 + 2 + 4 + 8 + 16 + 32 + 64 = 127).
    4. The minimum interval the task is to be run in HH:mm:ss format. The example above is set to run once every 24 hours.
  4. The last run field will be updated by Sitecore whenever your task is run. When creating your schedule you don’t have to set this, but if you do, Sitecore will think that was the last time it invoked your command.
  5. Checking the Async field will cause your task to be run asynchronously.
  6. Checking the Auto Remove field will cause Sitecore to automatically remove the schedule definition item when the task has expired.

Your task is now set up to run at the specified interval.  For more information on creating these take a look at John West’s Blog Post.

Leave a Reply to Steven Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


  • Steven


    6 years
    Thanks for the nice article. BTW, there's a type at "(1 + 2 + 4 + 8 + 16 + 32 + 64 = 172)" this should be 127
    • Kyle Davis

      6 years
      Thanks for reading and for the catch, Steven!
  • Mai Kalange

    Mai Kalange

    9 months
    Great write up.