B2B Lead Enrichment (Apollo & CRM)
Level 2: Routing & AI · about 20 minutes · 5 core steps
Enrich inbound webhook leads with Apollo company data and assign a CRM owner by employee headcount. Companies over 1000 employees route to Enterprise, 1000 or fewer route to SMB, and missing headcounts stop on ELSE for review.
- Result
- Enrich a lead with Apollo company data and assign its CRM owner by employee count.
- You need
- Apollo and CRM connections, enrichment quota, test leads, and destination owners.
- Usage
- Uses Step credits and Apollo quota (0 Glow AI tokens for the core workflow).
- What changes
- Runs and action tests query Apollo and update CRM lead fields and owners.
Prerequisites
- Webhook source: A form (Typeform, Webflow, or custom) that posts
emailandcrm_lead_id. You can test with the sample payload first. - Apollo.io connection: Organization enrichment access and available quota.
- CRM connection: Permission to update test leads, destination owners, and an existing lead ID per submission. Add a lookup or create Step first if your form omits the ID.
Building the Automation
1. The Trigger: Form Submission (Webhook)
Add a Webhook trigger and enable Body only so fields sit at the top level instead of under body. Paste this payload into Test & Debug → Testing data:
{
"name": "Ada Lovelace",
"email": "[email protected]",
"crm_lead_id": "replace-with-your-test-lead-id"
}2. The Enrichment: Apollo
Add Apollo.io → Search For Organizations (pass the domain in Organization Domains) or People Enrichment (pass Email or Domain). Keep Mode in the ⋮ menu set to HTTP. Extract the email domain inline with Data Transformation:
{{ 1.email | extract_domain }}Replace example.com with an authorized domain. Set the run point to the Webhook trigger and click Run in the dock (ordinary Run step only replays saved data). Inspect the output to locate the returned employee-count, industry, and revenue fields. An empty response does not mean the company is small.
3. The Logic: Condition Step (Routing)
Add a Conditions Step with two mutually exclusive Number routes. Select the actual employee-count field from Workflow data rather than assuming a field name or adding a ret wrapper:
Enterprise (Over 1,000)
Put two rules in the same condition block (AND): employee count exists
AND is greater than 1000.
4. The Action: CRM Update
- Add HubSpot → Update Lead or Salesforce → Update Record (Object Type: Lead).
- Map {{ 1.crm_lead_id }}, returned enrichment fields, and the Enterprise owner.
- Add a second CRM update Step on the SMB branch with {{ 1.crm_lead_id }}.
- Assign the SMB owner and keep ELSE separate from automatic updates.
Handle no match separately from failure: A call that returns no company routes to ELSE for review. API failures use an Error Path. Never substitute an AI estimate for a missing headcount.
Test and go live
Keep the automation in Draft pointed at test leads. Set the run point to the Webhook trigger and click Run in the dock. To test boundaries (1001, 1000, 999, blank, absent, unknown), temporarily map Conditions to {{ 1.test_employee_count }} in the trigger payload, then restore the Apollo field.
| Test case | Expected result | Where to check |
|---|---|---|
Authorized company email + test crm_lead_id | Enriches {{ 1.email | extract_domain }} and updates the test lead’s owner on the matching branch. | Apollo output, Conditions result, and test CRM lead |
Boundary check: 1001 vs 1000 and 999 | 1001 matches Enterprise only; 1000 and 999 match SMB only. | Conditions route result and test CRM lead owner |
Absent, blank (""), or non-numeric (unknown) count | Neither numeric route matches; run takes ELSE with 0 CRM updates. | Conditions diagnostics and unchanged CRM test lead |
| Enrichment returns no company or fails | No-match takes ELSE; API failures follow your Error Path. | Run history, enrichment output, and CRM lead |
| Go Live check: one controlled form submission | Live Webhook run enriches the domain and updates the test lead once. | Automation run history and CRM lead |
- Run
- Set the Webhook trigger as the starting Step with your test lead payload and click Run in the dock.
- You should see
- Apollo enriches the domain, Conditions selects the matching headcount branch, and your CRM updates the test lead owner.
What’s Next?
👉 Continue to AI Support Router with Tools →
- Walk through branching basics in 3. Branching.
- Normalize inbound fields with Data Transformation.
- Add failure recovery with Error Handling & Retries.