Set up a workflow scheduling rule

Latest Dynatrace

Create a rule that's just right for your workflow using one of the rule types.

List existing scheduling rules

To list existing scheduling rules

  1. Go to Workflows.

  2. Select Settings > Rules.

    From here, you can

    • Create a rule
    • Edit a rule
    • Duplicate a rule
    • Delete a rule
    • View the version history of a rule

Edit an existing rule

To edit an existing scheduling rule

  1. Go to Workflows.
  2. Select Settings > Rules.
  3. Select the rule name.
  4. Follow the instructions below for the rule type.

As you edit your rule, keep an eye on the Scheduled days table displayed on the right. This table is updated as you change rule settings, so you'll know immediately if the rule is doing what you want it to do.

  1. Save your changes.

Create a rule

To create a scheduling rule

  1. Go to Workflows.

  2. Select Settings > Rules.

  3. Select Add Rule.

  4. Edit Untitled rule to a useful name for your new rule.

  5. Select a Rule type.

    Type
    Description
    Recurrence
    The rule will run repeatedly.
    Group
    Combines multiple rules.
    Fixed offset
    Calculate the schedule by taking the days of a rule and moving them by the number of days you set (x) with an offset of those days. The days you select (x) can also be a negative number, for example, -1, to move a day back.
    Conditional offset
    Shift days based on how two rules intersect. It takes every day from the first rule and finds the closest match of the second in the specified direction (previous or next).
  6. Follow the instructions below for the selected rule type.

As you edit your rule, keep an eye on the Scheduled days table displayed on the right. This table is updated as you change rule settings, so you'll know immediately if the rule is doing what you want it to do.

  1. Save your changes.

Recurrence rule

To define a scheduling rule based on Recurrence

  1. Set Rule type to Recurrence.
  2. Set Starts on to the date on which the rule takes effect.
  3. Set Repeats to the number of times to repeat the rule per day, week, month, or year.
  4. Set Every to the days of the week on which to run the rule.
  5. Set Business schedule.
    • Workdays—to run the workflow on a working day in the week.
    • Off days (weekend + holidays)—to run the workflow only on non-working days such as weekends and holidays.
    • Holidays—to run the workflow only on holidays.
  6. Set Calendar to the calendar this rule will follow. If an appropriate calendar is not available, select Create a new calendar to create one.
  7. Select Save.

Advanced options

  • Days of the month—This option restricts the rule to running the workflow on selected days each month. For example, you could run the workflow on the Second to last day of the month.
  • Calendar weeks—Select the weeks the workflow should run. For example, if you select Second, the workflow will run only on the second week of the month.
  • Months—Select multiple months when the workflow should run.
  • Days of the year—Restrict the rule to run the workflow on certain days of the year.

Group rule

The group rule combines the days in three ways. The first one involves combining all the days. The second one intersects days between multiple rules, allowing only the days in all of the rules to be used. The third way is where the rule removes certain days.

To define a Group rule

  1. Set Rule type to Group.
  2. Choose the rule settings
    • required Set On all days of (required) to one or more options from the menu. The workflow will run on the combination of your selection. For example, adding a rule for every Monday and another for every Tuesday will result in the workflow running every Monday and Tuesday.
    • Set if also in if you need to intersect days in the rule. For example, a rule set up for every day in the first week of a month will run on Monday and Tuesday of the first week of every month, in combination with the above example.
    • Set excluding to remove any days included in the above rules. For example, a first-of-the-month rule would remove any Monday or Tuesday of the first week of every month if it's the first of the month.
  3. Select Save.

Fixed offset rule

To define a Fixed offset rule

  1. Set Rule type to Fixed offset.
  2. required Choose the Rule.
  3. required Enter the number of days in with an offset of.
  4. Select Save.

Conditional offset rule

A conditional offset rule shifts days around based on how two rules intersect. It takes every day from the first rule to find the closest match to the second in the specified direction (previous or next). This type of rule can be used for events that commonly use an offset from a date, such as the first Monday after the 15th of every month. Another common use case would be where the offset is the exception, as in every second Thursday, but only if it is a working day; otherwise, it is on the next working day.

To define a Conditional offset rule

  1. Set Rule type to Conditional offset
  2. required Choose when the rule should run from On all days of. For every day, there is a rule: the workflow will run on those days. For example, if there is a rule for every Monday and Tuesday, the rule will run every Monday and Tuesday.
  3. required Choose if also to intersect with days in the rules. For example, a rule set up for every day in the first week of a month, in combination with the above example, will run on Monday and Tuesday of the first week of every month.
  4. Choose between previous and next days in Otherwise on the.
  5. Select Save.

Conditional offset example

Settings

  • Set Rule type to Conditional offset.
  • Select in On all dys of Every second Thursday.
  • Set if also to Every working day.
  • Select from Otherwise on the the next option.

You have two weekly scrum sprints, and your sprint starts every second Thursday, and you want to automate something on sprint change. You create a recurrence rule for every second Thursday. Now, there is an exception. If a Thursday is a public holiday, you wait until the next day; you start the sprint on Friday instead. Unless Friday is also a public holiday, you start on a Monday the week after. This rule says that if the sprint begins on a holiday day, do it on the next working day instead.