Skip to content

The moment it happens

Welcome hot leads on WhatsApp the moment they sign up

New leads from your form are scored and saved in HubSpot, and the hot ones get a WhatsApp welcome straight away with a heads-up in #sales.

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

Send this to your assistant

Create a ClickRuntime automation: when my lead form sends a new lead, score it from 1 to 10, create the contact in HubSpot with the score, and if it's 8 or more send our WhatsApp welcome template and post it 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 language school runs ads for its intensive courses, and the form asks for a phone number. Leads who are asked about start dates within minutes book far more often than those who get a call the next day, but the admissions team can't watch the form all day.

This automation scores each new lead from what they wrote, saves it in HubSpot, and sends the promising ones a friendly WhatsApp welcome right away. Sales sees the lead in Slack and can pick up the conversation where WhatsApp left off.

What you get out of it

  • Speed where it counts

    Hot leads hear from you within seconds, while they're still looking at your site.

  • Cold leads aren't spammed

    Only leads scoring 8 or more get a WhatsApp message; the rest go into HubSpot for your normal nurture.

  • The score is on the contact

    Each new HubSpot contact carries its AI score, so you can build lists and reports from it.

  • Sales knows who was contacted

    The #sales post shows the score and a one-line reason, so whoever follows up has context.

How it works

What happens, step by step

  1. Your lead form sends each new sign-up to the automation's link.

  2. AI scores the lead from 1 to 10 from their company and message.

  3. A contact is created in HubSpot with the score.

  4. If the score is 8 or more, they get your WhatsApp welcome template and the lead is 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
Welcome hot leads on WhatsApp the moment they sign upjust nowSucceeded
Slack · #salesHot lead (9/10) sent a WhatsApp welcome: Priya Shah at Fabrikam Travel Wants a 4-week intensive for 6 staff starting next month.

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.
whatsapp_hot_leads_straight_from_new_hubspot_leads.pyexample
from clickruntime import on_event, credentials, http, ai, notify

API = "https://api.hubapi.com/crm/v3/objects"
PHONE_NUMBER_ID = "123456789012345"
WA = f"https://graph.facebook.com/v21.0/{PHONE_NUMBER_ID}/messages"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}},
          "required": ["score", "reason"]}

@on_event
def handle(event):
    lead = event.json or {}
    result = ai.generate(f"Score this lead 1-10 for buying intent and fit.\nCompany: {lead.get('company')}\n"
                         f"Message: {str(lead.get('message', ''))[:1500]}", json_schema=SCHEMA, max_output_tokens=100).json
    hot = result["score"] >= 8
    headers = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}
    contact = http.post(f"{API}/contacts", headers=headers, json={"properties": {
        "email": lead["email"], "firstname": lead.get("first_name", ""), "lastname": lead.get("last_name", ""),
        "company": lead.get("company", ""), "phone": lead.get("phone", ""),
        "ai_lead_score": result["score"], "hs_lead_status": "OPEN" if hot else "NEW"}}).json()
    if hot and lead.get("phone"):
        http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"}, json={
            "messaging_product": "whatsapp", "to": lead["phone"].lstrip("+"), "type": "template", "template": {
                "name": "welcome_hot_lead", "language": {"code": "en"}, "components": [{"type": "body",
                    "parameters": [{"type": "text", "text": lead.get("first_name") or "there"}]}]}}).raise_for_status()
        notify.slack(f"Hot lead ({result['score']}/10) sent a WhatsApp welcome: {lead.get('first_name')} {lead.get('last_name')}"
                     f" at {lead.get('company')}\n{result['reason']}", channel="#sales")
    return {"contact": contact.get("id"), "score": result["score"], "hot": hot}

FAQ

Common questions

What do I need in HubSpot?
A custom contact property for the score, called ai_lead_score, as a number. Create it once under Settings, Properties, before turning the automation on.
What does the welcome message say?
Whatever your approved WhatsApp template says. WhatsApp requires an approved template for the first message to someone, and the automation fills in their first name.
Does it need the phone number in a set format?
The number should include the country code, like +44 7700 900123. Ask your form to collect it that way, or ask your AI assistant to add a default country code.
What permissions does it need?
crm.objects.contacts.write; whatsapp_business_messaging. 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 “Welcome hot leads on WhatsApp the moment they sign up” from your assistant

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