How to Modify Webhook Failure Retry Logic with Custom Rules

Profile Picture

Eric Tran

Fri Aug 06 2021

Adding custom rules to your webhook connections allows you to adapt and perfectly tailor the behavior of each connection without updating a ruleset and risking to disrupt other webhook connetions behavior.

Modify webhook failure retry logic tutorial

In this example, we have two connections related to our Source: Github. Both Actions and Deploy use the default ruleset.

tutorial Ruleset example

We want the retries for Deploy to be faster, thus changing the retry logic from retry every 1 hour up to 5 times to retry every 2 minutes up to 5 times. If we were to do this directly on the Ruleset, we would impact the behavior of Actions. Instead we are going to add a Custom Rule that only applies to the Deploy connection.

Creating a Custom Rule

Let's create a Custom Rule for "Retry" that will override the ruleset's retry logic.

  1. Select the Connection
  2. Click Edit
  3. Select Retry
  4. Create the Custom Rule
  5. Click Save

add a custom rule

Test the new rule

Let's validate the new behavior by sending mock webhooks using Postman. Then, we will monitor the next scheduled automatic retry.

postman rule test

The Result

next attempt result

As we can see, everything works as intended.

  • The Next Attempt for the Action is scheduled after 2 minutes.
  • The Next Attempt for the Deploy is scheduled after 1 hour.

Great, we've successfully added a Custom Rule updating the Retry Logic for the GitHub → Action webhook connection!

Try Hookdeck Today

Instantly & reliably manage
your webhooks

Learn More