A Webhook Receiver That Saves the Payload First
An Apex REST listener for inbound webhooks should verify the sender, save the raw payload to a log record and answer right away. A separate job does the real processing, so a bug never costs you an event. [...]