- 296KRecords processed
- 86Pipeline runs
- 37K+Contacts pushed to HubSpot
- 9Database tables
The problem
Every event brings a list of exhibiting companies. Finding the right contacts at each one by hand is slow, and buying data blindly burns credits on the wrong people.
The output also had to land cleanly in HubSpot: no duplicate companies, contacts associated with the right company, and nothing pushed without a person checking it.
What I built
Flexible intake
Events and exhibitors from a HubSpot custom object, or from CSV, XLSX or pasted lists.
Model-driven search
The OpenAI Responses API drives a licensed B2B data provider's company and people search through MCP, with hard credit rules in the prompt.
Ranking and filters
Local ranking with strictness levels: dynamic, no-filter and progressive retry when a strict search comes back empty.
Email finding
Parallel requests with track IDs, async webhooks and rate-limit backoff.
Approval and push
Manual approval, then HubSpot upsert of the company by domain, the contact, and their association, through a push queue.
Operations layer
Resumable bulk jobs, diagnosis and recovery pages, a setup check that creates missing HubSpot properties, logs, stats and data archiving with restore.
Key decisions
- Decision 1AI for search, code for rules
The model decides what to search; spending limits, ranking and deduplication stay in deterministic code.
- Decision 2A human approves every push
Nothing reaches HubSpot without review, which keeps the CRM clean.
- Decision 3Domain is the company key
Companies are upserted by domain with a uniqueness check, so reruns don't create duplicates.
- Decision 4Everything resumable
Long jobs survive timeouts and rate limits and pick up where they stopped.
Where it stands
So far the pipeline has processed about 296,000 records across 86 runs and pushed more than 37,000 approved contacts to HubSpot, with email coverage around 54%.
It runs as a standalone PHP and MySQL application with 9 tables and a long history of schema upgrades. Work continues; user login is planned for the next phase.
Stack
B2B lead intelligence pipeline● Rev. 2026
- App
- Standalone PHP and MySQL
- AI
- OpenAI Responses API, MCP tool calls
- Data
- Licensed B2B data provider (search + email finder)
- CRM
- HubSpot API: companies, contacts, associations, custom properties
- My role
- Design and development
More case studies
- WordPress · WooCommerce · HubSpot
Event hotel booking platform
HubSpot custom objects, a WordPress publisher plugin and WooCommerce bookings with deposits and Stripe.
Read the case study - PHP · MySQL · Zoho CRM
Pickup portal on Zoho CRM
A standalone, offline-first PHP app on Zoho CRM, built to serve 12 nursery branches and 1,640 students.
Read the case study - Security · Linux · WordPress
Compromised hosting account
An hourly cron job running encoded shell commands, hidden WordPress persistence, and a clean recovery.
Read the case study