# Ubidots event

To trigger a UbiFunction through the Ubidots Events Engine, follow these steps:

### Create a new Event <a href="#id-1-create-a-new-event" id="id-1-create-a-new-event"></a>

Start by creating a new event from the [Events](https://industrial.ubidots.com/app/events/) section under the **Data** tab in the Ubidots navbar.

<figure><img src="/files/F3b6HkrQ4AIAduQThdVE" alt="" width="252"><figcaption></figcaption></figure>

### Configure the Event Triggers <a href="#id-2-configure-the-event-if-trigger" id="id-2-configure-the-event-if-trigger"></a>

Next, configure the event logic using Ubidots' `AND` and `OR` operators.

For additional details on how to configure conditional and complex Event triggers, check out our [Creating Conditional Events and Alerts](https://help.ubidots.com/user-guides/events-creating-conditional-events-and-alerts) user guide.

<figure><img src="/files/5Hhafg5P62RlFe3RW1l0" alt="" width="563"><figcaption></figcaption></figure>

### Configure the UbiFunction Action <a href="#id-3-configure-the-ubifunction-then-action" id="id-3-configure-the-ubifunction-then-action"></a>

Once the **Triggers** logic is configured, create the action that calls a UbiFunction:

**Step 1.** Select the **UbiFunction** action.

<figure><img src="/files/lxoFxuryWcAWh8P5JTdz" alt="" width="563"><figcaption></figcaption></figure>

**Step 2.** Select the method used to trigger the UbiFunction: `GET` or `POST`. The UbiFunction must use the same method. **Note:** When you choose `GET`, the default `Content-Type: application/json` header disappears.

**Step 3.** Search for and select the UbiFunction in the dropdown menu.

**Step 4.** Add the required headers. `POST` requests require the default `Content-Type: application/json` header.

<figure><img src="/files/OXVYJYfP9fbu8FwyJE2X" alt="" width="563"><figcaption></figcaption></figure>

**Step 5.** Customize the **Active trigger** and **Back to normal** messages. **Note:** These fields always expect a JSON object. When the HTTP method is `GET`, the JSON is automatically converted into query parameters and appended to the UbiFunction URL.

<figure><img src="/files/NluElaTzTRDkk07oOvbi" alt="" width="563"><figcaption></figcaption></figure>

**Step 6.** Name the event, set the active days and hours, and save it.

<figure><img src="/files/FtXDgfdNddyp8QvJiRly" alt="" width="563"><figcaption></figcaption></figure>

Your UbiFunction now runs whenever the event is triggered.


---

# 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/ubidots-event.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.
