> For the complete documentation index, see [llms.txt](https://dev.ubidots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ubidots.com/ubifunctions/invocation/time-based-trigger.md). Agents can also search and read this documentation through its [MCP server](https://dev.ubidots.com/~gitbook/mcp).

# Schedule

Run an UbiFunction on a schedule, every x minutes or on a crontab expression in UTC.

The **Schedule** card in **Settings > Invocation** runs the function on a timer, in UTC. Choose one of three options in **Time-based trigger**:

* **None** (default): not scheduled. The function runs only when it's called.
* **Every x minutes**: runs every 1 to 60 minutes.
* **Crontab expression**: runs on a crontab schedule.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fgit-blob-dfdf2ce10b3ef34938ce3075ff62c80d78b963e6%2Fubifunctions-settings-schedule.png?alt=media" alt="Schedule card with the Time-based trigger options None, Every x minutes and Crontab expression"><figcaption></figcaption></figure>

A scheduled run receives no caller data. `args` only contains `_auth_token`, when a [token](https://dev.ubidots.com/ubifunctions/auth-and-environment/account-token.md) is selected. Keep any other input in [environment variables](https://dev.ubidots.com/ubifunctions/auth-and-environment/environment-variables.md) or in your code.

### Every x minutes

Runs the function at a fixed interval, in minutes. The minimum is 1 minute and the maximum is 60 minutes.

### Crontab expression

Runs the function on a schedule you define with a crontab expression, in **UTC**. A crontab 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, */10 runs every tenth minute: 0, 10, 20 and so on.</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**

Sample crontab expressions. All times are UTC:

<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>*/15</td><td>*</td><td>*</td><td>*</td><td>*</td><td>Run every 15 minutes</td></tr><tr><td>*/10</td><td>*</td><td>*</td><td>*</td><td>MON-FRI</td><td>Run every 10 minutes Monday through Friday</td></tr><tr><td>*/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></tbody></table>

{% hint style="info" %}
A scheduled run calls the function directly, not through its URL, so it isn't affected by a required [function secret](https://dev.ubidots.com/ubifunctions/auth-and-environment/function-secret.md). If the scheduled function calls another of your functions that requires a secret, send that secret in the request, for example from an [environment variable](https://dev.ubidots.com/ubifunctions/auth-and-environment/environment-variables.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ubidots.com/ubifunctions/invocation/time-based-trigger.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
