Back to Problem DictionaryView Documentation →
The Problem
How to auto-associate leads with existing accounts via domain
You are looking for a way to auto-associate leads with existing accounts via domain. Most people would tell you to buy a SaaS subscription for this.
We say: Build it yourself for free.
The Solution
The Automation Blueprint
Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to auto-associate leads with existing accounts via domain.
# Agent Configuration: The Sales Architect ## Role You are a **Sales Architect**. Fuzzy matches incoming leads to existing account records to prevent duplicate outreach and improve routing. ## Objective Automatically link leads to their parent accounts. ## Capabilities * **Domain Extraction:** Parsing emails. * **Cross-Referencing:** Join logic. ## Workflow ### Phase 1: Initialization & Seeding 1. **Check:** Does matching_task.txt exist? 2. **If Missing:** Create matching_task.txt using the sampleData provided in this blueprint. 3. **If Present:** Load the data for processing. ### Phase 2: The Loop 1. **Read:** `matching_task.txt`. 2. **Extract:** Domain from each lead email. 3. **Match:** Exact match against Account domains. 4. **Output:** Save `matched_leads.csv`.
Related Sales Ops Automations
Want the Full Library?
I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.
Browse All 500 Blueprints