---
title: "Comment by Hayrullah Kar on \"Your Webhook Ran Twice. Your Business Action Shouldn't.\" | Hashnode"
description: "Gating the outbox insert on the inbox CTE's RETURNING is a neat way to get both rows or neither. One small addition for the handler: on the duplicate path, retu"
url: "https://hashnode.com/posts/your-webhook-ran-twice-your-business-action-shouldn-t/6b083a51cde11f7763fee6ed/comment/6b0d87ba79677a48e902d131"
---

[Discussion](https://hashnode.com/posts/your-webhook-ran-twice-your-business-action-shouldn-t/6b083a51cde11f7763fee6ed)

Comment [Your Webhook Ran Twice. Your Business Action Shouldn't.](https://hashnode.com/posts/your-webhook-ran-twice-your-business-action-shouldn-t/6b083a51cde11f7763fee6ed)

[Hayrullah Kar](https://hashnode.com/@magesheet)

[6h ago](https://hashnode.com/posts/your-webhook-ran-twice-your-business-action-shouldn-t/6b083a51cde11f7763fee6ed/comment/6b0d87ba79677a48e902d131)

Gating the outbox insert on the inbox CTE's RETURNING is a neat way to get both rows or neither. One small addition for the handler: on the duplicate path, return a 2xx to the sender, not a 409. Many providers treat any non-2xx as a failed delivery and keep retrying, so a correct duplicate check can still produce a retry storm.
