# Time-based Trigger

You can schedule your function's execution using the *Time-based trigger* in the settings panel. It lets you trigger the function **every x minutes** or with a **Crontab expression**:

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

### Every x minutes

You can trigger a function at periodic intervals, expressed in minutes. This trigger method runs the UbiFunction's `main` function. The minimum and maximum values allowed in this field are 1 and 60 minutes, respectively.

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

### Crontab expression

A cron expression is a string made up of five subexpressions, or fields, that define the schedule. These fields are separated by whitespace and can contain any allowed values, with various combinations of the allowed characters for each field.

| Field        | Values          | Wildcards |
| ------------ | --------------- | --------- |
| Minutes      | 0-59            | , - \* /  |
| Hours        | 0-23            | , - \* /  |
| Day-of-month | 1-31            | , - \* /  |
| Month        | 1-12 or JAN-DEC | , - \* /  |
| Day-of-week  | 1-7 or SUN-SAT  | , - \* /  |

**Wildcards**

<table><thead><tr><th width="135">Wildcard</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>comma ","</td><td>List of allowed values</td><td>In the Month field, JAN,FEB,MAR includes January, February, and March.</td></tr><tr><td>dash "-"</td><td>Range of allowed values</td><td>In the Day field, 1-15 includes days 1 through 15 of the specified month.</td></tr><tr><td>asterisk "*"</td><td>Includes all values in the field</td><td>In the Hours field, * includes every hour</td></tr><tr><td>slash "/"</td><td>Specifies increments</td><td>In the Minutes field, you could enter 1/10 to specify every tenth minute, starting from the first minute of the hour.</td></tr></tbody></table>

{% hint style="info" %}
Use [crontab.guru](https://crontab.guru/) to test your crontab expressions.
{% endhint %}

**Limitations**

* Cron expressions that lead to rates faster than 1 minute are not supported.

**Examples**

You can use the following sample cron strings when creating a rule with a schedule:

<table><thead><tr><th width="109">Minutes</th><th width="77">Hours</th><th width="117">Month day</th><th width="84">Month</th><th width="106">Week day</th><th>Meaning</th></tr></thead><tbody><tr><td>0</td><td>10</td><td>*</td><td>*</td><td>*</td><td>Run at 10:00 a.m. (UTC+0) every day</td></tr><tr><td>15</td><td>12</td><td>*</td><td>*</td><td>*</td><td>Run at 12:15 p.m. (UTC+0) every day</td></tr><tr><td>0</td><td>18</td><td>*</td><td>*</td><td>MON-FRI</td><td>Run at 6:00 p.m. (UTC+0) every Monday through Friday</td></tr><tr><td>0</td><td>8</td><td>1</td><td>*</td><td>*</td><td>Run at 8:00 a.m. (UTC+0) every 1st day of the month</td></tr><tr><td>0/15</td><td>*</td><td>*</td><td>*</td><td>*</td><td>Run every 15 minutes</td></tr><tr><td>0/10</td><td>*</td><td>*</td><td>*</td><td>MON-FRI</td><td>Run every 10 minutes Monday through Friday</td></tr><tr><td>0/5</td><td>8-17</td><td>*</td><td>*</td><td>MON-FRI</td><td>Run every 5 minutes Monday through Friday between 8:00 a.m. and 5:55 p.m. (UTC+0)</td></tr><tr><td>0/30</td><td>20-2</td><td>*</td><td>*</td><td>MON-FRI</td><td><p>Run every 30 minutes Monday through Friday between 10:00 p.m. on the starting day to 2:00 a.m. on the following day (UTC)</p><p>Run from 12:00 a.m. to 2:00 a.m. on Monday morning (UTC).</p></td></tr></tbody></table>

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


---

# 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://dev.ubidots.com/ubifunctions/invocation/time-based-trigger.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.
