Salesforce

Schedule jobs using the API

« Go Back
Information
Schedule jobs using the API
000004231
Public
Product Selection
aiWare - aiWare
Article Details

This topic describes scheduled jobs as set using the API. To use the UI to set schedule jobs, you will set them using the DAG builder wizard. See Create a scheduled job for more information.

A scheduled job consists of the type of schedule, the schedule itself, and the job template to create when the schedule occurs. Use scheduled jobs when you want to ingest from a source, or perform some task on a schedule. For example, to transcribe audio from a radio program every day or to scan for new items in a podcast program, scheduled jobs can be used to automate these tasks.

The process for creating a scheduled job is somewhat different from the process for creating an ad hoc job, and there are additional input objects for managing scheduled jobs.

Run modes for scheduled jobs

The type of schedule is specified by the runMode enum on the createScheduledJob input object. The options are:

Continuous - the job will run 24x7 from start to stop. The job will launch when the startDateTime has occurred, and will run until the stopDateTime.

Recurring - the job will run on a recurring basis, which is specified by the intervalUnit enum, which can be set to:

  • Months
  • Weeks
  • Days
  • Hours
  • Minutes
  • Seconds

In addition, you must specify the recurring schedule parts.

Once - the job will run only once. Scheduled jobs with a runMode of once must be launched manually using the launchScheduledJobs input object

Now - the job will run now, without requiring a manual launch. When finished, the runMode updates to once.

Recurring schedule parts

To create a recurring job, you must specify the type of recurrence: weekly or a specified interval.

  • The createWeeklySchedulePart input object specifies starting the job on a day of the week.
  • The createRecurringSchedulePart specifies that jobs will be started on a schedule set by the intervalUnit enum.

The startTime and stopTime are based on the timezone defined for the primary source of the scheduled job. If there's no timezone, or the scheduled job has no primary source, the default is US/Pacific Time.

This is an important factor to keep in mind for scheduled jobs without a defined primary source. You must specify the time elements in US/Pacific Time. For example, if you're in Houston, Texas, and want to record at 6:00 a.m., then the startTime must be specified as 04:00, since that's US/Pacific Time. for your 6:00 a.m. local time. The same rule applies to the stopTime specification.

When you query scheduled job data in GraphQL, the time returned will be in Coordinated Universal Time (UTC).

[Note] You can use a time converter such as Time and Date to calculate time and date differences between locations and UTC.

Managing scheduled jobs

Because scheduled jobs can be set to run on an ongoing basis according to a set schedule, you may need to make changes to them on occasion. You can manage scheduled jobs in the following ways:

Additional Technical Documentation Information
Properties
1/26/2024 3:51 PM
1/26/2024 9:15 PM
1/26/2024 9:15 PM
Documentation
Documentation
000004231
Translation Information
English

Powered by