Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+

Scheduler Endpoint (Trigger)

The Scheduler component allows 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.

Schedulers follow the timezone used by the machine where the Mule runtime is running. In case of deploying to a CloudHub worker, its timezone corresponds to the region of the worker.

Fixed Frequency

You can set a Scheduler so that it triggers your flow at a regular interval. This is the easiest way to set it up. For this you can select a time unit, an amount of time between triggers and an initial delay before the first triggering occurs.

Cron Expressions

Cron is a widely used standard for describing time and date information. It can be used to signal a specific event that occurs just once, or a recurring event that might be yearly, monthly, weekly, daily, hourly, etc.

The condition is evaluated every time the time changes (every second) and produces a trigger when true.

The expression consists of 6 or 7 items, where they represent the following, in order:

  • Seconds

  • Minutes

  • Hours

  • Month

  • Day of month

  • Day of the week

  • Year (optional)

Here are a few sample Cron expressions:

Expression Behavior

0 15 10 * * *

Run at 10:15am every day

0 15 10 * * ? 2005

Run at 10:15am every day during the year 2005

0 * 14 * * ?

Run every minute starting at 2pm and ending at 2:59pm, every day

0 0/5 14 * * ?

Run every 5 minutes starting at 2pm and ending at 2:55pm, every day

1 1 1 1,7 * ?

Run the first day of January and the first day of June, every year (in the first second of the first minute of the first hour)

Note that there are a number of free online tools that can help you build cron expressions by filling in a form, without needing to learn the syntax.

When debugging a flow with a Scheduler, the scheduling frequency is ignored. This prevents events from piling up while you are stepping through the flow.
You can click the green arrow icon at the bottom of the Scheduler component in your canvas to trigger a poll.