# 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>


---

# 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.relay.app/triggers/webhook-trigger.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.
