---
schema_version: "1"
id: c587c1f44d3b08991055ab503ef6456a3162332d847081dc7e74e9141af53c56
title: Scheduler Endpoint (Trigger)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.3/scheduler-concept.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.3/scheduler-concept
source_site: docs.mulesoft.com
content_type: documentation
content_hash: dbc5010b65e29f85e278dc5c89e8ca73619baaa9ee17bfee8dcd7c3ab3885a1f
description: MuleSoft Documentation Site
release: "4.3"
latest: false
---
---
product: Mule Runtime
version: 4.3
---

# Scheduler Endpoint (Trigger)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The Scheduler component enables you to trigger a flow when a time-based condition is met. You can
configure it to be triggered at a regular interval or give it a more flexible cron expression. For
example, a Scheduler might trigger an event to start a flow every 5 seconds.

Consider the following when you implement a Scheduler in your Mule application:

- Schedulers use the same timezone as the machine on which Mule is running. However, if an
  application is running in CloudHub, the Scheduler conforms to the UTC timezone, regardless of the
  geographic region in which the application is running.

- The `disallowConcurrentExecution` property enables you to prevent the Scheduler from re-triggering
  a flow until it finishes processing. See
  [<scheduler> Properties](https://docs.mulesoft.com/mule-runtime/4.3/scheduler-xml-reference#scheduler-properties).

- If [back-pressure](https://docs.mulesoft.com/mule-runtime/4.3/execution-engine#backpressure) occurs because no resources are available at the
  time of the scheduled trigger, Mule skips the trigger.

- In a Mule runtime engine cluster or multi-worker CloudHub deployment, the Scheduler runs (or
  triggers the flow) only on the primary node (that is, only in one Mule instance).

## Example Projects

There are several example projects in Anypoint Exchange that you can open in Anypoint Studio to
learn more about how to use the Scheduler component:

- _Data Sync Using Watermarking and Batch_

- _Import Contacts into Microsoft Dynamics CRM_

- _Import Leads into Salesforce_

- _Importing a CSV File into mongoDB_

- _Importing an Email Attachment Using the IMAP Connector_

- _Salesforce to MySQL Database Using Batch Processing_

- _Sending a CSV File Through Email Using SMTP_

To download and open an example project while you are in Anypoint Studio, click the Exchange icon in
the upper-left corner. Then, in the window that opens, log into Anypoint Exchange and search on the
name of the project.

## Fixed Frequency

You can use the following parameters to set a Scheduler to trigger a flow at a regular intervals.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td><p><strong>Frequency</strong></p></td><td><p>The frequency at which the Scheduler triggers the flow. You select the unit of time in the <strong>Time unit</strong> field. Setting the value to <code>0</code> or a negative value causes the default value to be used.</p></td><td><p>1000</p></td></tr><tr><td><p><strong>Start Delay</strong></p></td><td><p>The amount of time to wait before triggering the flow for the first time after the application is started. This value is expressed in the same unit of time as the frequency.</p></td><td><p>0</p></td></tr><tr><td><p><strong>Time Unit</strong></p></td><td><p>The time unit for the values of <strong>Frequency</strong> and <strong>Start Delay</strong>. The possible values are:</p><p>MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS</p></td><td><p>MILLISECONDS</p></td></tr></tbody></table>

## Cron Expressions

Cron is a widely used standard for describing time and date information.

The Scheduler keeps track of every second and creates a Mule event when the Quartz Cron expression
matches your time-date setting. You can trigger the event just once or at regular intervals.

A date-time expression consists of six required settings and can include the optional year setting.
You specify the settings in the following order:

1.  Seconds (0-59)

2.  Minutes (0-59)

3.  Hours (0-23)

4.  Day of month (1-31)

5.  Month (1-12 or JAN-DEC)

6.  Day of the week (1-7 or SUN-SAT)

7.  Year (empty or a 4-digit year between 1970-2099, for example, 2019)

The Scheduler supports Quartz Cron expressions. Here are a few examples:

<table><colgroup><col> <col></colgroup><thead><tr><th>Expression</th><th>Behavior</th></tr></thead><tbody><tr><td><p><code>1/2 * * * * ?</code></p></td><td><p>Run every 2 seconds of the day, every day.</p></td></tr><tr><td><p><code>0 15 10 ? * *</code></p></td><td><p>Run at 10:15 a.m., every day. <code>0 15 10 * * ? *</code> and <code>0 15 10 * * ?</code> produce the same effect.</p></td></tr><tr><td><p><code>0 15 10 * * ? 2019</code></p></td><td><p>Run at 10:15 a.m., every day during the year 2019.</p></td></tr><tr><td><p><code>0 * 14 * * ?</code></p></td><td><p>Run every minute starting at 2pm and ending at 2:59pm, every day.</p></td></tr><tr><td><p><code>0 0/5 14 * * ?</code></p></td><td><p>Run every 5 minutes starting at 2pm and ending at 2:55pm, every day</p></td></tr><tr><td><p><code>1 1 1 1,7 * ?</code></p></td><td><p>Run the first second of the first minute of the first hour, on the first and seventh day, every month.</p></td></tr></tbody></table>

Note that the Scheduler component also supports Quartz Scheduler special characters:

- `*`: All values.

- `?`: No specific value.

- `-`: Range of values, for example, `1-3`.

- `,`: Additional values, for example, `1,7`.

- `/`: Incremental values, for example, `1/7`.

- `L`: Last day of the week or month, or last specific day of the month (such as `6L` for the last
  Saturday of the month).

- `W`: Weekday, which is valid in the day-of-month field and must follow a specific day. For
  example, `15W` for the weekday nearest to the 15th of the month.

- `#`: Nth day of the month. For example, `#3` is the third day of the month.

See [CronExpression](https://www.quartz-scheduler.org/api/2.3.0/org/quartz/CronExpression.html) for
more information.

This example logs the message "hello" every second:

```XML
<flow name="cronFlow" doc:id="ae257a5d-6b4f-4006-80c8-e7c76d2f67a0" >
  <scheduler doc:name="Scheduler" doc:id="e7b68ccb-c6d8-4567-87af-aa7904a50359" >
    <scheduling-strategy >
      <cron expression="* * * * * ?" timeZone="America/Los_Angeles"/>
    </scheduling-strategy>
  </scheduler>
  <logger level="INFO" doc:name="Logger" doc:id="e2626dbb-54a9-4791-8ffa-b7c9a23e88a1" message='"hello"'/>
</flow>
```

Note that there are a number of free online tools that can help you build Cron expressions.

### Time Zones (timeZone)

For Cron configurations, Java `timeZone` values are supported. You should avoid the Java
abbreviations, such as `PST` and `AGT`, and instead use the full-name Java equivalents, such as
`America/Los_Angeles` and `America/Argentina/Buenos_Aires`.

## Debugging

In the Studio **Debug Mode** view, the Mule app disables the triggering of events. You can instead
execute the Scheduler component when debugging by clicking the green arrow icon that appears at the
bottom of the component.

## See Also

- [Scheduler XML Reference](https://docs.mulesoft.com/mule-runtime/4.3/scheduler-xml-reference)
