# Event Trigger

An event is a message that notifies other connectors about a state change, an action, or an occurrence. The **Event Trigger** responds to a specific event generated by another pipeline through the [**Event Publisher**](https://docs.digibee.com/documentation/connectors-and-triggers/connectors/queues-and-messaging/event-publisher).

{% hint style="info" %}
Learn more about [How to use event-driven architecture on the Digibee Integration Platform](https://app.gitbook.com/s/aD6wuPRxnEQEsYpePq36/use-cases/how-to-use-event-driven-architecture-on-the-digibee-integration-platform).
{% endhint %}

## **Parameters**

Configure the trigger using the parameters below.

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>Event Name</strong></td><td>Name of the event the trigger responds to.</td><td>event-trigger</td><td>String</td></tr><tr><td><strong>Expiration</strong></td><td>Time the event remains in the queue, in milliseconds. If the value is equal to 0 or greater than 6h, the expiration will be set to 1/4 of the value configured in <strong>Maximum Timeout</strong>.</td><td>600000</td><td>Integer</td></tr><tr><td><strong>Maximum Timeout</strong></td><td>Maximum time, in milliseconds, that the pipeline can take to process the information before returning a response. Default value: 30000. Maximum limit: 900000.</td><td>30000</td><td>Integer</td></tr><tr><td><strong>Allow Redelivery of Messages</strong></td><td>When enabled, allows messages to be redelivered if a failure occurs in the Pipeline Engine.</td><td>False</td><td>Boolean</td></tr></tbody></table>

## **Message flow**

#### **Input**

The trigger expects a valid message in JSON format. The received message corresponds exactly to the content defined in the `body` attribute of the Event Publisher component.

```json
{
  "id": "1",
  "description": "Description of the case"
}
```

#### **Output**

The connector forwards the message received from the previous connector without making any changes. Based on the example above, the forwarded message will be:

```json
{
  "id": "1",
  "description": "Description of the case"
}
```

## **Event Trigger in action**

**To implement an event-driven architecture, you must define:**

* The pipeline responsible for publishing the event, acting as the publisher.
* One or more pipelines responsible for consuming the event, acting as subscribers.

**To configure the pipeline that will publish the event:**

* Add the [**Event Publisher**](https://docs.digibee.com/documentation/connectors-and-triggers/connectors/queues-and-messaging/event-publisher) to the publisher pipeline.
* Configure the event name in the **Event** property of the Event Publisher.
* If you want to send a payload along with the event, define the content of the **Body** property.

**To configure the pipeline that will consume the event:**

* Change the trigger type to **Event** in the subscriber pipeline.
* Open the trigger settings and enter the event name in the **Event Name** property. This value must be exactly the same as the one configured in the [**Event Publisher**](https://docs.digibee.com/documentation/connectors-and-triggers/connectors/queues-and-messaging/event-publisher) of the publisher pipeline.

## **Limitations**

#### **Event routing limits**

To protect the messaging infrastructure and prevent infinite loops or excessively long chains that could degrade system performance, the Event Trigger enforces an event routing limit.

When an event triggers a chain of other events, for example, a pipeline triggered by an Event Trigger publishes a new event that triggers the same Event Trigger again, the system tracks the number of chained events.

If this count reaches 25 events, which is the default limit, processing of the current event is interrupted.
