> OctoPerf load testing - Runtime Scheduler documentation page.

Source: https://api.octoperf.com/doc/runtime/scheduler/

# Scheduler

![scheduler-menu](https://api.octoperf.com/doc/runtime/scheduler/img/scheduler-menu.png){ align=left }

The scheduler page allows you to list and create scheduled jobs in order to run your tests periodically or once in the future.

<div style="clear:both"></div>

## Scheduled Jobs List

![Scheduled Jobs List](https://api.octoperf.com/doc/runtime/scheduler/img/scheduled-jobs-list.png "Scheduled Jobs List")

The scheduler page uses a layout with the list on the left and edition on the right. The list features all the usual possibilities as described in the [dedicated section about lists](https://api.octoperf.com/doc/navigation/#lists).

## Create a scheduled job

![create-scheduled-jobs](https://api.octoperf.com/doc/runtime/scheduler/img/create-scheduled-job.png)

Upon creation of a new scheduled job you need to provide the following information:

| Name         | Description                                                                                                                |
| ------------ |----------------------------------------------------------------------------------------------------------------------------|
| Name         | Name of the schedule                                                                                                       |
| Scenario     | [Runtime scenario](https://api.octoperf.com/doc/runtime/) to use for this schedule, click **Add** to be redirected to the scenario creation process. |
| Subscription | [Subscription](https://api.octoperf.com/doc/account/subscriptions/) to use for this schedule                                              |

Once you've given all the required information, you'll be redirected to [Scheduled job edition](#edit-a-scheduled-job).

## Edit a Scheduled Job

### Info

![schedule-info](https://api.octoperf.com/doc/runtime/scheduler/img/schedule-info.png)

This screen shows a summary of the currently selected schedule.

### Tasks

The schedule creation process can be broken down in two main parts. First we need to create one or several Tasks to be executed as part of this schedule:

![Scheduled tasks](https://api.octoperf.com/doc/runtime/scheduler/img/scheduled-tasks.png "Scheduled tasks")

**Each task consists of**:

| Name          | Description                                                  |
| ------------- | ------------------------------------------------------------ |
| Name          | Name of the schedule.                                        |
| Tags          | Tags to be added to each test runs.                          |
| Scenario      | [Runtime scenario](https://api.octoperf.com/doc/runtime/) to use for this schedule, click **Add** to be redirected to the scenario creation process. |
| Subscription  | [Subscription](https://api.octoperf.com/doc/account/subscriptions/) to use for this schedule. |
| Template      | Default report template to apply to the test results.        |
| Stop on alert | Whether the test should stop if a **Warning** or **Critical** threshold is reached. |

You can add several tasks using the _Add Task_ button. A task can be removed using the _Delete_ button.

!!! note
    Tasks will be executed in sequential order, **when one tasks ends, the next one is started** without delay.

### Trigger

The second step is to pick a trigger among the available options.

!!! warning
    In order to guarantee the task can be executed in OctoPerf, you can only save triggers that are at least 5 minutes (300 seconds) in the future. 

#### Once

This trigger allows you to schedule a single run at a specific time:

![Select Schedule](https://api.octoperf.com/doc/runtime/scheduler/img/trigger.png "Trigger")

#### Cron

The Cron trigger offers a more flexible approach where you can use a [Cron Expression](https://en.wikipedia.org/wiki/Cron#CRON_expression): 

![cron-trigger](https://api.octoperf.com/doc/runtime/scheduler/img/cron-trigger.png)

You can use the Configuration button inside the value field to open a Configuration window: 

![cron-trigger-edition](https://api.octoperf.com/doc/runtime/scheduler/img/cron-trigger-edition.png)

This will simply create the Cron expression for you based on your selection.

### Past Runs List

The scheduled runs table displays a list of test executions for the currently selected Job.

![Scheduled Runs List](https://api.octoperf.com/doc/runtime/scheduler/img/scheduled-runs-list.png "Scheduled Runs List")

For each scheduled run, the list displays:

* The status,
* The duration,
* The stack trace in case of error,
* The last modified date,
* An **Open result** button to open the associated test report.

!!! warning
    Each scheduled run goes through the [scenario check](https://api.octoperf.com/doc/runtime/edit-scenario/scenario-check/) first. When the scenario has an **Error**, the run is refused before any credit is consumed, and its error names the user profile and the problem, for example `Scenario cannot run: Buyer in Paris: No agent running in this location`. Open the scenario to see the problems and fix them: the next runs start again once they are fixed.
