Want more CODs, not just leads? You’re in the right place.

Automating Angi Leads with N8N: Meet the "Lead Pitbull"

Share:

If you are a home service business owner or a developer helping one, you know the drill: Angi leads are a race. The first person to respond wins the job. The slow responder pays for the lead but gets nothing.

We call our solution the Angi Lead Pitbull. It grabs the lead instantly, filters out bad zip codes, and sends a text message before your competitor even unlocks their phone.

Normally, we write high-level overviews. But today, we are going deep.

This is a technical step-by-step guide. We will cover the exact Regex patterns, JSON structures, and node configurations you need to build this workflow in N8N. We aren’t skipping steps because one missed comma in a Code Node can break the whole chain.

Key Takeaways

  • Dual-Trigger System: We use two separate Gmail triggers to catch Angi’s inconsistent subject lines
  • Regex Extraction: We use specific regex patterns to pull clean names and phones out of messy HTML emails.
  • AI Tool Calling: The AI doesn’t just write text; it calls a custom Google Sheets tool to verify zip code coverage.
  • Strict JSON Output: The AI is forced to output a JSON object, ensuring the routing logic never fails due to “chatty” responses
  • Conditional Routing: A Switch node automatically routes leads to an SMS sequence (if covered) or a polite decline (if not covered).

The Problem: Why "Fast Enough" isn't Enough

Angi leads are brutal.

When a lead hits your inbox, it is often messy. Sometimes it’s HTML, sometimes it’s text, and the formatting changes depending on the campaign. If you are trying to copy-paste that info into your CRM or type out a text message on your phone, you are already too slow.

Plus, how many times have you called a lead only to find out they live in a town you don’t service?

You wasted money buying the lead and time calling them. You need a system that acts like a guard dog—filtering the bad stuff and chasing down the good stuff.

How the "Pitbull" Automation Works

We built this in N8N because it handles the messy details better than standard tools.

Here is the “plain English” version of what happens under the hood.

1. The Sniff (Detection) We set up two separate Gmail triggers.

Why two? Because Angi sends emails from different addresses (like [email protected]) with different subject lines (like “New Lead” vs “New Customer Match”). If you only watch for one, you will miss jobs. We watch for both.

2. The Clean Up

Angi emails are full of invisible junk—HTML tags, weird spacing, and “soft hyphens”. We run the email through a cleaning step that scrubs all that noise and extracts the clear details: Name, Phone, and Address.

3. The Guard Check (Zip Code Filter)

This is the money-saver. The automation extracts the zip code and asks an AI agent to check it against a Google Sheet of your approved service areas.

  • If it’s in your area: The Pitbull attacks (in a good way).
  • If it’s NOT in your area: It politely declines.

4. The Attack (Instant Response)

For the good leads, we use Twilio to send an SMS immediately. SMS is the fastest way to “claim” the lead psychologically. At the same time, we send a branded HTML email with a “Schedule Online” button.

Why We Use AI in the Middle

You might ask, “Why do I need AI for this? Can’t I just use keywords?” You could, but AI adds a layer of resilience.

Sometimes extraction fails. Maybe the address is written weirdly. In our workflow, if the strict rules fail, we pass the “raw text” to the AI as a backup.

The AI is also smart enough to read the “Description” of the job. In the future, you could even have it filter out jobs you don’t do (like “I need a part” vs “I need a repair”).

The Real Problems this Automation Solves

Angi leads come with a few built-in challenges:

  • Leads arrive by email and are easy to miss

  • Response speed drops after hours or during busy days

  • Many leads are outside your service area

  • Manual responses are inconsistent and slow

  • CSRs waste time following up on bad leads

This workflow fixes all of that automatically.

High-level Flow (what is happening end-to-end)

Trigger → clean email → extract lead info → add business info → AI generates responses + checks zip coverage → parse output → route based on coverage → send SMS + email (covered) OR email-only (not covered).

Stage 1 — Detect and Normalize the Lead Email

1. Two Gmail Triggers (covers Angi email variations)

You have two separate Gmail Trigger nodes watching for Angi lead emails:

Trigger A

Trigger B


Why this matters:

Angi sends leads in slightly different formats depending on campaign type or how the lead was generated. Two triggers keeps the workflow from missing leads.

Both triggers funnel into the same cleaning and extraction pipeline.

2. “Clean Email” Code Node (HTML/RTF → Clean Text)

Angi emails can come in:

  • HTML
  • text
  • “textAsHtml”
  • sometimes even RTF formatting

This node:

  • picks the richest body available (htmltextAsHtmltext)
  • removes styles/scripts/HTML tags
  • converts <br> and </p> into line breaks
  • decodes entities like &amp;
  • collapses extra whitespace
  • includes an RTF-to-text fallback (rare, but smart)


Output:

email_text — a clean plain-text version of the lead email.

This step is critical because your next extraction node relies on predictable text patterns.

Stage 2 — Extract the Lead Details (Structured Data)

3. “Extract Lead Info” Code Node (regex-based parsing)

Now that the email is clean, you extract key lead fields using regex.

This node:

  • removes soft hyphens (&#173;) and &nbsp;
  • normalizes whitespace again
  • uses helper function extract(regex) to safely pull matches

Fields extracted:

  • name
    From: Customer Information …
  • phone
    Any US phone pattern → converted into digits only (e.g., 8645131828)
  • email
    Standard email regex
  • address
    Pattern: 123 Main St, SC 29611
  • job_number
    Pattern: Job #
  • description
    Tries to capture issue description text between sections
  • comments
    Captures free-form notes until “View Lead Details” or footer
  • source = “Angi”
  • raw_text = the cleaned email body for fallback if extraction misses something


Why this is operator-grade:

Even if some fields fail extraction, you still pass the entire cleaned email to the AI as a backup (raw_text), so the workflow remains resilient.

Stage 3 — Inject Business Settings (Template-friendly)

4. “Business Info” Set Node (Your Template Placeholders)

This step is what makes this workflow portable as a template.

It defines:

  • company_name = YOUR_COMPANY_NAME
  • company_phone = YOUR_COMPANY_PHONE
  • website = YOUR_WEBSITE
  • service_area = YOUR_SERVICE_AREA

This is where end users customize the template without touching logic.

Stage 4 — AI Agent: Creates the Responses + Checks Coverage

5. AI Agent (The “Pitbull Brain”)

This node instructs AI to act as a scheduling assistant. It must:
  1. Read lead details
  2. Extract zip code from address
  3. Check if zip is in coverage using a Google Sheet tool
  4. Output:
    • SMS message (short)
    • Email message (3–5 sentences)
    • Coverage result: “Covered” or “Not Covered” 
The really important part: You are not “guessing” coverage. The AI is required to call a tool:

6. “Check Zip Code Coverage” GoogleSheetsTool (AI tool)

This tool node gives the AI access to a zip code list sheet:

  • “ZipCode list for Map”
  • “Shared ZipCode List” tab


So the AI:

  • extracts zip from address
  • checks the sheet
  • returns Covered / Not Covered


This is a big deal
because it prevents waste:

  • No sending scheduling messages to people you don’t serve
  • No office time wasted calling outside your area

7. Output Contract (Strict JSON)

The AI output must match:

				
					{
  "sms_message": "...",
  "email_message": "...",
  "coverage": "..."
}
				
			

That strict format makes the next step predictable.

8. “Parse Output” Code Node

This node simply does:

				
					JSON.parse($json.output)

				
			

So now you have real fields available downstream:

				
					$json.sms_message
$json.email_message
$json.coverage

				
			

Stage 5 — Routing and Actions (Speed-to-Lead)

9. Switch Node (Covered vs Not Covered)

Routes based on $json.coverage:

Path A: “Zip Covered”

  • goes to Twilio SMS node
  • then to Gmail “Send a message” node

Path B: “Not Covered”

  • goes to a separate Gmail node “Send a message1”

This routing prevents sending the wrong message type.

10. Covered Path — SMS First (Fastest Channel)

Twilio node: sends SMS

  • from: placeholder YOUR_TWILIO_SMS_NUMBER
  • to: extracted lead phone
  • message: AI-generated SMS


Why SMS first:

SMS is the fastest way to “claim” the lead psychologically. They see it immediately.

11. Covered Path — Email Second (Professional Follow-up)

Gmail node sends a branded HTML email to the lead. It includes:
  • Greeting using the lead name
  • Confirmation you service their area
  • CTA buttons:
    • “Schedule Online” (uses your website)
    • “Call” (uses your company_phone)
  • Footer note explaining why they received the email (matched on Angi)
This email is intentionally polished: it makes you look organized and established.

12. Not Covered Path — Email Only (Decline cleanly)

If Not Covered, the workflow sends a different email (still branded HTML).

Important note:
In your current template, that “Not Covered” email body text looks like it accidentally contains a contradictory sentence:
“Unfortunately We service your area and have openings available.”

That line should be corrected to:

  • “Unfortunately we do not service your area…”

This is a small fix but important so you don’t confuse the customer.

How to Configure the Angi Lead Pitbull Automation

This workflow is designed so you import the template and only plug in your credentials and business info.

What You'll Need

  • An n8n account

  • A Gmail account receiving Angi leads

  • An OpenAI API key

  • A Twilio account + SMS number

  • A Google Sheet containing service-area zip codes

  • A Facebook / Website URL for CTAs

No coding required.

Step 1 — Import the Workflow

  1. Go to Workflows → Import
  2. Upload Angi Lead Pitbull – Template.json
  3. Save the workflow


Leave it
OFF for now

Step 2 — Connect Gmail Triggers

Open both Gmail trigger nodes and: Adjust subject filters if your Angi emails differ

Step 3 — Update Business Info

Open the Business Info node and replace:

  • YOUR_COMPANY_NAME
  • YOUR_COMPANY_PHONE
  • YOUR_WEBSITE
  • YOUR_SERVICE_AREA


No other logic changes needed.

Step 4 — Connect OpenAI

Open the AI Agent node:

  • Add your OpenAI API key
  • Do not modify the output format


Do not remove the coverage check instructions.

Step 5 — Configure Zip Code Sheet

  1. Create a Google Sheet
  2. Add one zip code per row
  3. Share it with the connected Google account
  4. Open the “Check Zip Code Coverage” tool node
  5. Select the spreadsheet and tab


This sheet defines your service area.

Step 6 — Connect Twilio

Open the Twilio SMS node:

  • Add your Twilio credentials
  • Set the “From” number
  • Leave message mapping unchanged

Step 7 — Review Email Templates

Open both Gmail “Send message” nodes:

  • Verify wording
  • Confirm links (call + schedule)
  • Fix the “Not Covered” message if needed

Step 8 — Test the Workflow

Before activating:

  • Send yourself a test Angi lead email
  • Test one covered zip
  • Test one uncovered zip


Confirm SMS + email routing works correctly.

Step 9 — Activate

Once tests pass:

  • Turn the workflow ON
  • Monitor first live leads
  • Enjoy beating competitors to the punch

Optional upgrades you could add

If you want this to feel “enterprise-grade” for attendees:

  1. Add a “quiet hours” rule

    • If lead comes in after 9pm → send SMS next morning at 8am

  2. Add dedupe protection

    • If same phone/email arrives again within 24h → don’t spam

  3. Log to Google Sheets

    • lead name, phone, zip, covered/not, timestamp, message sent

  4. Add “call task” for covered leads

    • if no reply in 10 minutes → create follow-up reminder

Frequently Asked Questions

Why does the automation need two Gmail triggers? Angi is inconsistent. Sometimes they send “New Lead” and sometimes “New Customer Match” depending on how they generated the lead. Using two triggers ensures we don’t drop the ball just because they changed the subject line.

Can I customize the text message? Absolutely. The AI generates the message based on instructions we give it, but you can also hard-code a specific template if you want total control over the wording.

What happens if the lead is out of my service area? The system sends a polite “Not Covered” email. This protects your reputation—you don’t just ghost the customer, but you also don’t waste time calling them.

Does this work for Thumbtack or HomeAdvisor? Yes, but you would need to adjust the “Trigger” and “Extraction” steps to match their email formats. The logic (Zip check -> SMS) remains exactly the same.

Is N8N expensive? N8N is very affordable (often free to start if you self-host). The real costs are tiny fractions of a cent for the OpenAI checks and Twilio texts. It’s much cheaper than the cost of one missed job.

Conclusion

The “Angi Lead Pitbull” isn’t just about automation; it’s about aggression.

In the home service game, the nice guy who calls back three hours later finishes last.

By automating the messy part—the reading, the checking, and the initial texting—you free up your team to do what they do best: closing the sale and doing the work.

If you are tired of paying for leads that you never actually talk to, it’s time to let the Pitbull off the leash.

We can install this workflow for you, customize your service area zips, and get it running in under a week.

Ready to stop losing leads to speed? Contact us at Super Service Bros.