Capstone Part 2: The Lead & CRM Engine
·Automation

Capstone Part 2: The Lead & CRM Engine

Hands-on implementation. Build the first module of Nexus-One: A high-performance lead capture system with deduplication and HubSpot integration.

Capstone Part 2: The Lead & CRM Engine

In Part 2, we build the "Sales" heart of Nexus-One. We will handle incoming webhooks, normalize the data, and update HubSpot without creating duplicates.

1. The Intake Node

Add a Webhook node.

  • Method: POST
  • Path: new-lead
  • Output: JSON containing first_name, email, and company.

2. Normalization (Review Module 4)

Add a Set node.

  • Expression: {{ $json.email.toLowerCase().trim() }}.
  • Why?: This ensures that JOHN@DOE.COM and john@doe.com are treated as the same person.

3. The Deduping Search (Review Module 8)

Add a HubSpot node.

  • Operation: Search.
  • Query: Find where Email matches your normalized email.

4. The Branching Logic (Review Module 5)

Add an IF node.

  • Check: { $node["HubSpot"].json["total"] > 0 }.
  • TRUE (Update): HubSpot Node -> Update Contact.
  • FALSE (Create): HubSpot Node -> Create Contact.

5. Summary of the Flow

New Lead -> Clean Data -> Search HubSpot -> Update or Create.


Exercise: The Lead Builder

  1. Trigger your webhook using Postman or Curl.
  2. Verify that your Set node is actually lowercasing the email.
  3. Check your HubSpot dashboard. Did the contact appear with the correct details?
  4. What happens if the company field is empty? How would you add a "Fallback" value like "Unknown"? (Hint: Use an Expression).
  5. Research: How would you add a "Slack Notification" ONLY if the lead is brand new (the FALSE branch)?

Summary

You have built the first "Module" of your business assistant. This engine is resilient, clean, and ensures that your CRM data remains a "Single Source of Truth."

Next Lesson: Part 3: Integrating AI and Summarization.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn