> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Schedules

export const m_runner = "Maia runner";

export const Projects = () => <>the <strong>Projects</strong> icon <span style={{
  whiteSpace: "nowrap"
}}><img src="/images/global-nav/projects.png" width="20" height="20" style={{
  verticalAlign: "text-bottom",
  display: "inline",
  margin: "0 1px"
}} /></span></>;

export const maia = "Maia";

export const designer = "Designer";

Schedules allow users to run pipelines periodically at specified times.

Schedules can be viewed, created, edited, and deleted from the **Schedules** tab in the Project page. Not added a project yet? Read [Add project](/docs/guides/projects). You can also add a schedule from the pipeline canvas.

When viewing your schedules in the **Schedules** tab, use the drop-down to filter the schedules by environment. You can choose to view the schedules for a selected environment, or schedules in all environments.

<Note>
  Each {maia} account can have a maximum of 1000 schedules. Once you have 1000 schedules, you will need to [delete an existing schedule](#delete-a-schedule) if you want to create a new one.
</Note>

***

## Understanding publishing and scheduling

To create a schedule, you must have published the pipeline that the schedule will run, using the [Push local changes](/docs/guides/git-push) command from a branch in your project and selecting **Publish**.

Publishing creates an artifact that contains all the resources needed to run a specific version of the published pipeline. Artifacts are immutable and independent from the source code in your Git repository. The artifact created when you publish a pipeline is a copy of the pipeline, which is run by a schedule.

It's important to understand this distinction, as it has a number of implications for how schedules interact with pipelines.

* When you delete a pipeline in {designer}, the pipeline copy in the artifact that is run by the scheduler is **not** deleted. This means that scheduled pipelines will continue to run and consume credits after the pipeline is deleted. To prevent this from happening, you must also delete or disable the schedule.
* When you create a schedule and select a previous artifact version, the **Pipeline** drop-down will show all pipelines in that version, including any pipelines you may have deleted in later versions. This is because artifacts are a snapshot of your project at the time of publishing.
* When you edit a pipeline and republish it, all existing schedules running this pipeline where **Always use latest** is selected for the **Artifact** property will automatically use the new version of the pipeline.
* If you edit a pipeline without republishing it, the scheduler will continue to use the previously published version.

Learn more about artifacts [here](/docs/guides/artifacts).

***

## Create a schedule

There are two ways to create a schedule.

From the project:

1. In the left navigation, click <Projects />.
2. Select your project.
3. Click the **Schedules** tab.
4. Click **Add schedule**.
5. Complete the properties on the **Create a new schedule** screen, described below, and then click **Create**.

From the pipeline:

1. On the pipeline canvas, click **Add schedule** in the upper-right.
2. In the **Add schedule** pop-up, click **Schedule**.
3. Complete the properties on the **Create a new schedule** screen, described below, and then click **Create**.

Schedules become active two minutes after creation.

The shortest possible schedule frequency is **one minute**.

### Run now

After creating a schedule, you can run it on demand from the list in the **Schedules** tab. This allows you to run schedules outside their scheduled run time for testing and troubleshooting purposes. After you click **Run now**, the schedule runs with its currently configured artifact.

<Note>
  The **Run now** option is only available for schedules where the **Allow concurrent schedule runs** option is enabled.
</Note>

To run a schedule on demand:

1. In the left navigation, click <Projects />.
2. Select your project.
3. Click the **Schedules** tab.
4. Click the three dots **...** on the corresponding row of the schedule you want to run.
5. Click **Run now**.

***

## Schedule properties

Complete the following properties.

| Property                       | Description                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name                           | A unique, descriptive name for the schedule.                                                                                                                                                                                                                                                                                                                                  |
| Environment                    | Select the environment where the pipeline you want to schedule is published. The schedule will run the pipeline using this environment's data warehouse connection and defaults. Read [Add environment](/docs/guides/environments) to learn more about environments.                                                                                                          |
| Artifact                       | Select the artifact to which the pipeline you want to schedule belongs. This is the name you gave the version when you published. Choose **Always use latest** if you want the schedule to update automatically as new versions of the pipeline are published. The **Always use latest** setting is ideal for non-production environments but not recommended for production. |
| Pipeline                       | Select a pipeline to run in the schedule.                                                                                                                                                                                                                                                                                                                                     |
| Agent                          | A working {m_runner}. This is only required if you have a [Hybrid SaaS solution](/docs/guides/runner-overview#matillion-fully-managed-vs-hybrid-cloud). To learn how to create a {m_runner}, read [Create a {m_runner}](/docs/guides/create-a-runner).                                                                                                                        |
| Timezone                       | Select a timezone for the schedule to adhere to.                                                                                                                                                                                                                                                                                                                              |
| Starts on                      | Select the date and time that the schedule will be enabled. This is not necessarily the time of the first schedule run. For example, if your start date and time is 1st August 2024 at 5:00 PM, with a schedule set to run every day at 8:00 AM, your pipeline will first run at 8:00 AM on 2nd August 2024.                                                                  |
| Allow concurrent schedule runs | On by default. When switched on, scheduled pipeline runs will always start, even if the previous run is still in progress. When switched off, scheduled pipeline runs will be skipped (not queued) if a previous pipeline run is still in progress.                                                                                                                           |

<Note>
  {m_runner}s can be restricted to specific projects and environments. If a {m_runner} is not allowed for your project or environment, it will not appear in the **Runner** drop-down. For more information, read [Restricting {m_runner}s](/docs/guides/restrict-a-runner).

  If a {m_runner} that a schedule already uses is later restricted away from the schedule's project or environment, the schedule remains in place but its next execution is prevented and recorded with a **Forbidden** status in [pipeline run history](/docs/guides/pipeline-run-history). Edit the schedule to select a different {m_runner}, or update the {m_runner}'s allow list, to resume scheduled runs.
</Note>

To complete the schedule, select either the **Standard** or **Advanced** tab.

A **Standard** schedule is created by selecting the schedule interval from drop-downs:

| Property     | Description                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| Repeat every | The interval between schedule runs.                                                                               |
| Unit         | The units of the **Repeat every** interval. Options are **Day** (the default), **Week**, **Hour**, or **Minute**. |

Use these two properties together to specify the schedule interval. Depending on the **Unit** selected, further properties will be available to precisely specify the scheduled time, as follows:

* **Day:** Select the **Hour** and **Minute** of the day that the schedule will run.
* **Week:** Select the day of the week, and then the **Hour** and **Minute** of the day that the schedule will run.
* **Hour:** Select the **Minute** past the hour that the schedule will run.

Using these combinations of drop-downs allows you to specify a variety of precise schedule intervals, but there may be cases where you can't find a way to express the interval you need. In these cases, you can use the **Advanced** tab and specify the schedule interval using a **Cron expression**. Any valid Cron expression can be used. When specified, it overrides the standard schedule settings. Some examples are given in the following section.

***

## Cron expression examples

| Expression                   | Description                                                          |
| ---------------------------- | -------------------------------------------------------------------- |
| `0 15,30,45 * ? * *`         | Every hour at minutes 15, 30 and 45.                                 |
| `0 0 12 1 * ?`               | Every month on the 1st, at noon.                                     |
| `0 0 12 15 * ?`              | Every month on the 15th, at noon.                                    |
| `0 0 12 1/4 * ?`             | Every 4 days starting on the 1st of the month, at noon.              |
| `0 0 12 L * ?`               | Every month on the last day of the month, at noon.                   |
| `0 0 12 LW * ?`              | Every month on the last weekday, at noon.                            |
| `0 0 12 6L * ?`              | Every month on the last Friday, at noon.                             |
| `0 0 12 1W * ?`              | Every month on the nearest weekday to the 1st of the month, at noon. |
| `0 0 12 ? * 2#1`             | Every month on the first Monday of the month, at noon.               |
| `0 0 12 ? * 5#3`             | Every month on the third Thursday of the month, at noon.             |
| `0 0 12 ? JAN *`             | Every day at noon in January only.                                   |
| `0 0 12 ? JAN,JUN *`         | Every day at noon in January and June.                               |
| `0 0 12 ? DEC *`             | Every day at noon in December only.                                  |
| `0 0 12 ? JAN,FEB,MAR,APR *` | Every day at noon in January, February, March and April.             |
| `0 0 12 ? 9-12 *`            | Every day at noon between September and December.                    |
| `0 30 6 ? * 2-6`             | Every weekday at 6:30 AM.                                            |

***

## Edit a schedule

1. Navigate to the **Schedules** tab.
2. Click the three dots **...** on the corresponding row of a schedule you want to edit.
3. Click **Edit schedule**.
4. Make changes to the schedule.
5. Click **Update**.

***

## Delete a schedule

1. Navigate to the **Schedules** tab.
2. Click the three dots **...** on the corresponding row of a schedule you want to delete.
3. Click **Delete schedule**.
4. Click **Yes, delete** to confirm deletion. Otherwise, click **Cancel**.

***

## Schedule metadata

The **Schedules** tab displays metadata about each schedule, including:

* The name of the schedule.
* The [environment](/docs/guides/environments) that defines the connection between your project and your cloud data warehouse.
* The pipeline that the schedule will run, including its folder path.
* The artifact that identifies the version of the pipeline that is run. If **Always use latest** is displayed, this schedule will always use the latest version of the pipeline.
* The frequency of the schedule, e.g. 8:00am every day.
* The status of the schedule, which is either Enabled or Disabled.

<Note>
  If you have deleted a pipeline in {designer}, remember to delete or disable any schedules that run the deleted pipeline. Otherwise, these schedules will continue to run the pipeline using the artifact.
</Note>

***

## Schedules and daylight saving time

If a schedule is set to run during the transition from standard time to daylight saving time (or the reverse), this can result in the following unexpected behaviors.

During the autumn change from daylight saving time to standard time, a task scheduled to start at 1:00 AM in the America/Los\_Angeles time zone (i.e. `0 1 * * * America/Los_Angeles`) will run **twice** because the local time shifts from 1:59 AM back to 1:00 AM. As a result, there are two points during that day when the local time is 1:00 AM, so the schedule is triggered twice.

During the spring change from standard time to daylight saving time, a task scheduled to start at 2:00 AM in the America/Los\_Angeles time zone (i.e. `0 2 * * * America/Los_Angeles`) will **not** run because the local time shifts from 1:59 AM to 3:00 AM. As a result, there is no point during that day when the local time is 2:00 AM, so the schedule is not triggered.
