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>"
}
How do I send a custom response to the webhook request?
To return a custom payload to the caller:
Add a Respond to webhook step anywhere in your workflow.
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.