
The problem
In travel sales, leads leak between tools. A Meta form gets exported by hand, a WhatsApp enquiry gets buried in support chat, a landing page posts to an inbox nobody checks, and when a lead goes missing there is no proof it was ever sent.
Every source behaves differently:
Meta lead ads send only a leadgen ID, so the answers have to be fetched from the Graph API, and Meta retries anything that did not return 200.
WhatsApp via Meta Cloud API is signed, but DoubleTick signs nothing and relies on a secret in the URL. Every message is a possible lead.
Website forms use different field names, and the payload can be an object, an array or wrapped in a data envelope.
Landing pages often arrive without UTM data, so the campaign has to be inferred.
What we built
Each source is a connector that only verifies and parses for its provider. Everything after that is shared.
Pipeline: verify → parse → normalise → store
One signed webhook per source, each with its own URL and secret. A delivery-log row opens before any check runs.
Paused connections return 200 and store nothing, so providers stop retrying instead of hammering the endpoint for days.
Phones become digits with country code, emails are lowercased, dates become ISO, names are tidied.
Leads with no phone and no email are dropped with a logged reason. Resent leads are recognised by ID and stored once.
Each lead keeps contact details, trip intent, 31 attribution fields, its source, provider and system timestamps, and the untouched raw payload.
Built so no lead gets lost
Retries: 30 s × 2ⁿ, capped at 1 hour, 10 tries. A lead that still fails is parked for a person, never dropped.
No duplicates, three layers deep:
A unique index on connection + external ID at intake
One send per lead at a time in the forwarder
An idempotency row in the CRM, claimed in the same transaction and kept for 180 days
Delivery log: every request with one of ten outcomes, a redacted query string, safe headers and the raw body. Signature headers are logged only as present or absent.
Security: secrets encrypted at rest with AES-256-GCM in a self-describing format, so encryption can be switched on in a running system. Secrets show only their last four characters, webhook secrets rotate in one click, and permissions are split into read, manage and connections.
One engine, two businesses
The same connectors, pipeline, forwarder, secrets and delivery log run in two products with different business rules:
Holiday travel CRM (live September 2026): repeat contacts within 30 days are held as duplicates, leads are assigned round-robin to destination experts active in the last 20 minutes during working hours, and a WhatsApp welcome template goes out once on arrival.
B2B group-booking platform (October 2026): every enquiry is a new lead, it lands unassigned as "New" for sales managers, and resent leads are still dropped by ID.
Connector settings forms are generated from Zod schemas, so a new connector needs no UI code.
Timeline
11 Sep 2026: first commit, a standalone app with four connectors
16 to 22 Sep: PostgreSQL store, CRM forwarder with retries and parking, encrypted secrets, admin screens, round-robin, attribution and the delivery log. Then it moved inside the CRM API as a NestJS module.
2 Oct: ported to the group-booking platform in one pull request (68 files, 9,389 lines, seven test files)
10 to 12 Oct: public site forms and WhatsApp conversations routed through the pipeline
By the numbers
4 lead sources through one webhook system
100 form field names understood out of the box
21 days from first commit to a second platform
246 unit tests across both copies
31 attribution fields stored per lead
Business outcomes like conversion and response time have not been measured yet, so these are engineering facts, not sales claims.
Stack: NestJS 11, PostgreSQL with Prisma, React with TanStack Query, Zod, node:crypto, Vitest, Jest
Full case study: https://codevibe.in/case-studies/lead-parsing-system
Built by the Codevibe engineering team. Got leads scattered across forms, ads and WhatsApp? Let's talk.
0 likes · 0 views · Nov 22, 2026
One signed webhook per lead source, one pipeline (verify, parse, normalise, store) and a retrying hand-off to the CRM.
Timeline
Sep 11, 2026 - Oct 15, 2026