6. Schedules

A Schedule is a collection of one or more automation flows that is executed on one or more Environments, and the execution is controlled by the LEAPWORK Controller. Schedules are used in many scenarios but the most widely used are:

  • Executing larger collections of test automation flows against e.g. a development and/or test environment
  • Running one or more automation flows to trigger a business process on a timely basis
  • Execute 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 but the job to keep track of the schedule and handle the execution on the environments is all done by the Controller.

Opening the ‘Scheduling’ section from the main menu shows a list of all defined schedules.

Creating a new Schedule

To create a new Schedule, follow these steps:

  1. In the Scheduling module, click the 'New' button. 
    new schedule
  2. In the 'Create new schedule' dialogue box, specify a title and a description (optional) and choose to enable/disable. 
    create new schedule
    Title:  Name of the schedule.
    Description: A brief overview of what exactly the schedule is intended to do.
    State Enabled Status Checked means schedule is enabled and will run as per the setup done, if unchecked the schedule will not run at all.
  3. Click the 'Schedule' tab.
    schedule tab

    There are two run types to choose from in the 'Schedule' tab:

    Ad-hoc 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.

     
    Options for the 'Scheduled' run type:

    Ad-hoc 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.
    Weekdays Select days of week to run the schedule.
    Daily Run Window Select how the schedule runs should be repeated.
    Repeat Specify if and how you want to repeat the schedule run.
    No repeat Schedule will only run once.
    Repeat every Repeats the schedule every x minutes, example: 1440 minutes
    Start right after last run Schedule will be run immediately after a run is completed (in loop).
    Stop if running more than x minutes If checked, the schedule will stop running if the number of minutes specified is exceeded. This can be relevant in situations where you have very long-running automation flows, but still want to cap them at i.e. 24 hours (1440 minutes).

    scheduled run type
  4. Under 'Flows to run' (see more in Designing automation flows) select the flows that should be included in the schedule. Click on the folders to select all flows inside a folder. In the example below flows from multiple folders are selected as part of a schedule. 
    flows to run
  5. Under 'Environments' (see more in Environments) select one or more environments on which the schedule should execute the automation flows.
    Select 'Run all flows' to run all the selected automation flows on all the selected environments. This is typically used to test flows across multiple configurations and devices.
    Select 'Run Flows once' to only execute each of the selected flows once on any of the selected environments. This is typically used to execute collection of flows on multiple machines with the purpose of bringing down the total time of execution.
    In any case, the Controller will make sure that only one automation flow is executed at an environment at a time.
    schedule environments
  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 is selected for the schedule. This means an automation flow can get different values to drive the flow with, depending on which schedule it is triggered from. More about how to use scheduled variables.
    schedule variables
  7. On the 'Actions' tab, it is possible to add Actions which are triggered on the specified conditions. Each schedule can contains multiple actions.
    schedule actions

    For each action, select a condition and the actual action:
    condition and actioncondition and action 2To define the details of the action, the schedule offers a number of tokens that can be used to define i.e. 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.
    condition and action 3More about possible integrations with LEAPWORK.

  8. Click 'History' to see a list of events that have happened in relation to this schedule. The list will be empty for new schedules, but as soon as it has been run once, the history list can be a good source for troubleshooting information.
    schedule history
  9. Click 'Save' will create the schedule, and if schedule is enabled, then it will display next run time as per schedule.

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