The build
A webhook is an automatic message one tool sends to a URL you own the moment something happens: a form fill, a booked meeting, a paid invoice. For marketing and GTM teams, webhooks are how data moves in seconds instead of on a sync schedule. You receive the message, check it's real, dedupe it, and act on it.
Most GTM stacks already run on webhooks. Nobody on the team calls them that. The form tool "connects" to the CRM. The billing tool "updates" the customer record. Under the hood, a small JSON message hits a URL, and a flow decides what to do with it.
When that flow is built well, leads reach a rep in under a minute and billing data stays true. When it's built badly, you get duplicates, missed leads and a CRM nobody trusts. This guide covers what a webhook is, what one looks like, where they show up in a GTM stack, how to receive them, and how to keep them secure and reliable. It ends with a plan for your first three flows.
Key takeaways
- Push, not pull. A webhook sends data the moment an event happens, so you stop paying for polls that find nothing.
- Verify every request. Check the signature and the timestamp before you trust a single field.
- Expect duplicates. Vendors retry on purpose, so dedupe by event ID and make every write safe to repeat.
- Answer fast, work later. Return a 2xx in a second or two and do the slow work from a queue.
- Reconcile weekly. Compare counts in the source tool with your CRM so silent failures can't hide.
What is a webhook, in plain words?
A webhook is a phone call from one tool to another. Something happens in tool A. Tool A calls a number you gave it, which is a URL. It reads out what happened, then hangs up.
Compare that with the two other ways tools talk.
An API call is you calling the tool. You ask a question, like "give me contact 51," and it answers. You start the conversation every time.
Polling is calling the same tool every few minutes to ask "anything new?" Most of the time the answer is no. You still pay for the call, in API quota, in task credits, or in delay.
A webhook flips the direction. The tool calls you, once, when there is news. That's the core idea behind event-driven architecture: systems react to events as they happen instead of checking on a timer.
| Method | Who starts it | When data arrives | Cost when nothing happens | Best for |
|---|---|---|---|---|
| API call | You | When you ask | One call each time you ask | Looking up a record, writing a record |
| Polling | You, on a timer | Up to one interval late | A call every interval | Tools with no webhooks, nightly backfills |
| Webhook | The sending tool | Seconds after the event | Nothing | Form fills, bookings, payments, signals |
In practice you use all three together. A webhook tells you "contact 51 changed." An API call fetches the full record. A scheduled job polls once a night to catch anything the webhook missed.
What does a webhook request look like?
Every webhook is an HTTP request with four parts. Learn these four and you can read any vendor's docs.
- URL. Where the request goes. You create it in Zapier, Make, n8n or your own server, then paste it into the sending tool.
- Method. Almost always POST, which means "here is some data."
- Headers. Labels on the envelope. They say the body is JSON and often carry a signature that proves who sent it.
- Body. The data itself, usually JSON. It names the event, gives it an ID and includes the fields.
Here's a trimmed example in the shape a form tool like Typeform sends. The data is fake.
POST /hooks/demo-form HTTP/1.1
Host: hooks.example.com
Content-Type: application/json
Typeform-Signature: sha256=3f1c...base64...
{
"event_id": "01JDX4K9Q2EXAMPLE",
"event_type": "form_response",
"form_response": {
"form_id": "aBc123",
"submitted_at": "2026-11-28T15:04:12Z",
"hidden": { "utm_source": "linkedin", "utm_campaign": "q4-demo" },
"answers": [
{ "type": "email", "email": "jane.doe@example.com", "field": { "ref": "work_email" } },
{ "type": "text", "text": "Example Co", "field": { "ref": "company" } },
{ "type": "choice", "choice": { "label": "51-200" }, "field": { "ref": "company_size" } }
]
}
}
And here's a trimmed example of what HubSpot's app webhooks send when a contact property changes. Note that it's an array. HubSpot batches several events into one request.
[
{
"eventId": 1234567890,
"subscriptionType": "contact.propertyChange",
"portalId": 9999999,
"objectId": 51,
"propertyName": "lifecyclestage",
"propertyValue": "salesqualifiedlead",
"occurredAt": 1764342252000,
"attemptNumber": 0
}
]
Two habits help here. First, always find the event ID field. It has a different name in every tool (event_id, eventId, id), and you'll need it to dedupe. Second, find the timestamp of the event itself, not the delivery. You'll need it when events arrive out of order.
Where do webhooks show up in a GTM stack?
Almost every tool that touches a lead, a deal or a customer can send a webhook. The question is which events matter to revenue. Here's the map I start from.
| Stack layer | Example tools | Events worth catching | What the flow usually does |
|---|---|---|---|
| Forms | Typeform, Tally, HubSpot forms | New submission (form_response in Typeform) |
Create or update contact, route, alert the owner |
| Scheduling | Calendly, Cal.com, Chili Piper | Meeting booked or canceled (invitee.created, invitee.canceled in Calendly) |
Log the meeting, update stage, notify the AE |
| Billing | Stripe, Chargebee, Paddle | checkout.session.completed, invoice.paid, customer.subscription.updated |
Mark customer, set MRR, trigger onboarding |
| Product | PostHog, Segment, your app | Signup, key action done, usage threshold hit | Flag a product-qualified lead, start a play |
| Enrichment | Your enrichment tool, async enrichment APIs | Job finished, result ready on a callback URL | Write firmographics and contact data back |
| Intent | Website visitor ID and intent tools | Target account on pricing page, surge detected | Score the account, alert the owner, add to a sequence |
| Sequencers | Instantly, Smartlead, Outreach | Reply received, bounce, unsubscribe | Update status, stop other sequences, alert the rep |
| CRM | HubSpot, Salesforce | Record created, property changed, deal stage moved | Sync to other tools, kick off handoffs |
You don't need all of these. A seed-stage team usually needs two: forms and scheduling. A product-led company adds product events and billing early. An outbound-heavy team cares most about replies and intent.
Each row above has its own playbook here. The form to CRM to Slack recipe covers inbound leads. The Stripe to CRM webhook build covers billing. The intent signals to sequences playbook covers signals, and the enrichment waterfall guide covers callbacks.
How do you receive a webhook?
You need a URL that's always on and can run some logic. There are four common ways to get one. All four work. They differ in cost, control and who can maintain them.
Zapier Catch Hook
Zapier gives you a unique URL with its "Catch Hook" trigger. Paste it into the sending tool and every POST starts a Zap. It's the fastest path for a non-technical team.
Know the limits. Zapier's help center lists Webhooks by Zapier as unavailable on the Free plan and available on Professional and up, as of November 2026. The Webhooks by Zapier help page also notes that Zapier always replies with a 200 you can't customize. That means the sender thinks delivery worked even if a later step fails. The Zapier pricing page lists Professional from $19.99 a month as of November 2026.
Zapier's rate limit article sets the cap at 20,000 requests every 5 minutes per user, with a 429 error above that. Most GTM teams never get close.
One more catch. The plain Catch Hook trigger parses the body for you. To verify a signature you need the exact raw body, so use "Catch Raw Hook" for any sender that signs its requests. Zapier's help page caps Catch Raw Hook at 2 MB.
Make custom webhook
Make has a "Custom webhook" trigger with a queue behind it. Make's webhooks help page says each webhook gets its own queue. By default it replies 200 with the body "Accepted." It returns 429 above 300 requests per 10 seconds and 400 when the queue is full.
Two things I like about Make here. You can add a "Webhook response" module to send back a custom status, which Zapier won't let you do. And the visual router makes branching logic easy to read. It suits teams that have outgrown simple Zaps but don't want to run servers.
n8n Webhook node
n8n gives you a Webhook node with a test URL and a production URL. The n8n Webhook node docs list three ways to respond: immediately, when the last node finishes, or through a "Respond to Webhook" node. They also list basic auth, header auth and JWT auth, and a 16 MB payload cap.
The most common n8n bug is pasting the test URL into a vendor and then wondering why nothing runs in production. The test URL only listens while you click "Listen for test event." Switch to the production URL before you go live.
n8n's pricing page lists the cloud Starter plan at €20 a month billed yearly for 2.5K executions, as of November 2026. You can also self-host it, which matters when data can't leave your servers.
A small serverless function
The fourth option is your own code. A short function on Vercel, Cloudflare Workers, AWS Lambda or Supabase Edge Functions receives the request, checks it, and writes to a queue. It costs very little at GTM volumes. It's also the only option that gives you full control over signatures, dedupe and responses.
The trade is maintenance. Someone has to own the code, the secrets and the logs. If nobody on the team can read JavaScript or Python, this option will rot.
Which one should you pick?
Here's the rule I use. Match the receiver to the person who will fix it at 9 p.m. when it breaks.
| Situation | Pick | Why |
|---|---|---|
| Seed team, HubSpot Starter, no engineer, under a few hundred events a month | Zapier | Fastest to build, anyone can read it |
| Series A, ops person owns flows, branching logic, several tools | Make | Visual routes, custom responses, cheaper at volume |
| Technical GTM engineer, data must stay in house, many flows | n8n (self-hosted or cloud) | Full control, code nodes, low cost per run |
| Signed payloads, money events, strict dedupe, high volume | Serverless function plus a queue | Raw body access, exact responses, real tests |
| Salesforce shop with IT and security reviews | An enterprise iPaaS such as Workato, or Salesforce-native tooling | Governance, audit logs, vendor support |
Most teams end up with a mix. Billing webhooks go to code because money needs exact handling. Form and intent webhooks go to an iPaaS so ops can change them without a deploy. If you're torn, my build vs buy framework for GTM tools scores the choice.
How do you know a webhook is real?
Anyone who finds your webhook URL can send it fake data. Without a check, a stranger can create contacts, fake a payment or flood a rep's Slack. Signature checks stop that.
How signatures work
Most vendors use the same pattern, called an HMAC. You and the vendor share a secret. For each request, the vendor runs the body through a hash function with the secret and puts the result in a header. You run the same math on the body you got. If your result matches the header, the request came from someone who knows the secret, and nobody changed the body on the way.
The details differ by vendor, so always read their page:
| Vendor | Header | What gets signed | Encoding |
|---|---|---|---|
| Stripe | Stripe-Signature with t= and v1= parts |
Timestamp plus raw body | Hex |
| HubSpot app webhooks (v3) | X-HubSpot-Signature-v3 plus X-HubSpot-Request-Timestamp |
Method, URI, raw body and timestamp | Base64 |
| Typeform | Typeform-Signature starting with sha256= |
Raw body | Base64 |
| Calendly | Calendly-Webhook-Signature with t= and v1= parts |
Timestamp, a period, raw body | Hex |
| Standard Webhooks senders | webhook-id, webhook-timestamp, webhook-signature |
id.timestamp.body |
Base64 |
Sources: Stripe's webhook docs, HubSpot's request validation docs, Typeform's webhook security page, Calendly's webhook signature docs and the Standard Webhooks spec.
That last row matters. Standard Webhooks is an open spec for how to sign and send webhooks. Its steering committee includes people from Zapier, Twilio, ngrok, Supabase, Kong and Svix. When a new tool follows it, one verify function covers them all.
Add a timestamp check
A valid signature alone isn't enough. An attacker who captures one real request could send it again later. That's a replay attack. The fix is to sign the timestamp too and reject old requests. HubSpot's docs say to reject requests with a timestamp older than 5 minutes. Calendly's example uses a 3-minute window. I default to 5 minutes.
A short Node.js verifier
Here's a verifier for a Standard Webhooks sender. The same shape works for others once you swap the header names and the signed string.
import crypto from "node:crypto";
import express from "express";
const app = express();
const TOLERANCE_SECONDS = 300; // 5 minutes
// Standard Webhooks secrets look like "whsec_<base64>". Decode the part after the prefix.
const KEY = Buffer.from(process.env.WEBHOOK_SECRET.replace(/^whsec_/, ""), "base64");
// Raw body on this route only. express.json() would change the bytes and break the check.
app.post("/hooks/signals", express.raw({ type: "application/json" }), (req, res) => {
const id = req.get("webhook-id");
const ts = Number(req.get("webhook-timestamp"));
const header = req.get("webhook-signature") || "";
if (!id || !ts || Math.abs(Date.now() / 1000 - ts) > TOLERANCE_SECONDS) {
return res.status(400).send("missing or stale timestamp");
}
const signed = `${id}.${ts}.${req.body.toString("utf8")}`;
const expected = crypto.createHmac("sha256", KEY).update(signed).digest();
// The header can hold several signatures, like "v1,abc= v1,def=" during a key rotation.
const valid = header.split(" ").some((part) => {
const [version, sig] = part.split(",");
if (version !== "v1" || !sig) return false;
const given = Buffer.from(sig, "base64");
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
if (!valid) return res.status(401).send("bad signature");
enqueue({ id, receivedAt: Date.now(), body: req.body.toString("utf8") }); // your queue
return res.status(200).send("ok");
});
// JSON parsing for every other route goes after the webhook route.
app.use(express.json());
Why do you get the same webhook twice?
Because vendors retry on purpose. If your endpoint times out, returns an error or drops the connection, the sender tries again later. That's a feature. It's also why a lead can show up twice.
Here's how long some vendors keep trying, from their docs:
- Stripe retries undelivered events for up to three days, per Stripe's undelivered events docs.
- HubSpot app webhooks retry failed notifications up to 10 times over 24 hours, per HubSpot's webhooks guide. A reply slower than five seconds counts as a failure.
- HubSpot workflow webhooks retry for up to three days, per HubSpot's workflow webhook article. They don't retry a 4xx reply, except 429.
Retries cause duplicates in a sneaky way. Say your flow creates the contact, then times out on the Slack step. The vendor sees a failure and sends the event again. Now you create a second contact. HubSpot's guide even warns that its eventId isn't guaranteed to be unique.
Make every write safe to repeat
The fix has a name: idempotency. It means doing the same thing twice has the same result as doing it once. You get there in two layers.
Layer 1: dedupe by event ID. Keep a table of event IDs you've seen. Before processing, try to insert the ID. If it's already there, return 200 and stop.
-- One row per event you have accepted. The primary key does the dedupe.
create table webhook_events (
source text not null, -- 'stripe', 'typeform', 'hubspot'
event_id text not null,
received_at timestamptz not null default now(),
status text not null default 'queued', -- queued, done, failed
attempts int not null default 0,
last_error text,
payload jsonb not null,
primary key (source, event_id)
);
// Insert first. If the row already exists, this is a retry or a duplicate.
const { rowCount } = await db.query(
`insert into webhook_events (source, event_id, payload)
values ($1, $2, $3) on conflict do nothing`,
["typeform", event.event_id, event]
);
if (rowCount === 0) return res.status(200).send("duplicate, skipped");
Layer 2: make the writes themselves safe. Use upserts keyed on something stable, like email for contacts or a Stripe customer ID for companies. "Create or update by email" can run twice and still leave one record. "Create contact" can't.
When the vendor has no event ID, build one. Hash the fields that make the event unique, like form ID plus email plus submitted time. Stripe's docs suggest the object ID plus the event type for its rare cases of two separate events.
What if webhooks arrive out of order?
They will. Retries, batching and network delays shuffle the order. HubSpot's guide says notifications may arrive out of order and tells you to use occurredAt. Plan for the same with every other vendor.
Picture a deal that moves to "Closed won" and then, a minute later, an older "Negotiation" event arrives. A naive flow sets the deal back to Negotiation. Now the forecast is wrong.
You have two good fixes.
- Compare timestamps. Store the event time of the last update on each record. Skip any event older than that.
- Treat the webhook as a nudge. Ignore the payload's values. Use the webhook only to learn that record 51 changed, then fetch the current state from the API. The API always returns the latest truth.
I use the second fix for money and stage changes. It costs one extra API call, but it can't move a record backward. I use the first fix for high-volume events where an extra call per event would burn API quota.
How fast do you have to respond?
Fast. Senders give you a few seconds, then they count it as a failure and retry. HubSpot's app webhooks treat anything over five seconds as failed. The Standard Webhooks spec recommends that senders time out somewhere between 15 and 30 seconds. Don't plan around the long end.
So split the work in two:
Sender ──POST──▶ Receiver ──▶ verify ──▶ dedupe ──▶ write to queue ──▶ return 200
│
▼
Worker ──▶ enrich ──▶ upsert CRM ──▶ route ──▶ Slack
The receiver does only cheap work and answers in under a second. A worker picks jobs off the queue and does the slow parts: enrichment, CRM writes, routing, alerts. If the CRM is down, the worker retries on its own schedule. The sender never knows.
Stripe's docs make the same point. They tell you to return a 2xx before any complex logic and to process events with an async queue, so spikes like start-of-month renewals don't swamp you.
In Zapier you can't split it this way, because Zapier replies 200 right away no matter what. In Make and n8n, reply early with a response node, then keep going. In code, write to a queue table or a managed queue and return.
How do you map fields between tools?
Every tool names things differently. Typeform calls it work_email because you named the field that. HubSpot calls it email. Salesforce calls it Email on a Lead. Your enrichment tool might return employee_count while your CRM stores a dropdown called company_size.
Field mapping is the list that says which field goes where and how it changes on the way. Write it down before you build. Then turn it into a data contract: an agreement on what each event must include, in what format, with what allowed values.
Field map: demo form to HubSpot contact (trimmed)
source field → CRM property transform required
answers[ref=work_email] → email lowercase, trim yes
answers[ref=company] → company trim yes
answers[ref=company_size] → company_size map "51-200" to "51_200" no
hidden.utm_source → utm_source as is no
form_response.submitted_at → demo_requested_at ISO 8601 to epoch ms yes
(constant) → lead_source "Demo form" yes
A few rules keep the map clean:
- Map by stable keys, not labels. Typeform's
refstays the same when someone edits the question text. Labels change. - Normalize on the way in. Lowercase emails. Strip
https://andwww.from domains. Turn sizes into your CRM's dropdown values. - Never overwrite good data with blanks. If the form leaves a field empty, skip it. Don't write an empty string over a value a rep typed.
- Version the contract. When a form changes, update the map the same day. Most silent breaks start with "someone edited the form."
How do you monitor webhook flows?
Webhooks fail quietly. A form tool stops sending after a URL change. A field gets renamed. The flow still says "success," but the CRM stops getting leads. You need three layers of monitoring to catch that.
Log every event. Keep the raw payload, the event ID, the time received, the status and the last error. The webhook_events table above does this. When a rep says "I never got that lead," you can answer in a minute.
Alert on failure, not on success. Send an alert when an event fails all retries, when the failure rate passes a few percent in an hour, or when no events arrive for longer than normal. That last one catches the silent breaks. If your demo form gets 20 leads on a normal weekday and you see zero by noon, something broke.
Reconcile once a week. Count events in the source tool and count records in the CRM for the same week. Typeform responses against contacts with source "Demo form." Stripe active subscriptions against CRM customers. Calendly bookings against logged meetings. If the counts don't match, find the gap before the board meeting finds it for you.
Most vendors let you replay missed events. Stripe's docs show how to list events with delivery_success=false and process the backlog. Use that after any outage.
What should a webhook security checklist include?
Run this list on every new flow before it goes live.
- HTTPS only. Stripe requires it in live mode, and nobody else should get less.
- Verify the signature on the raw body, with a constant-time compare.
- Reject timestamps older than 5 minutes.
- Keep secrets in environment variables or a secrets manager, never in code or a shared doc.
- Rotate secrets on a schedule and when someone leaves. Stripe lets an old secret live for up to 7 days during a roll, so you can swap with no downtime.
- Allowlist sender IPs when the vendor publishes them. Stripe does.
- Accept only the event types you expect. Drop the rest with a 200 so the sender stops retrying.
- Cap the body size and reject anything huge.
- Don't log full personal data in plain text forever. Set a retention period on the raw payload table.
- Give the worker an API key with only the scopes it needs. A form flow doesn't need to delete deals.
Treat webhook URLs like passwords too. Slack's docs warn that incoming webhook URLs are secret and say Slack revokes ones it finds leaked in public code.
Is polling really more expensive than webhooks?
Usually, yes, and the gap grows with every flow you add. The math is simple once you count the calls.


Now multiply. Ten flows that poll every minute make 432,000 calls a month. On a CRM with a daily API cap, that quota is shared with every other integration you run. HubSpot's usage guidelines list 190 requests per 10 seconds per private app on Professional, with a shared daily cap per account, as of November 2026. Polling eats into both.
Polling still has a job. Use it for tools with no webhooks, for nightly reconciliation, and for backfills after an outage. Just don't use it as your main way to catch real-time events. Run your own numbers in the GTM stack cost calculator.
How do webhook flows break?
The same failures come up again and again. Here are the common ones, with the fix for each.
| How it breaks | What you see | Fix |
|---|---|---|
| Test URL left in production (n8n) | Works in the editor, never in real life | Use the production URL and activate the workflow |
| Body parsed before verify | Every signature fails | Use the raw body on the webhook route |
| No dedupe | Duplicate contacts, double Slack alerts | Event ID table plus upserts |
| Slow handler | Vendor retries, then disables the endpoint | Return 200 fast, queue the work |
| Form field renamed | Leads arrive with blank company or email | Map by stable keys, alert on missing required fields |
| Zap or scenario turned off | Silent gap in leads | Alert when volume drops below normal |
| Zap transferred to a new owner | Requests go nowhere | Zapier's catch URL includes the owner's ID, so update the sender after a transfer |
| Out-of-order events | Deals move backward | Compare event times or refetch from the API |
| Secret rotated in one place only | Sudden wall of 401s | Rotate with an overlap window, update every receiver |
| Rate limits hit on the CRM | 429 errors in bursts | Back off and retry from the queue, batch writes |
| One flow does everything | One failure stops routing, alerts and enrichment | Split into small steps with their own retries |
Most of these share one root cause: nobody owns the flow. Give every webhook flow a named owner, a short doc with its field map, and a place where its errors go. That habit prevents more incidents than any tool choice.
How do you build your first three webhook flows?
If your team has no webhook flows yet, start with these three. Together they cover inbound leads, meetings and revenue, which is where speed and accuracy pay most.
Flow 1: demo form to CRM to Slack
This is the highest-value first flow for almost every B2B team. A demo request lands in the CRM in seconds, gets an owner, and the owner gets a Slack alert with a link. It pairs well with clear lead routing rules. The full build, with Zapier, n8n and code versions, is in the form to CRM to Slack webhook recipe.
Flow 2: meeting booked to CRM
When a prospect books through Calendly, Cal.com or Chili Piper, catch the booking event. Find or create the contact, log the meeting on the record, and move the lifecycle stage. Also catch the cancel event. A canceled meeting that still shows as booked makes your pipeline look better than it is.
Flow 3: billing to CRM
Catch payment and subscription events from Stripe or your billing tool. Mark the company as a customer, write the plan and MRR, and tell the account owner. This is the flow where duplicates and out-of-order events hurt most, so use code or a careful build. The Stripe to CRM webhook build walks through it.
The steps for each flow
Use the same steps for all three:
- Write the contract. List the event types, the fields, the CRM properties and the required fields. One page.
- Pick the receiver. Use the decision table above. Be honest about who will fix it.
- Point the sender at a request bin. Send a test event and save the real payload. Build from that, not from the docs.
- Build verify, dedupe and queue first. Then add the business logic.
- Use upserts. Search by email or external ID before you create anything.
- Send test events, then real ones. Check each CRM record by hand.
- Add the log, the failure alert and the volume alert.
- Write the owner and the field map in a short doc.
- Put the weekly reconciliation on someone's calendar.
If you run HubSpot and want HubSpot itself to send webhooks from workflows, check your plan first. HubSpot's workflow webhook article lists that action under Data Hub Professional and Enterprise, as of November 2026. Receiving webhooks into HubSpot doesn't need it. Your receiver writes to HubSpot through the API.
What to do this week
Pick one flow, probably the demo form. List its fields, decide on a receiver, and point the form at a request bin so you can see the real payload. Then build the receiver with verify, dedupe and a queue before any business logic.
Next, add the two alerts: one for failures and one for "no events in longer than normal." Put a 15-minute weekly reconciliation on the calendar. Those three habits catch most problems before a rep or a customer does.
If you'd rather have someone build and own these flows with you, that's the work we do in GTM engineering.