Pass the menu and read the page

SignupFolio

Webhook retry and log rules: 3 facts before a trial email

Three provider webhook rules and one infrastructure check decide whether your trial onboarding email fires at all.

Key takeaways

  • Return a 2xx response code as soon as the event is stored, before any slow work like sending the email — acknowledge first, process in a background worker.
  • Retries follow a widening formula (Recurly's is 10 + x * 2^(x+5) seconds), so gaps stretch from under two minutes to over an hour — make your handler idempotent and alert on consecutive failures.
  • Recurly stores webhook notifications for 15 days with failure reasons visible — check delivery records within the first two weeks and keep your own event store for anything longer.
  • If your application logs show no incoming requests during a known event window, look at infrastructure in front of your code (firewall, WAF, proxy) rather than your handler.

Why webhook mechanics decide whether your trial email ever sends

You send onboarding and trial emails triggered by payment-provider events. A customer signed up. A trial started. A subscription created. The payment platform fires a webhook to your endpoint. Your endpoint queues the email.

If that webhook is delayed, rejected, or dropped, the email never sends. Or it sends hours late, when the trial moment has passed. Most growth teams treat the webhook layer as plumbing — it either works or it doesn't. In practice it has rules. Retry timing, log retention, and response codes each have documented behavior that you can plan around.

This post covers three of those rules in plain language. Each one changes what your trial email flow should assume.

Fact 1: The response code you return controls everything downstream

Your endpoint receives a webhook and has to respond. Chargebee is direct about what counts: your webhook endpoint should return a 2xx HTTP status code as soon as possible (Chargebee). Stripe's documentation describes a webhook function configured to receive events, handle the specified events, and return a successful 2xx response (Stripe). For a wider comparison of response codes, see webhook reply rules across vendors.

Two parts of that sentence matter for your trial email.

The first is "2xx". Any successful class of response is acceptable to the provider — what is not acceptable is an error-class status. Returning an error because your email queue took too long, or returning a status that indicates a route is misconfigured, or returning a success code before you have actually persisted the event, each tells the payment provider something different about what happened.

The second part is "as soon as possible". This is the part most teams get wrong. Your endpoint receives the webhook, and your first instinct is to process it — look up the customer, build the email, push it to your sending tool, confirm the send. Only then do you return success. If any of those steps is slow — a network call, a database lock, a queue backup — your endpoint is still holding the connection open. The payment provider is waiting. Eventually it times out, treats the delivery as failed, and retries. Now you may send the email twice.

The correct pattern is to acknowledge first. Receive the event, write it to your own store or queue, return a success code immediately, and let a background worker do the slow work. Your endpoint should not be doing email sending inside the request handler at all. It should be doing capture and acknowledgment.

This matters more for trial emails than for most other messages. A billing update email sent twice is a support ticket. A trial welcome sent twice in the first minute of a customer's account looks broken. And a trial email that never sends because the endpoint held the connection too long means the customer's first experience of your product is silence.

Practical check: look at your endpoint code today. If the response line comes after a call to your email service, that call is in the wrong place. Move it behind a queue. Return success as soon as the event is stored.

Fact 2: Retries follow a formula, not a fixed schedule

When your endpoint fails to return a success code, Recurly retries the delivery. Recurly documents its retry interval as a formula: 10 + x * 2^(x+5) seconds, where x is the current attempt number (Recurly).

That formula grows fast. Run it out a few attempts and you can see what the pattern means for a trial window.

Attempt (x)Interval since previous attempt
110 + 1 * 2^6 seconds (about a minute)
210 + 2 * 2^7 seconds (about four minutes)
310 + 3 * 2^8 seconds (over twelve minutes)
410 + 4 * 2^9 seconds (over half an hour)
510 + 5 * 2^10 seconds (over an hour and a quarter)

What this table tells you: the first retry comes in about a minute. The second comes about four minutes after that. By attempt three you are waiting over twelve minutes between tries, and by attempt five the gap is over an hour and a quarter. The retries keep spreading. They do not stay on a tight loop.

Illustrative example: a misconfigured route

Suppose a trial-start webhook fails on its first three attempts because a route is misconfigured. The first retry comes about a minute later, the second about four minutes after that, and the third more than ten minutes after that. Every attempt fails for the same reason, so the welcome email is still unsent long after the customer signed up. An alert on the second consecutive failure would flag the problem while the trial is still new.

For a trial email, this has a direct implication. If your endpoint is misconfigured — returning an error status on every request — the retries keep firing across a period that can stretch well past the moment a new user expects to hear from you. The customer signed up, the trial-start webhook fired, your endpoint failed, and the retry that finally succeeds may land long after they have navigated away from your product.

It also means a transient failure is not catastrophic. A one-off timeout on attempt one is retried about a minute later, and attempt two follows about four minutes after that. What you need to watch for is the pattern where every attempt fails for the same reason — a down server, a bad route, a credential that expired. That pattern is what turns a retry schedule into a lost cohort.

The formula is Recurly's. Other providers set their own schedules, and the shape of the curve is their choice. To see when several vendors stop retrying, read when events stop retrying across vendors. If you use a different provider, read their retry documentation and work out your own timing rather than assuming this table applies.

What to do with the retry window

Two practical moves follow from the retry math.

First, make your endpoint idempotent. Since a retry means the same event may arrive more than once, your handler should be safe to run twice. Check whether you have already stored this event ID. If you have, return success and do nothing else. This converts duplicate delivery from a bug into a no-op.

Second, treat the retry window as a monitoring signal. If you see your endpoint failing across multiple attempts in a row, something is wrong on your side and it has been wrong for longer than a single blip. Alert on consecutive failures, not on isolated ones. An isolated failure in the first attempt window is normal operational noise. A run of consecutive failures may mean the events for that window were not delivered, so check them.

Fact 3: The log tells you what happened, and it does not stay forever

When something goes wrong — or when you simply want to verify that a trial email was triggered — you go looking for the event in logs. Recurly stores each webhook notification for 15 days and makes it accessible through the Admin Console, which also shows failure reasons (Recurly).

Two facts are packed in there.

The first is the retention window. Fifteen days. That is your full window for investigating a delivery problem, pulling the payload, checking the failure reason, and confirming what your endpoint received. After day 15 the stored notification is gone. If a customer writes in week three saying their trial welcome never arrived, you will not have the original payload to inspect.

The second is that failure reasons are shown alongside the notification. This is the part that saves you time. Without it, a failed delivery looks identical to a successful one from the outside — you see an event existed, but not why it did not land. With the failure reason attached, it shows why a delivery failed, which saves you from guessing.

For your trial flow, the 15-day window sets a natural practice. When a trial cohort starts, pull the delivery records within the first two weeks. Do not wait for a support ticket to arrive. If a batch of trial-start webhooks failed, you want to know in the window where the data still exists.

The window also shapes what you keep yourself. The payment provider's log is not your log. Store the events your endpoint receives in your own database, with the event ID, received timestamp, processing outcome, and email send status. That record is yours and does not expire with anyone else's retention policy. Then the 15-day provider window becomes a cross-check rather than your only source of truth.

Note that this specific retention window is Recurly's documented behavior. Other providers keep their own logs for their own durations. Check what your provider offers before building an investigation process that assumes this exact window.

Where the endpoint itself can silently block delivery

Retry, response code, and log retention describe what happens once the webhook reaches your server. There is a prior failure mode: the webhook never reaches your server at all.

Recurly documents one such case. If you're using Apache with ModSecurity, you may need to disable rule #990011 in mod_security to unblock webhook delivery (Recurly).

This is a firewall-level block. Your endpoint code can be perfect — fast success responses, idempotent handlers, a clean queue — and the webhook still never arrives because a security rule on the web server rejected it before your application saw it. From your application's perspective, nothing is happening. From the payment provider's perspective, every delivery is failing.

Symptom to recognize: your endpoint logs show no incoming requests at all during a window when you know events fired. Not failed requests. No requests. That pattern points at infrastructure in front of your app — a firewall rule, a WAF, a reverse proxy, an IP allowlist — rather than at your handler.

The general lesson extends beyond this one rule. When webhook deliveries fail with no visible activity in your application, look at the layer between the internet and your code. Web server configuration, security modules, proxy settings, and TLS termination can all reject or drop a request before it reaches your handler. Your logs will be empty, and empty logs during a known event window are themselves the signal.

What a trial email flow should assume, in practice

Pulling the three facts together gives you a concrete design for a trial onboarding flow triggered by payment-provider events.

Acknowledge before you act. Your endpoint's job is to receive the event and acknowledge it. Everything else — looking up the customer, composing or queueing the email, calling your sending tool — happens after the success response, in a worker. This keeps your response time short, in line with Chargebee's request for a response as soon as possible.

Design for at-least-once delivery. Not every system guarantees exactly-once. Asana's webhook system is designed for at-most-once delivery, meaning in exceptional circumstances events may fail to deliver entirely (Asana). Different providers land in different places on this spectrum. Your side should assume two failure modes and handle both: the event arriving more than once, and the event not arriving at all.

Handling duplicates means checking event IDs before processing. For more on duplicates, see preventing duplicate welcome emails. Handling absence means having a fallback — a periodic reconciliation against your payment provider's records that catches trial starts the webhook never delivered. The reconciliation is the safety net for the at-most-once case; the idempotency check is the safety net for the duplicate case.

Treat the first hour as the critical window. The retry schedule's early attempts land within minutes. By the time retries stretch to long gaps, the moment a new customer expects a welcome has largely passed. Whatever monitoring you do on webhook health, do it with an eye on whether events from the current cohort are being acknowledged promptly. A failing endpoint in the first minutes of a trial cohort is a problem you can still act on. The same failure discovered days later is only an apology.

Keep your own copy of what you received. The provider's log — 15 days in Recurly's case, with failure reasons attached — is excellent for short-window investigation. It is not a permanent record. Your endpoint should write each incoming event to your own store before returning success. That store is what lets you answer questions about a trial email weeks after the provider's copy has expired.

Separate delivery failure from send failure. These are different problems with different owners. A delivery failure means the webhook never made it to your endpoint — the retry schedule and the firewall question apply. A send failure means the webhook arrived, your endpoint acknowledged it, and something later in your own pipeline dropped the email. Your logs need to distinguish the two, or you will spend debugging time in the wrong system.

Before your next trial email goes out: a short checklist

Use this against your current flow. Each item maps to one of the rules above.

  • Your endpoint returns a 2xx response before doing slow work. No email-service calls inside the request handler. Store, respond, then process in the background.
  • Your handler is idempotent. Duplicate event IDs are detected and acknowledged without re-triggering the email.
  • You know your provider's retry schedule. If you are on Recurly, you can compute it from the documented formula. If you are on another provider, read their retry docs and write the schedule down.
  • You alert on consecutive failures, not isolated ones. One failed attempt in the early window is normal. A run of failures across the widening retry gaps means something structural is wrong.
  • Your own event store is populated. Every incoming webhook is written to your database with event ID, timestamp, and processing outcome, independent of the provider's log.
  • You check delivery records within the first two weeks of a cohort. Inside the 15-day window where Recurly's stored notifications and failure reasons are still available.
  • You have looked at the infrastructure layer. If application logs show no incoming requests during a known event window, check web server and security-module configuration before debugging your handler.
  • You have a reconciliation path for missing events. A periodic check against payment-provider records that catches trial starts which never reached your endpoint.

Next step today: open your payment provider's delivery log and find the most recent trial-start event. Check that it was delivered and that your endpoint acknowledged it. If you use Recurly, that log keeps notifications for 15 days, so check now rather than later.

FAQ

What should my webhook endpoint return, and how fast?

Any 2xx HTTP status code, returned as soon as the event is safely stored. The speed part matters as much as the code. Holding the connection open while you send an email invites timeouts, which invite retries, which risk duplicate sends. Store first, respond, then process.

How long between retries if my endpoint keeps failing?

On Recurly, the interval follows the formula 10 + x * 2^(x+5) seconds for attempt number x. The gaps widen quickly — from well under two minutes at the first retry to well over an hour by the fifth. Other providers use their own schedules. Confirm yours before you design alerting thresholds around assumed timing.

How long can I look up a failed webhook delivery?

On Recurly, stored webhook notifications are available for 15 days through the Admin Console, alongside failure reasons. Plan investigations inside that window. For anything longer-term, rely on the event store your own endpoint writes.

Why does my application show no webhook activity at all when I know events fired?

Something in front of your application is likely rejecting the request before it reaches your handler. Recurly documents one instance — an Apache ModSecurity rule that can block webhook delivery. More generally, check web server configuration, WAF rules, proxy settings, and TLS termination. Empty logs during a known event window are the tell.

Can I assume the webhook will arrive exactly once?

No. Asana documents its system as at-most-once, meaning exceptional failures drop events entirely. Recurly's retry formula implies repeated attempts for failed deliveries. The safe design handles both directions: deduplicate by event ID, and reconcile periodically against payment-provider records to catch anything that never arrived.

Does the provider's log replace my own?

No. The provider's log has a fixed retention window and covers delivery status. Your own event store should record what your endpoint received and what your pipeline did with it. The two answer different questions, and only yours persists past the provider's window.

What if I am not sure which questions my current flow cannot answer?

Ask your payment provider's support team directly about retry timing, log retention, and delivery guarantees for your specific plan. The rules above are documented behaviors, but plan tiers and configuration options can differ, and your provider's support team is the right place to confirm what applies to your account.

Sources and check date

Related posts

More posts