Skip to content
Matt

Case studies 01 · Lead workflow

Case study · demo project

Each website enquiry gets scored, filed, answered and flagged to the owner.

Built so a clinic answers a new enquiry while the person is still on the page, has them in the CRM without retyping, and doesn't rely on anyone remembering to follow up.

Demo build · sample clinic · sample data

Stack
  • n8n
  • claude-haiku
  • hubspot
  • telegram
Demo
Enquiry form with a live workflow run
Built in
demos/lead-workflow/ · site/demos/lead/
Status
Running live since 24 Nov 2026

01 / 08

The problem

Enquiries from a clinic's website form can arrive in the evening or at the weekend, when nobody is at the desk. On busy days the inbox waits, and a reply can take a day.

Someone has to copy each enquiry into the CRM by hand, and from the inbox alone it's hard to tell who wants to book this week and who is comparing prices. Follow-ups happen when someone remembers them.

02 / 08

The workflow

It starts when someone sends the clinic's website form, which posts to an n8n webhook. Claude scores the enquiry and drafts a reply, the contact goes into HubSpot, the owner gets a Telegram alert, and the reply goes back to the page. Two minutes later a follow-up task lands on the contact and the owner gets a reminder.

The score is the sum of four factors, each with a short reason: intent (out of 40), timing (25), fit (20) and engagement (15). Hot is 80 and up, Warm 50 to 79, Cold under 50. The steps run one after another, in the order below.

Run trace replay of a real run 25 Nov 2026 · 07:43 UTC · invented enquiry
  1. 01

    Webhook · enquiry

    → POST /webhook/holloway-lead, the form's fields

    n8n 1 ms
  2. 02

    Prepare lead & prompt → AI scoring · Claude → Parse AI result

    → 79/100 · intent 36 · timing 20 · fit 10 · engagement 13 · urgency high

    claude-haiku 5,754 ms
  3. 03

    HubSpot · upsert contact

    → contact created or updated by email, with five AI fields

    hubspot 841 ms
  4. 04

    Format owner alert → Owner alert · Telegram

    → band, score, factors and summary to the owner's chat

    telegram 326 ms
  5. 05

    Build response → Reply to form

    → reply, score, factors and step times back to the page

    n8n 1 ms
  6. 06

    Wait 2 min → HubSpot · follow-up task → Owner alert · follow-up due

    → scheduled; the task and the reminder follow about 2 min later

    n8n 1 ms
Total 6.9 s inside n8n, about 7 s to the reply on the page Measured by n8n; network time to and from the browser not included

The enquiry · invented

Hi, I'd like to start laser hair removal on my legs and underarms before a holiday in Lisbon in mid-March. Is that enough time to see a difference? I could come in for a patch test next week, ideally a weekday after 6pm.

Dana Reyes · laser hair removal · consent yes

The reply · claude-haiku-5-5

Hi Dana, thanks for getting in touch. Laser hair removal usually takes 6-8 sessions, so full results may not be reached by mid-March, but we can talk through what's realistic for your timeline at a free 20-minute consultation in clinic. We're open weekdays until 19:00, so a visit around 6pm works. Please avoid tanning, as we can't laser tanned skin within 2 weeks, and we'll do a patch test 48 hours before your first session. The Holloway team

79/100 · Warm · shown on the page only, never emailed

From the recorded run, 25 Nov 2026. Every fact in the reply comes from the sample clinic's list in the prompt, and it tells her plainly that mid-March may be too soon. Fit scored 10 of 20 for the same reason: "Offered, but 6-8 sessions may not fit timing".

03 / 08

The tools

n8n
Runs the workflow and holds every credential
n8n Cloud · 12 nodes in one line: Webhook, Code, HTTP Request, HubSpot, Telegram, Wait, Respond to Webhook
Claude
Scores the enquiry, names the treatment, sets urgency, writes the owner's summary and the reply
claude-haiku-5-5 via the Messages API (HTTP Request) · effort low · max_tokens 4,000 · 30 s timeout, one retry
HubSpot
Creates or updates the contact with five AI fields, then adds the follow-up task
Free CRM · credential "HubSpot (Holloway demo)" · ai_score, ai_treatment, ai_urgency, ai_summary, lead_source
Telegram
Sends the new-lead alert and the follow-up reminder to the owner
Bot · credential "Telegram (owner alerts)" · the owner's chat id
The demo page
The form, the run panel with each step's time, and the reply
Plain JavaScript, no build step · lead-client.js, run-panel.js, recorded-run.js

04 / 08

What's real and what's sample

Real

built
  • The workflow, running on n8n Cloud since 24 Nov 2026
  • The Claude call, the HubSpot contact and task, and the Telegram alerts in each run
  • The step times, measured by n8n
  • The replay on the demo page: one run's response, pasted in unchanged

Sample

sample
  • The clinic, Holloway Skin & Laser: a sample clinic with made-up treatments, prices and hours
  • The enquiries: invented people with example.com addresses, sent as tests
  • The HubSpot account: a free demo account that holds only test contacts
Live runs
First run, 24 Nov 2026: score 81, all six steps ok, the Telegram alert arrived, and after the 2-minute wait the run finished in 2 min 7 s with a HubSpot task linked to the contact. The run quoted on this page is from 25 Nov.
Files, not live yet
The owner-approval branch exists as a file to import; it hasn't been run live yet. The error-alert workflow is live since 25 Nov 2026 on this flow and the other three: a test run that threw an error sent the owner one Telegram alert.
Not measured yet
What it would change for a clinic: enquiries answered, bookings, staff time saved, running cost per enquiry. Those need a real clinic's enquiries, not test runs.

05 / 08

What broke, and the fix

On 25 Nov the first test of the day came back with a score of 50 and no factors. The n8n execution showed why: Claude had stopped at its token limit of 1,500. Haiku 5.5 thinks before it answers by default, and that thinking counts toward the limit, so the JSON was cut off mid-string.

The visitor didn't see a failure. The workflow's fallback sent a safe, generic reply, and the contact was still saved and the owner still alerted. That is what the steps' continue-on-error setting is for.

The fix
Effort set to low (output_config) and max_tokens raised to 4,000. The next run scored 79 with every step ok.
Also changed
The same setting went into the support chat, which runs live, and into the Make and GoHighLevel versions of this flow, which haven't run yet.

06 / 08

The limits

  1. It's a proof of concept. Only test enquiries have gone through it.
  2. The webhook only takes browser calls from the site's own domains, but a script can still post to it. There's no spam filter or rate limit. The demo's Claude account has a $5 monthly limit; past it, scoring fails and visitors get the generic fallback reply.
  3. If the webhook doesn't answer within 20 seconds, or answers with an error, the demo page plays the recorded run instead and labels it as a replay.
  4. An empty phone field is saved to HubSpot as empty and may clear a phone number saved earlier on that contact.
  5. If HubSpot fails, the follow-up task still runs after the wait and fails quietly, with no contact to attach to.
  6. Step times are measured inside n8n and leave out network time. The webhook step reads about 1 ms because n8n doesn't expose when the request arrived. One round trip timed with curl took 9.8 s.
  7. The 2-minute wait is demo timing; a real setup would wait a few hours to a day. The task is due the moment it's created.
  8. An optional owner-approval step exists as a separate file: the owner gets the draft reply in Telegram with Approve and Hold for a person, and the decision is logged as a note on the HubSpot contact. It never sends anything to the visitor. In this demo the reply is already on the page by then, so approval gates what the clinic would send next. The buttons only ever go to the owner's chat.
  9. The error-alert workflow catches steps that stop a run. The Claude, HubSpot and Telegram steps continue on error, so their failures show in the run's step list, not as an alert.

07 / 08

The handover

A clinic's team gets the workflow as files to import into their own n8n, with a written guide to set it up, test it with one call and run it week to week. They need four accounts, listed below.

What the client gets

  • SOP Setup, the one-call test, takeover and known limits demos/lead-workflow/SOP.md
  • Runbook What each failure looks like: HubSpot down shows "HubSpot: not saved" in the alert; Claude down gives the fallback reply and a score of 50; with the error workflow imported, a step that stops the run sends an alert with a link to it SOP.md · How your team takes it over
  • Walkthrough video One run from the form to the HubSpot contact and the Telegram alert Script written, not recorded yet
  • Workflow files The lead flow, the approval branch and the error alert, with credentials as names only lead-workflow.json · approval-branch.json · error-workflow.json
Accounts they need
n8n (cloud or self-hosted), an Anthropic API key with a monthly spend limit, HubSpot with a key that can read and write contacts and create tasks, and a Telegram bot with the owner's chat id. Three n8n credentials by name, and five HubSpot contact fields created first.
What they'd change
The clinic's facts, prices, tone and scoring in the prompt; the treatment list; the wait before the follow-up; the alert channel (Slack or owner-only email or SMS, kept to the team); the allowed web domains.
Weekly owner
One named person on the clinic's team, agreed at handover. Each week: the n8n run list for errors, a few HubSpot scores to see they make sense, and Claude spend.

08 / 08

Run the demo

Send a sample enquiry, or write your own, and watch the six steps run live. It's saved to the demo's CRM; nothing is sent to the email you type. If the workflow doesn't answer, the page replays the 25 Nov run and says so.

All case studies