Getting Started with Scheduled Jobs

Getting Started with Scheduled Jobs

You can schedule one or more executions of an existing Cloud Function for the future, ensuring that your business logic is executed at the right time. The easiest way to create a schedule is to use the Telerik Platform portal which is discussed in this article.

Before you can schedule a job you need to implement its code as a Cloud Function. Then, when creating the job, you can select the Cloud Function and define a schedule.

For information on using the RESTful API to schedule jobs, see Creating a Scheduled Job.

Content at a glance:

  1. Schedule a Job
  2. Disabling and Enabling Scheduled Jobs
  3. Read Scheduled Jobs Logs

Prerequisites

Schedule a Job

Take these steps to schedule a Cloud Function for recurring runs:

  1. Open your Telerik Platform app.
  2. From the left-hand navigation pane choose Business Logic > Scheduled jobs.
  3. Click the Schedule a job button in the middle pane.
  4. In Job Name, enter a name for the job. You can change the name later.
  5. From the Select cloud function to execute drop-down box, select the Cloud Function that you want to schedule.
  6. From Recurrence pattern select the execution frequency or select to run the job only once.
  7. From Execution start time select the time of the day when you want the first execution to begin. If you have selected the "weeks" or "months" option above, also select an Execution Day to specify on which day of the week/month you want the execution to happen. The suggested start time is your current local with one hour added for convenience.
  8. If you want to delay the first execution until a specific day in the future, select a Start date.
  9. If you want the schedule to end after a certain number of executions or at a specific moment, select a value in End after or End by respectively.

All date and time values in the portal are shown in your local time.

"Schedule a job from a cloud function pane"

Disabling and Enabling Scheduled Jobs

If you want to temporarily stop executing a job for which you have created a schedule, you can disable it. This way you don't have to re-create the schedule when you decide to start executing it again—you only need to enable it.

To disable or enable a job:

  1. Log in to the Telerik Platform portal.
  2. Click your app.
  3. Navigate to Business Logic > Scheduled jobs.
  4. Select the scheduled job in the grid.
  5. Click the Disable or Enable toolbar button.

Disabled jobs are still counted in your account's scheduled jobs quota. To free up a spot in the quota, delete the scheduled job.

Read Scheduled Jobs Logs

The result of a scheduled job execution run is logged as a separate entry to the common Business Logic logging facility. You have two option to view logs for a given scheduled job:

Option A:

  1. Log in to the Telerik Platform portal.
  2. Click your app.
  3. Navigate to Business Logic > Logs.
  4. Search for your job name or filter by an appropriate column such as Job name.

Option B:

  1. Log in to the Telerik Platform portal.
  2. Click your app.
  3. Navigate to Business Logic > Scheduled jobs.
  4. Select the scheduled job whose logs you want to view.
  5. In details pane, click View all logs for this job.

The logs screen offers several columns that are relevant to scheduled jobs. These are:

Response If your Cloud Function's response body is encoded as Content-Type: text, it will be displayed here. You can use this feature to pass short information about the outcome of the execution for easy viewing in the logs.
Duration How long (in milliseconds) it took for the job to finish.
Job name The name of the scheduled job that was executed.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.