What is the webhook guarantee?
-
Hello
I am wondering about the implementation of the webhooks of fusionauth
What is the guarantee of delivery? Is it "at least once"?
Could a request be dropped (for example, if the upstream service is down)?
I would also appreciate a bit of explanation of how it works as I'm interested in these mechanisms.Thanks.
-
@itai This is what exists today, the team is working on more features for webhooks in upcoming releases.
FusionAuth provides certain guarantees when it comes to the delivery of webhooks. These guarantees are determined by the transaction level that you set for your webhooks. The transaction level can be one of the following:
-
"No webhooks are required to succeed": In this case, FusionAuth will "fire and forget" the webhooks. Even if all webhooks fail, the operation (like a user update) will still succeed (source).
-
"Any single webhook must succeed": If at least one webhook succeeds, the operation will succeed. If all webhooks fail, the operation will fail. FusionAuth will retry failed webhooks up to three additional times (source).
-
"All webhooks must succeed": Every single webhook must succeed for the operation to succeed. If any webhook fails, the operation will fail (source).
In case of failures, FusionAuth will retry sending the payload up to three additional times. If a webhook endpoint times out, this is considered a failure, the same as if a non
2xx
status code is returned. If the endpoint does not respond after the retries, the failure will be logged in the system log (source).It's important to note that if a webhook is transactional and returns a non
2xx
status code, the corresponding action will not succeed. For example, if a user login triggers a webhook and the webhook fails, the user won’t be able to log in (source). -
-