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 automation 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 the 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’ section:

Creating a new Schedule

To create a new schedule, follow these steps:

  1. In the 'Run Lists' module, click the 'Schedules' button: 
  2. From the popup menu, click on the 'New Schedule' button
  3. In the dialogue box, specify a title for the schedule:

  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. 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 Agent 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:



  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, depending on which schedule is triggered. More about how to use scheduled variables.

  7. With the 'Actions' option, it is possible to add Actions that are triggered on a specified condition. Each schedule can contain multiple actions:

    For each action, select a condition as well as the action required:


    To 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:

     

    More about possible integrations with LEAPWORK.

    Variables:
    [CONDITION] – This is the condition selected from dropdown while setting the Action for the Schedule.
    [FAILED FLOWS LIST] –Gives a list of flows which have been failed.
    [FLOWS DONE] – Gives a count of flows which have been completed.
    [FLOWS FAILED] – Gives a count of flows which have been failed.
    [FLOWS PASSED] – Gives a count of flows which have been passed.
    [RESULTS-JSON] – Gives a result in a JSON format.
    [RESULTS-TABLE] – Gives the result in tabular format having list of flows along with their execution status. It also gives the number of flows completed, failed and passed. 
    [RESULTS-VIDEO] – Gives the location where the video file of execution of flow is saved.
    [RUN LIST NAME] – Gives the name of the run list executed.
    [SCHEDULE NAME] – Gives the name of schedule executed.
    [START TIME]- Gives a date and time when schedule was started.
    [TIME TAKEN] – Gives a time taken for execution of the flows in run list.

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

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.