Skip to content

Commit 4c55459

Browse files
committed
feat: Add docs for webhook retries
1 parent 1d3b182 commit 4c55459

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cerebrium/endpoints/webhook.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ a feature of our proxy, you will not need to modify any part of your code to use
1919
functionality. You should, however, ensure that your endpoint is able to receive POST requests. While
2020
this will work for both Cortex and Custom runtimes, it will only work for HTTP requests, and not websockets.
2121

22+
## Retry Behavior
23+
24+
Webhook requests are sent asynchronously and will not block your function's response. If a webhook delivery fails,
25+
we automatically retry with the following behavior:
26+
27+
- **Maximum attempts**: 3 attempts total
28+
- **Delay between retries**: Up to 5 seconds between attempts
29+
30+
**Retry conditions:**
31+
- Network errors (connection failures, timeouts) will trigger retries
32+
- `404 Not Found` responses will trigger retries (endpoint may be temporarily unreachable)
33+
- Other `4xx` client errors will **not** be retried (considered permanent failures)
34+
- `5xx` server errors will **not** be retried (to avoid potential duplicate side effects)
35+
- Non-2xx responses (excluding the above) will trigger retries
36+
37+
If all attempts fail, the error is logged but will not affect your function's response to the original caller.
38+
39+
<Warning>
40+
**Your webhook endpoint should be idempotent.** In some cases, we may retry a webhook even if it was processed successfully—for example, if our backend doesn't receive the success response from your webhook server due to network issues. Design your endpoint to handle duplicate deliveries gracefully.
41+
</Warning>
42+
2243
To illustrate this, suppose your function returns `{"smile": "wave"}`. We would then make a POST call from
2344
our proxy that would look like this to your webhook:
2445

0 commit comments

Comments
 (0)