# Trigger shape (event listener)

## Introduction

[Event connectors](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta) can trigger process flows by listening for events that are published to message queues/topics by a message broker (e.g. [RabbitMQ](https://www.rabbitmq.com/)).

Once an event connector is [configured](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta/adding-a-new-event-connector), it becomes available for use as a process flow trigger.&#x20;

## Need to know

* New event connectors are available for selection in process flow [trigger shapes](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape/trigger-shape-event-listener) as soon as they are saved successfully.
* Event connector triggers only become active when the process flow is [deployed](https://doc.wearepatchworks.com/product-documentation/process-flows/process-flow-versioning#deploying-a-draft-or-inactive-version) and [enabled](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/enabling-and-disabling-a-process-flow/enabling-and-disabling-a-process-flow-without-virtual-enviroments).
* ALL messages published to selected queues/topics are passed through to the process flow.

## Adding an event connector trigger

Follow the steps below to add an event connector as a process flow trigger.

**Step 1**\
Click the **settings** icon associated with the **trigger shape** in your process flow:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FWCu55ksHS5gGL7XSoSO2%2Fconfigure%20trigger%201a.png?alt=media&#x26;token=1ff1d53e-a5ef-46e1-9339-d7a740c258a1" alt="" width="289"><figcaption></figcaption></figure></div>

**Step 2**\
Click the **add new event listener** button:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FVWbYPBvUC9pOZZAMQGPp%2Ftrigger%20shape%20-%20add%20event%20listener%201.png?alt=media&#x26;token=e8a720e6-5a11-4945-9f2c-3b92ae232f41" alt="" width="357"><figcaption></figcaption></figure></div>

...event options are displayed:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F3fFpiO1VpA1d1U1Z0hEs%2Fconfigure%20trigger%203.png?alt=media&#x26;token=b26158ec-115e-4112-8c4f-e0f9d0293026" alt="" width="348"><figcaption></figcaption></figure></div>

**Step 3**\
Select a **broker** from the list (all configured [event connectors](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta) are available for selection):

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FoSRIpXZDFlOQceiBfZUG%2Fconfigure%20trigger%204.png?alt=media&#x26;token=8591deae-b5de-4aeb-aba3-01b934f50eb0" alt="" width="351"><figcaption></figcaption></figure></div>

**Step 4**\
Select a **queue** from the list - all configured [message queues/topics](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta/message-queues-topics) for the selected **broker** (i.e. [event connector](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta))  are available for selection:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FTTc0zb82xZz2Ai9PaUzq%2Fconfigure%20trigger%205.png?alt=media&#x26;token=d7bb11b0-ae7f-4a0f-8bd6-42e02630be18" alt="" width="351"><figcaption></figcaption></figure></div>

**Step 5**\
Save the shape settings.

{% hint style="info" %}
Remember that event connector triggers only become active when the process flow is [deployed](https://doc.wearepatchworks.com/product-documentation/process-flows/process-flow-versioning#deploying-a-draft-or-inactive-version) and [enabled](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/enabling-and-disabling-a-process-flow/enabling-and-disabling-a-process-flow-without-virtual-enviroments).
{% endhint %}

## Related information

* [Event connectors](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/event-connectors-beta)
