Skip to content

On a schedule

Score new HubSpot leads and flag the best ones

New contacts get a fit score saved on their record, and the strongest ones are sent to you in Slack.

Runs
On a schedule
Apps
HubSpot
AI
Yes, uses the built-in AI allowance
Access
crm.objects.contacts.read, crm.objects.contacts.write

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, score new HubSpot contacts from 1 to 10 on fit using job title, company and form answers. Save the score to the lead_score property and message me in Slack about anyone scoring 8 or more.

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

Marketing hands over forty new contacts a day, and sales treats them all the same: a student downloading a guide, a founder from a 200-person company asking for pricing, a competitor researching your site. Reps cherry-pick by gut feeling, so the best lead might wait until Thursday while someone chases a poor fit on Monday. In HubSpot the default lead score depends on rules somebody wrote two years ago and nobody has revisited.

On a schedule, newly created contacts are fetched, the built-in AI reads the details (job title, company, source, message) and produces a score. That score is written to a contact property, and contacts with high scores are announced in Slack so the right rep sees them immediately.

It suits B2B teams with a steady stream of form fills, where speed to the best leads makes the difference.

What you get out of it

  • The best leads are contacted first

    A high score puts a founder asking about pricing at the top of the list in minutes. Speed to lead is one of the strongest predictors of winning the deal, and this protects it.

  • Rep time goes where it pays

    Chasing poor fits is expensive. A visible score lets reps spend their first hour on the leads most likely to convert, not on whichever arrived last. Over a quarter, that discipline shows up as higher conversion from the same lead volume.

  • Scoring reflects the actual message

    A rules-based score ignores what someone wrote in the form. Reading the text means a contact who describes a clear need and a budget is scored above one who left it blank.

  • Scores are stored where you work

    Because the score is written to a contact property, you can build HubSpot lists, views and workflows on it, without a separate tool or export. That makes it easy to route high scorers to a specific rep or enroll low scorers in nurturing.

  • Marketing gets feedback on lead quality

    Seeing the proportion of high scores by source tells marketing which campaigns bring buyers and which bring noise, which guides budget decisions. Better budget decisions follow, since spend moves toward channels that deliver buyers and away from the rest.

How it works

What happens, step by step

  1. Every 15 minutes, the automation picks up new contacts in HubSpot.

  2. AI reads each contact's details, like job title and company, and gives them a fit score from 1 to 10.

  3. The score is saved on the contact's record in HubSpot.

  4. Contacts with a high score are posted to your Slack channel with a one-line reason, so you can reach out first.

Before it runs live

  • Connect HubSpot

What you get

RunsOn a schedule
Score new HubSpot leads and flag the best onestoday, 9:00Succeeded
Slack · #salesHot lead (9/10): Dana Ruiz, VP Operations at Northwind. 400-person logistics firm asking about annual pricing.

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 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.
ai_inbound_lead_scoring.pyexample
import time
from clickruntime import on_trigger, credentials, http, ai, state, notify, report_fetched

API = "https://api.hubapi.com/crm/v3/objects/contacts"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}}}

@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}
    since = state.get("since") or int((time.time() - 900) * 1000)
    contacts = http.post(f"{API}/search", headers=headers, json={"limit": 50,
        "properties": ["firstname", "lastname", "jobtitle", "company", "message"],
        "filterGroups": [{"filters": [{"propertyName": "createdate", "operator": "GT", "value": since}]}]}).json()["results"]
    report_fetched(len(contacts))
    if not contacts:
        return {"scored": 0}
    for c in contacts:
        p = c["properties"]
        out = ai.generate(f"Title: {p.get('jobtitle')}\nCompany: {p.get('company')}\nForm: {(p.get('message') or '')[:1000]}",
                          system="Score this B2B lead's fit from 1 to 10 with a one-line reason.",
                          json_schema=SCHEMA, max_output_tokens=60).json
        http.patch(f"{API}/{c['id']}", headers=headers, json={"properties": {"lead_score": out["score"]}}).raise_for_status()
        if out["score"] >= 8:
            notify.slack(f"Hot lead ({out['score']}/10): {p.get('firstname')} {p.get('lastname')}, "
                         f"{p.get('jobtitle')} at {p.get('company')}. {out['reason']}", channel="#sales")
    state.set("since", int(time.time() * 1000))
    return {"scored": len(contacts)}

FAQ

Common questions

Which property does the score go into?
A contact property you choose or create, such as ai_lead_score. Writing it to a custom property keeps your existing HubSpot lead score untouched, so you can compare the two before trusting either. Comparing both side by side is the safest way to start.
What counts as a high score?
You define the cutoff, for example 80 out of 100. Contacts at or above it are posted to Slack. Start with a number that surfaces roughly the top fifth of leads, then adjust once you see which ones turn into deals.
Does it score existing contacts or only new ones?
Only contacts created since the last run, so the database is not re-scored every time. If you want a one-off backfill of existing contacts, that can be requested separately and approved first. One-off backfills are a separate, deliberate job.
What permissions does it need?
crm.objects.contacts.read, 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 each time it checks. Checks that find nothing new and stop right away aren't counted.
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 “Score new HubSpot leads and flag the best ones” from your assistant

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