# Webhook Trigger

## Setting up a Webhook trigger

To get started, watch the video below and [read this tutorial](https://www.relay.app/blog/how-to-set-up-a-webhook-trigger).

{% embed url="<https://www.youtube.com/watch?v=F2GGyF65nb8>" %}

Looking for making custom HTTP requests? [Learn more here](https://docs.relay.app/built-in-actions/custom-http-requests).

<details>

<summary>How do I apply run deduplication?</summary>

By including a **relayDeduplicationKey** property in your webhook's payload, you can enforce Relay.app to only trigger a run once for every unique case of relayDeduplicationKey.

Meaning:

* The first time a unique value of **relayDeduplicationKey** is present that was never seen before, Relay.app will trigger a run for the webhook request
* For all webhook requests afterwards where the value of **relayDeduplicationKey** is the same, no runs will be triggered and instead the following response is returned for the request:

```
{
  "status": "duplicate",
  "existingRunId": "<ID of previously triggered run>"
}
```

</details>

<details>

<summary>How do I send a custom response to the webhook request?</summary>

To return a custom payload to the caller:

1. Add a **Respond to webhook** step anywhere in your workflow.
2. Open the step and configure the body, headers, and status code that you want to send back.

When Relay receives the webhook request it waits up to **30 seconds** for the **Respond to webhook** step to run. If the step hasn't executed within that window, Relay returns its default response instead.

</details>
