Turn Emails Into Customers.
One email in. A scored, enriched, and routed lead out.
A single email address is one of the most valuable things a business can capture — and most businesses just dump it in a list and hope sales gets to it.
This is the exact n8n workflow Top of Funnel builds first for every client. It is public and free. Below is the full node-by-node walkthrough.
One Email Holds Everything
The insight the whole workflow is built on: an email is never just an email. It is the first link in a chain that ends at the entire company.
Every Node, Explained
Watch the complete build — webhook to Instantly campaign — including why each guardrail exists.
How the Workflow Runs
Triggers and actions. It starts the second a form is submitted and ends with a routed lead. Here is every step.
Everything starts with a trigger. A webhook sits ready like a catcher with the mitt up — the moment someone submits a lead magnet, demo request, or trial form, it captures the email address and fires the workflow. No polling, no batch jobs, no waiting.
The username half of the email is noise for now. The node strips it down to the root domain — the part that actually points to a company — and confirms the input is a real email address before anything downstream runs.
A regex blacklist omits the throwaways: gmail, outlook, temporary inboxes, and the long tail of personal addresses that will never map to a company. A null/empty check sits right behind it as error handling, so the workflow stays robust on bad input.
Instead of a POST or GET that pulls the entire page of HTML and JavaScript, this uses a HEAD request — it asks only for the status code. A 200 to 399 means the site is live. It is a cheap pre-check that keeps you from wasting Firecrawl or any scraper credits on dead domains.
Now the real scrape. Firecrawl reads the site and hunts the footer for the company LinkedIn profile URL — the same place you usually find X, YouTube, and Instagram, a company's whole digital presence. It is chosen here for cost, infrastructure, and stability. The extracted URL gets a not-empty / not-null guard before moving on.
First a check confirms the profile is a company, not a personal one. Then an OpenAI agent is grounded with the R.T.O. framework — Role ("you are a LinkedIn data analyst"), Task (extract followers, headquarters, location), and Output (return structured JSON, numbers as numbers). Grounding the agent to one narrow job is what stops it going loosey-goosey.
AI output comes back a little messy sometimes. A simple code node sanitizes and structures it, then a normalization step standardizes values — turning every variant of a country into one canonical name so the scoring logic has clean inputs.
The fun part. Three signals get scored independently against your criteria — country (United States lands a 10, others scale down to 2, 1, or 0), staff count, and industry — then combined into one holistic, algorithmic value. This is the code you should refine with your sales team or founder for your exact ICP.
Two outputs land together: a qualitative read ("moderate fit") and a quantitative score out of 100. One email has now become a ranked, defensible lead grade your whole team can act on.
The lead is pushed to your CRM (Salesforce, HubSpot, whatever you run) and a Slack message notifies the team — "you've got a new lead, go check it out." The high-fit ones can buzz your Slack and your phone so a rep gives them white-glove attention immediately.
Scores segment the flow. High-ticket leads get funneled one way for human-led follow-up; the rest route into automated campaigns. Same workflow, different language and urgency depending on how good the fit is.
A dedupe check makes sure the lead is not already in the sequence, the first name is parsed from the email and properly cased, then the workflow waits ~5 minutes — because messaging someone the literal second they sign up is creepy — before enrolling them in the right Instantly campaign.
Ground the Agent with R.T.O.
When you build an AI agent, control the narrative or it goes loosey-goosey. Every agent in this workflow is locked to three things.
“You are a LinkedIn data analyst.” A narrow identity so the model never improvises scope.
Extract followers, headquarters, and location from the company page. One job, clearly bounded.
Structured JSON, numeric values as numbers. Predictable shape so the data flows cleanly downstream.
The Scoring Engine
Three signals, scored independently, combined into one holistic value. This is the code to refine with your sales team or founder — drop it into Claude, ChatGPT, or Grok and tune the criteria to your real ICP.
Country
US → 10Geography is scored against where you actually sell. The United States lands the top score in the template; everywhere else scales down. Swap in your own priority markets.
Headcount
Staff countCompany size maps to fit — though, as the video notes, headcount is increasingly subjective in an AI-native world, so tune the bands to your true ICP.
Industry
Ranked tiersEach industry is ranked by how well it matches who you win. This is the signal worth refining most carefully with your sales team.
The Stack
Five tools wired into one n8n flow. Each does one job, and each is swappable for whatever you already run.
n8n
Guide →The orchestration layer holding every node together
Firecrawl
Guide →Scrapes the site and finds the LinkedIn company URL
Scrapin.io
Pulls structured LinkedIn company intelligence
OpenAI
The grounded agent that extracts clean JSON
Slack
Guide →Real-time new-lead alerts for the sales team
Instantly
The campaign leads route into after scoring
Want us to build this into your stack?
This is the very first workflow we build for every Top of Funnel client — wired into your CRM, your Slack, and your Instantly campaigns, then handed to your OpenClaw GTM agent. One email in, a 24/7 pipeline machine out.