|5 min read|Daniel K., Founder

Never Miss a Stripe Webhook Again: Persistent Event Queuing

Your agent goes offline for 30 seconds during a deploy. Three Stripe payment events arrive. With a dumb tunnel, they're gone. With Tryb's persistent queue, they're waiting when you reconnect.

reliabilitywebhooksredisqueue

Stripe retries failed webhooks, but on their schedule -- not yours. The first retry comes after 5 minutes. Then 30 minutes. Then an hour. If your agent was only down for 20 seconds during a deploy, you're now waiting 5 minutes for a payment event that already happened.

For an AI agent managing subscriptions, processing refunds, or triggering downstream workflows, those 5 minutes of latency can mean a broken user experience.

The Gap in Every Tunnel

When a tunnel disconnects, the relay has nothing to do with incoming requests except return a 503. The webhook provider gets the error, schedules a retry, and moves on. Your agent, when it reconnects, has no idea it missed anything.

This is the fundamental problem: tunnels are stateless. When the WebSocket drops, state drops with it.

Persistent Event Buffering

Tryb's Go relay includes a persistent event buffer. When a webhook arrives for an offline agent, we don't return a 503. We:

  1. Accept the request with a 200 OK (so the provider doesn't retry)
  2. Serialize the full request (headers, body, path, method) into the queue
  3. Set a 24-hour TTL on the queued event
  4. When the agent reconnects, drain the queue in order

From Stripe's perspective, the webhook was delivered successfully. From your agent's perspective, it processes the events on reconnect as if nothing happened.

What This Looks Like in Practice

Your agent disconnects at 14:25:00. Three Stripe events arrive over the next 2 minutes:

TimeEventStatus
14:25:03checkout.session.completedQueued
14:25:18invoice.paidQueued
14:25:44customer.subscription.createdQueued

Your agent reconnects at 14:27:00. Within 200ms, all three events are delivered in order. No retries. No gaps. No lost revenue.

Queue Visibility

The dashboard shows you the queue in real-time:

  • How many events are buffered per agent
  • Time until each event expires (24h TTL)
  • Historical drain performance (delivered vs expired)
  • Which providers are sending events to offline agents

You can also configure push notifications to your phone when events start queueing, so you know to check on your agent.

The Bottom Line

Free tunnels give you 503s when your agent is down. Tryb gives you a 24-hour safety net. You never miss a Stripe payment, a GitHub push event, or a customer action again.

python
from tryb import Tryb

agent = Tryb(
    api_key="tryb_live_sk_...",
    relay_url="https://relay.tryb.dev",
    subdomain="agent-luna"
)

# On connect, queued events are drained automatically
agent.connect()
# -> [QUEUE] Draining 3 buffered events for agent-luna
# -> [QUEUE] Delivered: checkout.session.completed (queued 1m57s ago)
# -> [QUEUE] Delivered: invoice.paid (queued 1m42s ago)
# -> [QUEUE] Delivered: customer.subscription.created (queued 1m16s ago)

Ready to secure your agents?

Tryb gives you a firewall, a persistent event queue, and human-in-the-loop approvals. Free tier included -- no credit card required.