# Timed Rules

**Rule Timers** are used to trigger rule logic based on a fixed schedule and therefore allow the time-based evaluation of logic.

{% hint style="info" %}
Timed Rules only support devices as data source. If a rule with a tag as data source is triggered by a timer, the rule execution will be aborted.
{% endhint %}

To add a timer to a rule, click the *Add timer* button at the bottom of the rule detail view.&#x20;

<figure><img src="/files/Uq1RW8E90cO2eticGlUW" alt=""><figcaption></figcaption></figure>

The timer configuration modal provides a configuration wizard for the modes **interval**, **fixed** and **advanced**.

#### Interval Mode

The interval mode provides minute-, hour- and day-interval settings for rule timers and will trigger the rule in the defined interval.

The minute intervals are adjusted by the hour, meaning a 10 minute interval will trigger every 10 minutes of the hour (i.e. XX:10, XX:20, and so on). The next execution will always be the next upcoming interval.

The hour intervals are adjusted by the day, meaning a 6 hour interval will trigger the rule at 06:00, 12:00, 18:00 and 24:00. The next execution will always be the next upcoming interval.

The day interval trigger the rule every day at 00:00 UTC.

#### Fixed Mode

Fixed timers will run every day at the selected time, starting from the day after the selected start date.

#### Advanced Mode

The advanced mode provides an input field for directly specifying a quartz cron-expression in UTC. Refer to this [cron expression generator](https://www.freeformatter.com/cron-expression-generator-quartz.html) for creating a customized rule schedule.

### Output Templating

Since rules are triggered by a timer and not a device, certain properties are not available for output templating, mainly the `{{data.*}}` and all other properties related to the current sample.\
They contain the data and other info related to the uplink. Since, when using a timer, there is no indication which device triggered the rule and therefore all of these properties are not available.

If data from the sample should be necessary for output templating in a timed rule, the `{{dataSources.X.*}}` property can be used instead. Data sources are always resolved with their latest value. If a device has no data (yet) in the akenza database, the data source will not be resolved.&#x20;

See the [Payload Templating](/akenza.io/get-started/reference/message-templating.md#data-source-properties) page for more details and all available properties.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akenza.io/akenza.io/get-started/rule-engine/timed-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
