6.1 Schedules

A Schedule is a component of LEAPWORK that enables the user to define when the flows in a run list are run, and on which Agents - whether at pre-selected times or after specified time intervals. Schedules can be triggered either on-demand (such as through API calls to LEAPWORK) or at a single or recurring time interval.

The LEAPWORK scheduler provides control over automation flows, and helps to optimize time and resources. Among many things, it includes the following:

  • Granular control to run flows once or more at specific times during the day, in specific time-zones

  • The estimated run time is automatically calculated based on past performance and parallelization options

  • Recurring schedules can be controlled with working hours windows and queue options

  • Steps in a run list can be easily parallelized; either divided out across selected Agents or run on all

  • Scheduled runs can be skipped or robustly queued based on the Agent busy status

  • Scheduled runs can be stopped immediately in case a single flow fails or other limits are exceeded

Schedules are used in many scenarios but the most common are as follows:

  • Executing larger collections of test automation flows against e.g. development and/or the test environment
  • Running one or more automation flows to trigger a business process on a timely basis
  • Executing automation flows through the public REST API
  • Executing the same automation flows in different configurations, environments, machines etc.

After designing automation flows, users can schedule these flows to run automatically in different operating systems and with different browsers using the scheduler configuration.

Once a schedule is created, it is saved on the Controller. This means the user defines the schedule in LEAPWORK Studio, whilst the Controller keeps track of the schedule and handles the execution on the environments.

Schedules are associated with run lists and can be accessed from the top menu of ‘Run Lists’.

schedules-1

Creating a new Schedule

To create a new schedule, follow these steps:

  1. In the 'Run Lists' module, click the 'Schedules' button. 
    new_schedule-1
  2. From the popup menu, click on the 'New Schedule' button
  3. In the dialogue box, specify a title for the schedule
    new_schedule_popup
  4. Click on the 'Trigger' drop-down.

    There are two run types to choose from in the 'Trigger' drop-down:

    On Demand The schedule will not be run unless someone explicitly clicks the "Run Now" button or triggers it to run through the REST API.
    Scheduled Time-based triggers for the schedule.

     
    For the 'Scheduled' run type, the following parameters should be specified:

    Time zone The user should choose a particular time zone from the available list of time zones. The schedule will trigger according to the time zone selected.
    Start time The Start time is the first run of a schedule. If the schedule is set to recurring (e.g. every first Monday of a month), the start time will be adjusted to the first run. If the recurring schedule is edited, a new start time will be changed to the next run according to the recurrence. 
    Recurring

    The option to define whether a single trigger or multiple triggers at regular intervals are required.

    End time

    The End time is the last time when a run can start and is available only in the case of a recurring schedule.


    Recurring options:

    No The schedule will run only once.
    Every 'X' Seconds/Minutes/Hours/Days/Weeks/Month Repeats the schedule every 'X' Seconds/Minutes/Hours/Days/Weeks/Month Example: 1440 minutes
    After last run 'X' sec. delay The schedule will be run immediately after a run is completed (in a loop) with 'X' seconds delay in between each run.
    Working hours Defining the working hours provides additional control over the execution of the schedule.

    Options for working hours:

    Every day, all time Choose this for a 24 x 7 schedule.
    Custom Choose the specific days and working hours.
  5. Under 'Agents' (see more in Agents) select one or more agents on which the defined flows in each step should execute.

    Agent Distribution:
    Select 'All flows on each Agent (when all is available)' to run all the selected automation flows on all Agents when all of them are available for execution.
    Select 'Divide flows on each Agent (when all is available)' to distribute the selected automation flows equally to all agents when all of them are available for execution
    Select 'All flows on first available Agent' to run your flows on first available Agent only. Please note that all flows will be executed on the first available Agent only, even though other Agents are free.
                                                         
    Flow Sequence:
    Select 'Run in order' to run all the selected automation flows in a defined flow sequence.
    Select 'Run in random order' to execute the selected flows in any random order.
    agent_selection
  6. It is possible to define any number of variables for a schedule. A variable consists of a name and a value, and the values can be used inside the automation flows that are selected for the schedule. This means an automation flow can get different values to drive the flow with, depending on which schedule is triggered. More about how to use scheduled variables.
    schedule_variables-1
  7. With the 'Actions' option, it is possible to add Actions that are triggered on a specified conditions. Each schedule can contain multiple actions:
    schedule_actions-1

    For each action, select a condition as well as the action required:
    schedule_action_conditionschedule_action_optionsTo define the details of the action, the schedule offers a number of tokens that can be used to define e.g. the body of an e-mail, the URL of a call to a web service, or the input parameters to a PowerShell script executed on the Controller. schedule_tokensMore about possible integrations with LEAPWORK.

  8. Click 'Settings' to see a list of available options for configuration:
    schedule_settings
  9. Click 'Apply' to create the schedule. If the schedule is enabled, it will display the next run time as per the schedule.
    schedule_saved

After right-clicking on a schedule, the user can click the 'Run Now' button to start the immediate execution of the schedule - otherwise it will run on a defined schedule.