# Custom events

**Custom events are special nodes which can alter the flow, allowing for a cleaner and more readable graph. They are also used to execute actions based on inputs deriving from an user interface.**

<div align="left"><figure><img src="https://1176054007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F16eHiWrLvkdzPgx4n88e%2Fuploads%2F2KyV7ANBEAcfVW1upwPG%2Fimage.png?alt=media&#x26;token=b946d21b-3127-491c-b94d-e4871fb8b87e" alt=""><figcaption></figcaption></figure></div>

## Using custom events

To create a custom event, add it as an usual node and give it an unique **EventName** (which will be id the caller will need to use to call it). To call the custom event, add a **CallCustomEvent** node and use the same **EventName** as the **CustomEvent** node.

<div align="left"><figure><img src="https://1176054007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F16eHiWrLvkdzPgx4n88e%2Fuploads%2FFvdvCDeTFsnyBT03wPHm%2Fimage.png?alt=media&#x26;token=fb759495-f434-4660-b8ac-44df39c6b7a7" alt="" width="467"><figcaption></figcaption></figure></div>

{% hint style="warning" %}

* Custom events can't have the same **EventName**. Names must be unique. Failing in so results in a building error.
* **EventName** inputs are case sensitive. Always check if the two names correspond or use copy and paste to minimize the chance of typos. Event callers without a corresponding **EventName** will result in a building error.
  {% endhint %}

## UI custom events

Custom events are also used to receive inputs from user interface elements and execute an action with them. They can either receive a **boolean** or **single** (float) value.&#x20;

UI nodes passing a boolean argument are:

* AddCheckbox

<div align="left"><figure><img src="https://1176054007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F16eHiWrLvkdzPgx4n88e%2Fuploads%2F6gFE8m8NnrN6NDBQ3Gxx%2Fimage.png?alt=media&#x26;token=f21ce7cc-7839-49e5-bd72-35e4159083be" alt="" width="563"><figcaption><p>checkbox ui node passing a <strong>boolean</strong> value to a custom event</p></figcaption></figure></div>

UI nodes passing a float argument are:

* AddSlider

<div align="left"><figure><img src="https://1176054007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F16eHiWrLvkdzPgx4n88e%2Fuploads%2FhrbBh3MN17h0bY9sD2l5%2Fimage.png?alt=media&#x26;token=6803426a-8d38-41d2-89d1-409d35047bc3" alt="" width="563"><figcaption><p>slider ui node passing a <strong>single</strong> (float) value to a custom event</p></figcaption></figure></div>


---

# 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://alexs-organization-34.gitbook.io/rednodeeditor/usage/custom-events.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.
