Free n8n template

AI lead qualification agent n8n template (HubSpot, Gmail, Slack)

What it does

This n8n template answers each inbound lead from a form webhook or email reply, keeps the conversation state in HubSpot contact properties, and has Claude write the next reply while returning structured answers for need, timeline, size, budget band and role. A scoring function in code sets the tier and decides whether to ask, book, hand off, nurture or decline. Shadow mode sends every draft to Slack first. You need HubSpot, Gmail, Slack and an Anthropic API key.

What this workflow does

  1. New lead message accepts {email, name, company, message, source} from your form or chat tool. Lead email reply picks up the lead’s replies to the agent’s emails.
  2. Normalize inbound turns both into one shape and strips quoted history from email replies.
  3. HubSpot: find contact loads the contact’s stored answers, transcript and status. Leads whose conversation already ended are left to the person who owns them.
  4. Build agent turn tells Claude what is already known and what is still open, so the agent never re-asks. The prompt requires an AI disclosure on the first reply and forbids prices, terms and meeting promises.
  5. Claude: next reply returns the reply plus structured answers with fixed values for timeline, company size, budget band and decision role, and flags for “wants a human” and “off topic”.
  6. Score and decide merges answers without overwriting known values, strips any reply that mentions a dollar amount, and applies a versioned scoring function: tier A books with your booking link, tier B hands off to a rep, tier C goes to nurture, and disqualified leads get a courteous close. After four turns it hands off whatever it has.
  7. HubSpot: save answers writes answers, transcript, status and tier to the contact.
  8. Next action sends replies with Email the lead, and shadow-mode drafts and errors to Notify sales. Handoffs do both: the lead gets a fixed acknowledgment by email, even in shadow mode, and sales gets the summary in Slack.

Before you import

  • A current n8n version.
  • HubSpot with a private app token that can read and write contacts, and four custom contact properties: lumeor_qual_answers, lumeor_qual_transcript (multi-line text), lumeor_qual_status and lumeor_qual_tier.
  • A Gmail or Google Workspace mailbox the agent sends from.
  • An Anthropic API key and a Slack bot for your sales channel.

Setup

  1. Import the JSON file and connect the credentials. Both HubSpot nodes use the same private app token credential.
  2. In Build agent turn, replace REPLACE_WITH_COMPANY_NAME and REPLACE_WITH_ONE_SENTENCE_ABOUT_YOUR_OFFER.
  3. In Score and decide, replace the company name and REPLACE_WITH_BOOKING_LINK, and adjust the score function to match the rubric your sales lead signed off.
  4. Replace REPLACE_WITH_SALES_CHANNEL in Notify sales.
  5. Point your website form or chat tool at the production webhook URL with the Header Auth header.

Test it

Leave SHADOW_MODE on. Post a form message such as “We need help automating accounts payable” from a test address. Slack should show a draft that introduces itself as an AI assistant and asks one or two questions, and the HubSpot contact should have answers and a transcript. Post a second message with timeline, team size, budget band and your role, and confirm the tier and status change in HubSpot and the Slack draft contains the booking link for an A-tier lead.

Make it production-ready

  • Shadow mode first. Review drafts for one to two weeks, compare tiers with what reps decide after the first call, then set SHADOW_MODE to false.
  • Error workflow. Set one so a HubSpot or Gmail failure never leaves a lead unanswered.
  • Follow-ups. Add a scheduled flow that nudges leads in qualifying status after two days of silence, at a cadence you approve.
  • Routing. Use owner rules or round robin for handoffs instead of one channel.
  • SMS. Add Twilio only after consent capture and 10DLC registration are in place.
  • Model choice. claude-haiku-5-5 is a cheaper option for simple qualification at high volume.

Read the full guide, how to build an AI lead qualification agent, see the lead enrichment template to fill answers before the first reply, or talk to Lumeor.

Next steps