What Is a Webhook?
A thorough, no-code-required guide to the tap on the shoulder that lets GitHub instantly tell other systems, "hey, something just happened."
Imagine two ways a friend might let you know their flight has landed. In the first, you call them every ten minutes and ask, “are you there yet?” — wasteful, delayed, and mildly annoying for everyone involved. In the second, they simply text you the moment they land, with no calling required at all. A webhook is GitHub’s version of that text message: instead of some other system constantly asking GitHub “did anything happen yet?”, GitHub proactively reaches out the instant something actually does happen, delivering the news directly and immediately. This post explores exactly what a webhook is, how it’s built, and why it’s become such a foundational piece of modern software integration.
1What Is a Webhook, In Plain Words?
Let’s build a clear mental model before adding any technical vocabulary.
A webhook is a way for GitHub to automatically notify another system the moment something specific happens in a repository or organization — a new commit being pushed, a pull request being opened, an issue being commented on, and dozens of other possible events. Rather than that other system repeatedly checking in and asking whether anything new has occurred, GitHub sends the information directly, on its own initiative, the instant the relevant event actually takes place.
Technically, setting up a webhook means telling GitHub a specific web address — an endpoint belonging to some other system — and which events you want GitHub to report to it. From that point forward, whenever a matching event happens, GitHub packages up details about it and delivers them straight to that address, essentially placing an automatic, near-instant phone call to whoever is listening there.
Think of a security guard who either has to be asked repeatedly, “has anyone come through the door yet?” or who instead radios the front desk the very instant someone actually walks in. A webhook turns GitHub into that proactive guard, radioing the news immediately rather than waiting to be asked.
With that foundational picture in place, let’s define the vocabulary that makes up a webhook’s actual structure.
2The Building Blocks You Need First
A handful of terms make the entire webhook system click into place.
Event
Something specific that happens in a repository or organization, like a push, a new comment, or a repository being starred.
Payload
The actual package of information GitHub sends describing exactly what happened, including relevant details about the event.
Endpoint
The specific web address belonging to another system, configured to receive and process GitHub’s webhook deliveries.
Listener
The piece of software running at that endpoint, waiting to receive incoming webhook deliveries and act on them.
Secret
A shared piece of confidential information used to verify that an incoming delivery genuinely came from GitHub and hasn’t been tampered with.
Delivery
One individual attempt by GitHub to send a payload to an endpoint, along with the record of whether that attempt succeeded.
An event is what happened. A payload is the written note describing what happened. An endpoint is the mailbox the note gets delivered to. A listener is the person who reads the mailbox. A secret is the wax seal proving the note genuinely came from GitHub, and a delivery is one specific instance of that note actually being sent.
With this vocabulary settled, let’s trace exactly what happens internally the moment a webhook-triggering event occurs.
3What Happens Internally When An Event Fires
This is the heart of the topic — the journey from a real happening on GitHub to a notification landing on someone else’s system.
The Event Occurs
Something happens inside the repository or organization that matches one of the event types a webhook has been configured to watch for.
GitHub Builds A Payload
GitHub assembles a structured package of information describing exactly what happened, including relevant details specific to that type of event.
The Payload Is Signed
If a secret has been configured, GitHub creates a cryptographic signature for the payload, allowing the receiving system to later confirm its authenticity.
The Payload Is Delivered
GitHub sends the payload directly to the configured endpoint’s web address, essentially placing an automatic, immediate notification call.
The Receiving System Responds
The listener at that endpoint processes the payload and sends back a confirmation, letting GitHub know the delivery was received successfully.
sequenceDiagram
participant Repo as Repository
participant GitHub as GitHub
participant Endpoint as Receiving System
Repo->>GitHub: Event occurs (e.g. new pull request)
GitHub->>GitHub: Build and sign payload
GitHub->>Endpoint: Deliver payload to configured endpoint
Endpoint->>GitHub: Send back confirmation response
A webhook is not a two-way, ongoing conversation. It’s a one-directional notification — GitHub sends information out, and the receiving system’s job is simply to acknowledge and process it, not to hold an interactive back-and-forth over that same connection.
4The Bigger Picture: Data Flow And Lifecycle
Zooming out from a single delivery, let’s see how webhooks fit into the broader flow of connected systems.
A single repository can have several webhooks configured simultaneously, each pointed at a different external system and often watching for different sets of events. One webhook might notify a chat tool whenever someone opens an issue, another might trigger a build pipeline whenever code is pushed, and another might update an external project-tracking tool whenever a pull request is merged. Together, these independent notifications let GitHub sit at the center of a much larger, interconnected ecosystem of tools.
flowchart LR
A[Event happens in repository] --> B{Which webhooks are watching?}
B --> C[Webhook 1: Chat notification tool]
B --> D[Webhook 2: External build pipeline]
B --> E[Webhook 3: Project tracking tool]
C --> F[Team notified instantly]
D --> G[Build begins automatically]
E --> H[Tracking tool updates status]
This fan-out pattern is one of webhooks’ greatest strengths: a single, real event can ripple outward to power several entirely independent automated reactions, without those reactions needing to know about each other at all. Each receiving system simply reacts to its own copy of the notification, entirely on its own terms.
Why This Matters For Integrations
Because webhooks decouple GitHub from whatever’s listening on the other end, teams can add, remove, or change integrations freely without needing to modify GitHub’s own configuration beyond simply registering or removing a webhook.
5Webhooks vs Polling: What’s The Real Difference?
Before webhooks, the common alternative was repeatedly asking a system whether anything new had happened. Comparing the two makes the benefit obvious.
| Aspect | Polling | Webhooks |
|---|---|---|
| Who initiates each check | The receiving system, repeatedly | GitHub, only when something actually happens |
| Delay before noticing an event | Depends on how often it checks | Nearly immediate |
| Wasted requests when nothing changed | Common | None — only real events cause a delivery |
| Load on the source system | Higher, from constant checking | Lower, since it only acts on real events |
| Setup complexity | Simpler request logic, but inefficient | Requires a reachable endpoint to receive deliveries |
Polling is like repeatedly refreshing a tracking page every few minutes hoping your package has shipped. A webhook is like getting a text message the exact moment it actually does — no wasted refreshing, no unnecessary waiting, just a timely, direct notification.
6Types Of Events That Can Trigger A Webhook
GitHub supports a genuinely wide range of event types, reflecting nearly every meaningful action that can happen in a repository.
Code Activity
Events like new pushes, branch creation, or tag creation, reflecting direct changes to the project’s actual content.
Collaboration Activity
Events like pull requests being opened, issues being created, or comments being added, reflecting people discussing and reviewing work.
Repository Management
Events like a repository being starred, forked, or having its settings changed, reflecting how the project itself is being organized and discovered.
Automated Process Activity
Events like a workflow run starting or finishing, reflecting the status of automated processes running against the project.
Subscribe only to the specific event types your receiving system genuinely needs, rather than subscribing broadly to everything by default, reducing unnecessary noise and processing on the other end.
7Payloads: What Information A Webhook Actually Sends
The payload is where the real substance of a webhook lives — let’s look at what it typically contains.
Every payload includes details specific to the type of event that triggered it, along with broader context about where that event happened, such as which repository and which user was involved. A push event’s payload, for instance, includes information about the commits involved, while an issue event’s payload includes details about the issue’s title, description, and current state.
Event-Specific Details
Each event type carries the particular information relevant to it — commit details for a push, comment text for a new comment, or approval status for a review.
Shared Contextual Information
Nearly every payload also includes broader, consistent context, such as which repository triggered the event and who performed the action, regardless of event type.
Payload structures can differ meaningfully between event types, and even evolve over time. Receiving systems should be built to gracefully handle unexpected or evolving fields rather than assuming a rigid, unchanging structure forever.
8Webhooks vs Workflow Triggers: How They Relate
Both webhooks and automated workflow files react to repository events, which naturally raises the question of how they actually relate.
Webhooks
- Notify an entirely external system, outside GitHub’s own infrastructure.
- Require you to build or host something capable of receiving and processing the delivery.
- Well suited for connecting GitHub to third-party tools and custom systems.
Workflow Triggers
- Trigger automation that runs directly within GitHub’s own hosted infrastructure.
- Require no external endpoint to be built or maintained.
- Well suited for tasks like testing, building, and deploying entirely within the platform.
A workflow trigger is like an in-house employee reacting to an event without ever leaving the building. A webhook is like sending a courier out to deliver the news to an entirely separate office across town — genuinely useful when the reaction needs to happen somewhere GitHub itself doesn’t run.
9Delivery, Retries, And Reliability
Sending a notification is one thing — making sure it’s actually received is another. GitHub builds in some reliability handling worth understanding.
Initial Delivery Attempt
GitHub sends the payload to the configured endpoint and waits for a confirmation response indicating it was received successfully.
Handling A Failed Attempt
If the endpoint doesn’t respond successfully, whether due to being unavailable or returning an error, that delivery is recorded as failed.
Manual Or Automatic Redelivery
A failed delivery can often be manually resent, and reviewing why the original attempt failed helps identify and fix the underlying issue.
A failed delivery is like a courier finding no one home — the note doesn’t just vanish, it’s recorded as undelivered, and someone can arrange for it to be sent again once the recipient is ready.
10Monitoring: Delivery Logs And Redelivery
Webhooks aren’t a silent, invisible process — GitHub provides real visibility into exactly what’s been sent and how it went.
Delivery History
A complete, browsable record of past delivery attempts, including their timing and whether each one succeeded.
Request And Response Details
The exact payload sent and the response received back, useful for diagnosing exactly why a delivery might have failed.
Redelivery Option
The ability to manually resend a specific past delivery, useful for testing changes to a receiving system without waiting for a new real event.
Regularly check delivery history for a webhook, especially after making changes to the receiving system, to confirm deliveries are still being processed successfully.
11Advantages And Trade-offs
Webhooks bring genuine, meaningful benefits over older approaches, alongside a few real responsibilities that come with them.
Advantages
- Delivers notifications nearly instantly, without wasteful, repeated checking.
- Reduces unnecessary load compared to constant polling for changes.
- Enables real-time integrations with chat tools, dashboards, and external automation systems.
- Supports fanning a single event out to many independent systems simultaneously.
- Provides built-in delivery history and manual redelivery for troubleshooting.
Disadvantages / Trade-offs
- Requires the receiving system to have a genuinely reachable, publicly accessible endpoint.
- Adds responsibility for verifying payload authenticity to avoid processing forged requests.
- Failed or missed deliveries need active monitoring, since GitHub won’t necessarily keep retrying indefinitely.
- Payload structures can evolve, requiring receiving systems to handle changes gracefully over time.
12Staying Safe: Signature Verification And Security
Because a webhook endpoint is a publicly reachable address, a handful of genuine security considerations deserve real attention.
Signature Verification
Using the configured secret to verify a payload’s cryptographic signature confirms it genuinely came from GitHub, rejecting anything that doesn’t match.
Forged Requests
Without signature verification, anyone who discovers the endpoint’s address could potentially send fake payloads pretending to be genuine GitHub events.
Sensitive Data In Payloads
Some payloads may include information that should be handled carefully by the receiving system, rather than logged or exposed carelessly.
Unprotected Endpoints
An endpoint with no verification or rate limiting at all can be a target for abuse, unrelated to genuine GitHub activity entirely.
Always configure a secret and verify every incoming delivery’s signature before trusting or acting on its contents, treating unverified requests as untrustworthy by default.
13Design Patterns And Anti-patterns
A few recurring habits separate teams that build reliable webhook integrations from teams that quietly accumulate fragile ones.
Healthy Pattern: Narrow Event Subscriptions
Subscribing only to the specific events a receiving system genuinely needs keeps processing simple and avoids unnecessary noise.
Healthy Pattern: Idempotent Processing
Designing a receiving system to safely handle the same delivery being processed more than once, since retries and redeliveries are a normal part of the system.
Problem
Building a webhook receiver that never verifies the payload’s signature, simply trusting anything that arrives at the endpoint.
Why It’s Harmful
This leaves the system wide open to forged, malicious requests pretending to be genuine GitHub events, potentially triggering unwanted or harmful actions.
Correct Approach
Always verify incoming deliveries using the configured secret before processing them, rejecting anything that fails that check.
Problem
Assuming every delivery will always arrive exactly once, never accounting for the possibility of retries or manual redeliveries.
Why It’s Harmful
This can cause duplicate actions, like sending the same notification twice or triggering the same automated process repeatedly, if a delivery is ever received more than once.
Correct Approach
Design receiving logic to handle duplicate deliveries gracefully, treating repeated processing of the same event as a safe, expected possibility.
14Best Practices And Common Mistakes
A concise set of habits keeps a webhook integration reliable, secure, and easy to maintain over time.
Always Configure And Check A Secret
Set up a secret from the start and verify every incoming delivery against it, treating this as a non-negotiable baseline, not an optional extra.
Subscribe Only To What You Need
Narrow event subscriptions to exactly what the receiving system genuinely uses, reducing unnecessary noise and processing overhead.
Respond Quickly, Process Separately
Acknowledge a delivery promptly, and handle any slow or complex processing separately, avoiding delayed responses that might be mistaken for a failed delivery.
Handle Duplicate Deliveries Gracefully
Build processing logic that safely tolerates the same event being received more than once, since retries are a normal, expected part of the system.
Monitor Delivery History Regularly
Periodically review delivery logs, especially after changes to the receiving system, to catch and resolve failures before they go unnoticed for long stretches.
15How Real Teams Use Webhooks
Webhooks aren’t a niche capability — they quietly power a huge share of the integrations developers rely on every day.
Team Chat Notifications
Many teams wire webhooks directly into their chat tools, so new pull requests, comments, or deployments are announced automatically in a shared channel.
External Build And Deployment Systems
Teams using a build or deployment system outside GitHub’s own infrastructure often rely on webhooks to trigger that external system the moment relevant code changes land.
Custom Project Tracking Integrations
Webhooks are commonly used to keep an external issue-tracking or project-management tool automatically synchronized with activity happening directly in GitHub.
16Frequently Asked Questions
Yes, generally the endpoint needs to be reachable and ready to receive deliveries whenever an event might occur, since GitHub sends the notification proactively rather than waiting for the system to ask.
The delivery attempt will be recorded as failed, and depending on configuration, it may be possible to manually resend that specific delivery once the endpoint is available again.
Yes, a single webhook configuration can typically subscribe to multiple event types simultaneously, all delivered to the same endpoint.
No, relying purely on obscurity is not a genuine security measure. Verifying the payload’s signature against the configured secret is the reliable way to confirm authenticity.
No — as covered earlier, workflow triggers run automation directly within GitHub’s own infrastructure, while webhooks notify entirely external systems that you build and host yourself.
17Summary and Key Takeaways
A webhook is GitHub’s way of proactively notifying an external system the moment a specific event happens, replacing wasteful, repeated checking with instant, direct delivery. Built from events, payloads, endpoints, and secure signatures, webhooks let a single real happening ripple outward to power chat notifications, external build systems, and custom integrations, all independently and simultaneously. Used well — with careful event selection, robust signature verification, and graceful handling of retries — webhooks become a reliable, foundational bridge connecting GitHub to the much larger ecosystem of tools a team actually relies on.
Key Takeaways
- A webhook proactively notifies an external system the moment a specific event happens, rather than waiting to be asked.
- Every delivery includes a payload describing exactly what happened, along with shared contextual details.
- Webhooks differ from workflow triggers by reaching entirely outside GitHub’s own hosted infrastructure.
- Failed deliveries are recorded, not silently lost, and can often be manually resent for troubleshooting.
- Signature verification is essential for confirming a delivery genuinely came from GitHub and hasn’t been forged.
- Receiving systems should handle duplicate deliveries gracefully, since retries are a normal part of the system.
- Narrow event subscriptions and regular monitoring keep webhook integrations reliable and easy to maintain over time.