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

# Schedule Trigger

## Introduction

<Info>
  * Triggers are available for workflow applications only.

  * Each workflow can have at most one schedule trigger.
</Info>

Schedule triggers enable your workflow to run at specified times or intervals. They are ideal for recurring tasks like generating daily reports or sending scheduled notifications.

## Add a Schedule Trigger

On the workflow canvas, right-click and select **Add Node** > **Start** > **Schedule Trigger**.

## Configure a Schedule Trigger

You can configure the schedule using either the default visual picker or a cron expression.

After configuration, you can see the next 5 scheduled execution times.

<Info>
  Schedule triggers do not produce output variables, but they update the system variable `sys.timestamp` (the start time of each workflow execution) each time they initiate the workflow.
</Info>

### With the Visual Picker

Use this for simple hourly, daily, weekly, or monthly schedules. For weekly and monthly frequencies, you can select multiple days or dates.

### With a Cron Expression

Use this for more complex and precise timing patterns, such as every 15 minutes from 9 AM to 5 PM on weekdays.

<Tip>
  You can use LLMs to generate cron expressions.
</Tip>

#### Standard Format

A cron expression is a string that defines the schedule for executing your workflow. It consists of five fields separated by spaces, each representing a different time unit.

<Note>
  Ensure that there is a single space between each field.
</Note>

```
* * * * *
| | | | |
| | | | |── Day of week (0-7 or SUN-SAT, where both 0 and 7 = Sunday)
| | | |──── Month (1-12 or JAN-DEC)
| | |────── Day of month (1-31)
| |──────── Hour (0-23)
|────────── Minute (0-59)
```

<Info>
  When both the **day-of-month** and **day-of-week** fields are specified, the trigger activates on dates that match *either* field.

  For example, `1 2 3 4 4` will trigger your workflow on the 3rd of April *and* every Thursday in April, not just on Thursdays that fall on the 3rd.
</Info>

#### Special Characters

| Character | Description                                                                                                                                                                                                                                                                                                  | Example                                                                                                                                                                                                                                |
| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `*`       | Means "every".                                                                                                                                                                                                                                                                                               | `*` in the **hour** field means "every hour".                                                                                                                                                                                          |
| `,`       | Separates multiple values.                                                                                                                                                                                                                                                                                   | `1,3,5` in the **day-of-week** field means "Monday, Wednesday, and Friday".                                                                                                                                                            |
| `-`       | Defines a range of values.                                                                                                                                                                                                                                                                                   | `9-17` in the **hour** field means "from 9 AM to 5 PM".                                                                                                                                                                                |
| `/`       | Specifies step values.                                                                                                                                                                                                                                                                                       | `*/15` in the **minute** field means "every 15 minutes".                                                                                                                                                                               |
| `L`       | Means "the last". <br /><br />In the **day-of-month** field, means "the last day of the month".<br /><br />In the **day-of-week** field:<ul><li>When used alone, means "the last day of the week".</li><li>When combined with a number, means "the last occurrence of that weekday in the month". </li></ul> | `L` in the **day-of-month** field means "Jan 31, April 30, or Feb 28 in a non-leap year".<br /><br />`L` in the **day-of-week** field means Sunday.<br /><br />`5L` in the **day-of-week** field means "the last Friday of the month". |
| `?`       | Means "any" or "no specific value".<br /><br />If you specify a value for the **day-of-week** field, you can use `?` for the **day-of-month** field to ignore it, and vice versa.<br /><br />Not required, because `*` works as well.                                                                        | To run a task every Monday, it's more precise to set the **day-of-month** field to `?` instead of `*`.                                                                                                                                 |

#### Predefined Expressions

* `@yearly`: Run once a year at 12 AM on January 1.
* `@monthly`: Run once a month at 12 AM on the first day of the month.
* `@weekly`: Run once a week at 12 AM on Sunday.
* `@daily`: Run once a day at 12 AM.
* `@hourly`: Run at the beginning of every hour.

#### Examples

| Schedule                                | Cron Expression                    |
| :-------------------------------------- | :--------------------------------- |
| Weekdays at 9 AM                        | `0 9 * * MON-FRI` or `0 9 * * 1-5` |
| Every Wednesday at 2:30 PM              | `30 14 * * WED`                    |
| Every Sunday at 12 AM                   | `0 0 * * 0`                        |
| Every 2 hours on Tuesday                | `0 */2 * * 2`                      |
| The first day of every month at 12 AM   | `0 0 1 * *`                        |
| At 12 PM on January 1 and June 1        | `0 12 1 JAN,JUN *`                 |
| The last day of every month at 5 PM     | `0 17 L * *`                       |
| The last Friday of every month at 10 PM | `0 22 * * 5L`                      |

## Test a Schedule Trigger

* **Run this step**: The schedule trigger runs immediately, ignoring the configured schedule.

* **Test Run**: The schedule trigger waits for its next scheduled execution time.
