Skip to content

The moment it happens

Qualify WhatsApp enquiries into HubSpot

People who message your WhatsApp number are asked the right questions, saved in HubSpot with a score, and hot leads are posted to #sales.

Runs
The moment it happens
Apps
HubSpot, WhatsApp Business
AI
Yes, uses the built-in AI allowance
Access
whatsapp_business_messaging; crm.objects.contacts.write

Send this to your assistant

Create a ClickRuntime automation: when someone messages our WhatsApp number, reply to find out their name, what they need and their budget, create or update them in HubSpot with a lead score, and post hot leads to #sales.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A kitchen fitter puts its WhatsApp number on every van and flyer. Messages arrive at all hours: "how much for a small kitchen?", "do you cover Leeds?", a photo of a ceiling. Whoever is free replies when they can, and nothing gets into HubSpot, so the next morning nobody knows which chats were serious.

This automation answers each message straight away, asks for whatever it still needs to know, and keeps a HubSpot contact up to date as the chat goes on. When a lead looks ready to buy, sales hears about it in Slack.

What you get out of it

  • Instant first reply

    Every enquiry gets a helpful answer within seconds, even at 10 p.m., which keeps people from messaging the next company on their list.

  • HubSpot fills itself in

    Name, need and budget are saved on the contact as they come up in the chat, so nobody has to copy a conversation into the CRM.

  • Sales sees only the good ones

    A lead is posted to #sales once, when its score reaches 8 out of 10, rather than for every message.

  • Conversations carry on naturally

    The automation remembers the last few messages from each person, so it doesn't ask the same question twice.

How it works

What happens, step by step

  1. Someone sends a message to your WhatsApp Business number.

  2. AI reads the conversation so far, notes their name, need and budget, and scores the lead from 1 to 10.

  3. It replies on WhatsApp, asking for anything still missing.

  4. The contact is created or updated in HubSpot, matched by phone number.

  5. The first time a lead scores 8 or more, it's posted to #sales.

Before it runs live

  • Connect HubSpot
  • Connect WhatsApp Business
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Qualify WhatsApp enquiries into HubSpotjust nowSucceeded
Slack · #salesHot WhatsApp lead (9/10): Jamie Clarke Need: full kitchen refit, 4m run, start in April | Budget: around £15k

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other HubSpot and WhatsApp Business steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
qualify_inbound_whatsapp_leads_into_hubspot.pyexample
from clickruntime import on_event, credentials, http, state, ai, notify
API = "https://api.hubapi.com/crm/v3/objects/contacts"
WA = "https://graph.facebook.com/v21.0/123456789012345/messages"  # your phone number ID
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ["name", "need", "budget", "reply"]} | {
          "score": {"type": "integer"}}, "required": ["name", "need", "budget", "score", "reply"]}
@on_event
def handle(event):
    value = event.json["entry"][0]["changes"][0]["value"]
    if "messages" not in value:
        return {"skipped": "status update"}
    sender = (msg := value["messages"][0])["from"]
    chat = (state.get(f"chat:{sender}") or []) + [f"Customer: {msg.get('text', {}).get('body', '')}"]
    out = ai.generate("\n".join(chat[-16:]), json_schema=SCHEMA, max_output_tokens=300, system=(
        "You qualify sales enquiries on WhatsApp. Fill in name, need and budget if known (else empty), "
        "score the lead 1-10, and write a short friendly reply asking for whatever is still missing.")).json
    http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"}, json={
        "messaging_product": "whatsapp", "to": sender, "type": "text", "text": {"body": out["reply"]}}).raise_for_status()
    state.set(f"chat:{sender}", (chat + [f"Us: {out['reply']}"])[-16:])
    headers = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}
    props = {"phone": f"+{sender}", "firstname": out["name"],
             "message": f"Need: {out['need']}\nBudget: {out['budget']}\nAI score: {out['score']}/10"}
    found = http.post(f"{API}/search", headers=headers, json={"filterGroups": [{"filters": [
        {"propertyName": "phone", "operator": "EQ", "value": f"+{sender}"}]}]}).json()["results"]
    url, call = (f"{API}/{found[0]['id']}", http.patch) if found else (API, http.post)
    call(url, headers=headers, json={"properties": props}).raise_for_status()
    if out["score"] >= 8 and not state.get(f"alerted:{sender}"):
        notify.slack(f"Hot WhatsApp lead ({out['score']}/10): {out['name'] or '+' + sender}\n"
                     f"Need: {out['need']} | Budget: {out['budget']}", channel="#sales")
        state.set(f"alerted:{sender}", True)
    return {"score": out["score"], "contact_existed": bool(found)}

FAQ

Common questions

What questions does it ask?
By default it works out the person's name, what they need and their budget, asking only for what's still missing. You can change the questions to suit your business, for example postcode or project date.
Can a person take over the chat?
Yes. Your team can reply from WhatsApp as usual. If you'd rather the automation stop replying once someone has joined in, ask your AI assistant for a version with a hand-off keyword.
Where is the lead score kept?
On the HubSpot contact, in the message field alongside the need and budget. You can ask for it to be written to a custom score property instead.
What permissions does it need?
whatsapp_business_messaging; crm.objects.contacts.write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Qualify WhatsApp enquiries into HubSpot” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.