Contact Free trial Login

Scheduler XML Reference

A XML for the Scheduler has these elements:

  • scheduler parent element that encloses the rest of the elements.

  • scheduling-strategy block inside scheduler.

  • fixed-frequency or cron element inside the scheduling-strategy block.

<scheduler> Properties

Attribute Description Example

disallowConcurrentExecution

Skips the next scheduled flow execution if the last one has not ended. Next attempt to execute will be after another frequency period. Default value is true.

disallowConcurrentExecution="false"

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
    <flow name="componentsFlow">
      <scheduler doc:name="Scheduler" disallowConcurrentExecution="true">
        <scheduling-strategy >
          <fixed-frequency frequency="1000"/>
        </scheduling-strategy>
      </scheduler>
    </flow>
</mule>

<fixed-frequency> Properties

Attribute Description Example

frequency

Triggering frequency, relative to time unit. When set to 0 or a negative value, it switches to the default (1 minute).

frequency="1000"

timeUnit

The time unit for the frequency and startDelay values:

MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS

timeUnit="MILLISECONDS"

startDelay

Upon triggering the flow for the first time, Mule delays the first execution of the scheduler for a specific amount of time. This time period is expressed in the same time units as the frequency.

startDelay="0"

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

    <flow name="componentsFlow">
        <scheduler>
            <scheduling-strategy>
                <fixed-frequency startDelay="5" frequency="10" timeUnit="SECONDS"/>
            </scheduling-strategy>
        </scheduler>
        <logger message="my message"/>
    </flow>

</mule>

<cron> Properties

For more complex scheduling strategies, you can use a cron expression.

Parameter Default Value Description Example

expression

-

Use a cron expression for when to do a trigger.

expression="1 1 1 1,7 * ?"

timeZone

Time zone passed as system property, or in machine’s operating system.

Timezone in Java time zone format

timeZone="America/Argentina/Buenos_Aires"

Example that uses a cron expression:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

    <flow name="componentsFlow">
        <scheduler>
            <scheduling-strategy>
                <cron expression="0 0 12 * * ?"/>
            </scheduling-strategy>
        </scheduler>
        <logger message="my message"/>
    </flow>

</mule>

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub