# Event Service

Certain types of actions that are performed in one module require follow-up actions in other modules. These actions, or events, can be registered in the Event Module by the “event-informing service” (or the customer’s application). Subsequently, the Event Service notifies the relevant “event-receiving services” of the occurred action. Which types of events each service receives, is configured within Subscription objects.

#### Example

When a User object is removed, the User module creates an Event to notify other services. Only the services that are subscribed to this type of Events will be notified. The customer can configure follow-up actions via the Dispatcher module, e.g. deleting all personally identifiable information (PII) of the removed user.

![](/files/JE8XwuKOT9nrpssVEHb0)

For a list of events produced by the Extra Horizon platform, see the [System Events](/extrahorizon/services/automation/event-service/system-events.md) page.

## Create a custom event

Extra Horizon services create different types of events on which you can act from within your cluster. If required you can create your own custom events.

{% tabs %}
{% tab title="Javascript" %}

```typescript
const customEvent = await exh.events.create({
  type: 'myCustomEvent',
  content: {
    key:  'value'
  }
});
```

{% endtab %}
{% endtabs %}

## List events

You can search and list events that occurred within your cluster.

{% tabs %}
{% tab title="Javascript" %}

```typescript
const events = await exh.events.find();
```

{% endtab %}
{% endtabs %}


---

# 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.extrahorizon.com/extrahorizon/services/automation/event-service.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.
