# Trigger

It helps you start automated actions based on real-time activities such as new messages, form submissions, or updates in integrated systems.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F0sc62OAamGPHeZLdeZX4%2Fimage.png?alt=media&#x26;token=86cae405-4d7a-4815-afd6-522e467d2a24" alt="Trigger component in the Fastn flow editor canvas"><figcaption></figcaption></figure>

* You can add this component by searching for **Trigger** in your flow. Once added, you’ll first need to **select an app** from the available list or search for the required one.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FFM4nJZEKfxMyfOQR8NmX%2Fimage.png?alt=media&#x26;token=469f5f1b-1791-48db-95a9-613e6519b945" alt="App selection panel showing available apps for the Trigger component"><figcaption></figcaption></figure>

* After selecting the app, connect and authenticate your account to enable access.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FefdGM8zhcZka2elzrAzU%2Fimage.png?alt=media&#x26;token=6b949a93-fcad-4d2b-97d3-134250395da0" alt="Account authentication dialog for connecting an app to the Trigger"><figcaption></figcaption></figure>

* After saving, the Trigger will automatically listen for the selected event.

{% hint style="info" %}
Based on the selected app, a list of **Trigger events** will appear.
{% endhint %}

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FKP7CvlNSSjSWMXCFDb3w%2Fimage.png?alt=media&#x26;token=5232c173-4461-48ed-a18d-c8759543f24a" alt="List of available trigger events for the selected app"><figcaption></figcaption></figure>

> In the case of Slack, when a message is posted in the specified channel, the trigger will activate and send a message from Fastn to that channel.

* Next, select the **account ID** associated with the connection, for example, *Fastn*.
* In the **Headers** section, add the required key–value pairs for authentication or configuration. Once you’ve entered all details, click **Save** to finalize this step.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FDOARQWWkvUWVM80Jsgm2%2Fimage.png?alt=media&#x26;token=2e5e469b-e35e-4ac6-be53-44dca8d540df" alt="Trigger configuration panel with account ID selection and headers key-value pairs"><figcaption></figcaption></figure>

* You can choose the event that should start your flow. For example, when integrating with Slack, you can select the **Message Posted** trigger event.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FtkOxcSlRHaLn8UKBYGvS%2Fimage.png?alt=media&#x26;token=a16b3fe2-43c3-41c9-b631-c88d3751b591" alt="Selecting the Message Posted trigger event for Slack integration"><figcaption></figcaption></figure>

* You can test this step by clicking the **Test** button in the top right corner.

> The console will display the result, and you’ll see the message sent to your selected Slack channel.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F6ZSfN9mXvV2wIvbuWem9%2Fimage.png?alt=media&#x26;token=b10e7778-4c9b-4691-9ec9-ba22357109e1" alt="Test results in the console showing the Slack trigger response"><figcaption></figcaption></figure>
