Why am I receiving 2 Web Hook events for a single release?

Issue

You subscribed to the Webhook release event and configured a URL. Later you released a new version of your app and noticed that the endpoint you configured was called at least 2 or more times.

Resolution

We emit one event when the release starts (the action field will be "create") and a second one once the release successfully finishes (with action "update").

If you need to receive only one invocation when the deploy finishes you should build an intermediate app to receive the Webhook triggers, filter the first event (the one with action = create) and call your endpoint only when the second event arrives.

If you are using release phase tasks you will receive 3 events, a create action and 2 update actions, in this case the final one is the one with action = update, status = succeeded and current = true.

If you are using Release Phase tasks in a Private space, the process launches a one-off dyno to execute the release code. Due to this, there can be 3 or 4 web hooks for the release phase, depending on whether it is successful or not, and there can be "duplicate" ones where the contents of the hooks are identical. This is due to a change in state we track internally in our system, and delivers duplicate results at slightly different times to you though with the same information. For web hook events on releases, we recommend acting on the first event and filtering for the relevant keys - i.e. #{event.resource}-#{event.action}-#{event.version}.

Please refer to the Webhook Events page and the Webhook Devcenter article article for detailed info.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support