Circuit Breaker
The circuit breaker pattern automatically pauses webhook deliveries to failing destinations, preventing cascading failures and giving struggling services time to recover. While a circuit is open, deliveries wait as held: they spend no attempts, and they are released once the destination recovers.
Info
Circuit breakers on inbound routes are available on the Pro and Business plans. On Free, Starter and Pay As You Go, failing deliveries retry on the plan's schedule and then go to the dead-letter queue. Outbound endpoints have their own circuit breaker on every plan (see Retry Behavior).
How It Works
The circuit breaker has three states:
| State | Description | Behavior |
|---|---|---|
| Closed | Normal operation | Deliveries proceed normally |
| Open | Circuit tripped | Nothing is sent; deliveries are held |
| Half-Open | Probing for recovery | A few held deliveries go out as probes to test if the destination recovered |
State Transitions
┌──────────┐ Failures exceed ┌──────────┐
│ CLOSED │ ─────threshold──────► │ OPEN │
└──────────┘ └──────────┘
▲ │
│ │ Cooldown
│ Probe succeeds │ expires
│ ▼
│ ┌──────────┐
└──────────────────────────── │HALF-OPEN │
Probe successes └──────────┘
exceed threshold │
│ Probe fails
▼
Back to OPENHeld Deliveries
While the circuit is open, a delivery to the route waits as held instead of being sent:
- New events for the route get a held delivery. Deliveries already retrying are held when their next attempt comes due.
- A held delivery spends no attempts. It keeps the attempts it had left for when the destination comes back.
- Probes: when the cooldown ends, Hookbase sends as many held deliveries as the success threshold (2 by default). A probe that fails is held again, with its attempt given back, and the circuit reopens.
- Recovery: once the circuit closes, the rest are released, paced, and delivered in the background. Resetting the circuit releases them too.
- Expiry: a hold lasts no longer than the delivery's retry window, counted from when it was created: about 13 minutes on Free, about 28 hours on Starter and Pay As You Go, about 3 days on Pro and about 5 days on Business. A delivery still held then goes to the dead-letter queue with the reason
circuit_breaker_open, ready to replay.
Turning Holds Off
Holds are on by default. Set holdOnCircuitOpen: false on the route to send deliveries to the dead-letter queue (reason circuit_breaker_open) at once while the circuit is open:
curl -X PATCH "https://api.hookbase.app/api/routes/{routeId}" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ "holdOnCircuitOpen": false }'Deliveries already held when you turn it off are released. Any that find the circuit still open then go to the dead-letter queue as well.
Routes That Don't Hold
Some deliveries are never held:
- deliveries on routes with failover destinations, which fail over by attempt count instead;
- deliveries to warehouse destinations;
- deliveries from sources in transient mode;
- edited replays (a changed payload, headers or transform).
While the circuit is open, new events aren't delivered to such a route, and a delivery already queued for it goes to the dead-letter queue as circuit_breaker_open. These deliveries also keep 5 attempts on every plan.
Configuration
Configure the circuit breaker on each route with these parameters:
| Parameter | Default | Range | Description |
|---|---|---|---|
circuitFailureThreshold | 5 | 1–50 | Consecutive failures before opening |
circuitCooldownSeconds | 300 | 30–3600 | Seconds to wait before probing |
circuitProbeSuccessThreshold | 2 | 1–10 | Successful probes needed to close |
holdOnCircuitOpen (default true) is a route field, set when you create or update the route.
Via API
# Update circuit breaker configuration
curl -X PATCH "https://api.hookbase.app/api/routes/{routeId}/circuit-config" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"circuitFailureThreshold": 10,
"circuitCooldownSeconds": 600,
"circuitProbeSuccessThreshold": 3
}'Via Dashboard
- Navigate to Routes
- Click the edit icon on a route
- Expand the Circuit Breaker section
- Configure the thresholds
- Click Save Circuit Config
Checking Circuit Status
Via API
# Get circuit breaker status
curl -X GET "https://api.hookbase.app/api/routes/{routeId}/circuit-status" \
-H "Authorization: Bearer {token}"Response:
{
"circuitState": "open",
"circuitOpenedAt": "2026-11-07T10:30:00.000Z",
"cooldownSeconds": 300,
"probeAttempts": 0,
"probeSuccessThreshold": 2,
"failureThreshold": 5,
"consecutiveFailures": 5,
"timeUntilProbeSeconds": 120
}circuitState is closed, open or half_open. timeUntilProbeSeconds is set only while the circuit is open, and is 0 once the cooldown has ended. On a plan without the circuit breaker, this endpoint returns 403.
To see how many deliveries are waiting, get the route: GET /api/routes/{routeId} returns heldCount and heldCountCapped. The count stops at 10,000; heldCountCapped: true means there are more.
Via Dashboard
Open circuits display a red Circuit Open badge on the route card. Half-open circuits show a yellow Probing badge.
Manually Resetting the Circuit
If you've fixed the underlying issue and want to immediately resume deliveries:
Via API
# Reset circuit to closed state
curl -X POST "https://api.hookbase.app/api/routes/{routeId}/reset-circuit" \
-H "Authorization: Bearer {token}"Via Dashboard
- Navigate to Routes
- Find the route with an open circuit (red badge)
- Click the Reset Circuit button
Held deliveries are released once the circuit is closed.
Notifications
Get alerted when circuits open by linking a notification channel to your route:
# Link notification channel to route with circuit alerts
curl -X POST "https://api.hookbase.app/api/notification-channels/{channelId}/routes" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"routeId": "{routeId}",
"notifyOnCircuitOpen": true,
"notifyOnRecovery": true
}'Best Practices
- Set appropriate thresholds: Consider your destination's normal error rate
- Keep holds on: Held deliveries wait out an outage without spending attempts, and are delivered once the destination recovers
- Failover or holds: A route with failover destinations moves to its backup instead of holding. Use failover where a backup should take over at once, and holds where waiting for the primary is fine
- Monitor alerts: Set up notifications to respond quickly to circuit events
- Tune cooldown: Longer cooldowns for destinations with slow recovery times
Example Scenarios
High-Volume Route
For routes processing thousands of webhooks per minute:
{
"circuitFailureThreshold": 20,
"circuitCooldownSeconds": 120,
"circuitProbeSuccessThreshold": 5
}Critical Low-Volume Route
For important routes where every delivery matters:
{
"circuitFailureThreshold": 3,
"circuitCooldownSeconds": 60,
"circuitProbeSuccessThreshold": 2
}External Third-Party API
For destinations you don't control:
{
"circuitFailureThreshold": 10,
"circuitCooldownSeconds": 600,
"circuitProbeSuccessThreshold": 3
}