Skip to content

The moment it happens

Score inbound leads, add them to HubSpot and log them in a sheet

Each form lead is scored, created in HubSpot with that score, added to your Leads sheet, and the hot ones are posted to Slack.

Runs
The moment it happens
Apps
Google Sheets, HubSpot
AI
Optional
Access
HubSpot contacts write; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: give me a link my form can send leads to. Score each one, create the HubSpot contact with the score, add a row to my 'Leads' sheet and post the hot ones to Slack.

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 growing company runs several lead sources at once: the website form, an ad campaign's lead form and a landing page for an event. Sales wants every lead in HubSpot with a sense of how good it is, marketing wants a simple running log it can slice in a sheet, and the hot ones need a person on them today.

This takes each lead as it arrives, gives it a score using your rules or AI, creates the HubSpot contact with that score, adds a row to your Leads sheet and posts the best ones to Slack. One submission, three places updated, nothing typed by hand.

What you get out of it

  • Every lead has a score in HubSpot

    Reps can sort and filter by score rather than reading every message.

  • Marketing gets a clean log

    The sheet holds every lead with source, score and date, ready for pivot tables.

  • Hot leads get attention today

    Leads above your threshold are posted to Slack the moment they arrive.

  • Works with rules or AI

    Score on fixed rules such as company size and budget, or let AI read the message, with rules as the fallback.

How it works

What happens, step by step

  1. When a lead is submitted, ClickRuntime receives the details straight away.

  2. It gives the lead a score from 1 to 10, using AI on the message or your own rules.

  3. It creates or updates the contact in HubSpot with the score, and adds a row to your Leads sheet.

  4. Leads scoring 8 or above are posted to your Slack sales channel.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect HubSpot
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Score inbound leads, add them to HubSpot and log them in a sheetjust nowSucceeded
Slack · #salesHot lead (9/10): Dana Kim at Adventure Works <dana@adventureworks.example> Added to HubSpot and your Leads sheet.

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 Google Sheets and 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.
qualify_inbound_leads_into_hubspot_with_a_sheet_log.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import datetime, timezone
from clickruntime import on_event, credentials, http, ai, notify
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
def hs(method, path, **kw):
    r = http.request(method, f"https://api.hubapi.com{path}", headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}, **kw)
    return r.raise_for_status() or (r.json() if r.content else {})
def rule_score(lead):
    return 3 + (3 if "@gmail." not in lead["email"] else 0) + (4 if int(lead.get("team_size") or 0) >= 50 else 0)

@on_event
def handle(event):
    lead = event.json or {}
    if not lead.get("email"):
        return {"skipped": "no email"}
    try:
        score = int(ai.generate(f"Score this B2B lead 1-10 for fit and intent. Reply with a number only.\n{str(lead)[:1500]}", max_output_tokens=5).text.strip())
    except (ai.AIError, ValueError):
        score = rule_score(lead)
    c = hs("POST", "/crm/v3/objects/contacts/batch/upsert", json={"inputs": [{"idProperty": "email", "id": lead["email"],
           "properties": {"email": lead["email"], "firstname": lead.get("name", ""), "company": lead.get("company", ""), "lead_score": str(score)}}]})["results"][0]
    row = [datetime.now(timezone.utc).date().isoformat(), lead.get("name"), lead["email"], lead.get("company"), lead.get("source"), score, c["id"]]
    build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values().append(
        spreadsheetId=SHEET_ID, range="Leads!A1", valueInputOption="RAW", body={"values": [row]}).execute()
    if score >= 8:
        notify.slack(f"Hot lead ({score}/10): {lead.get('name')} at {lead.get('company')} <{lead['email']}>", channel="#sales")
    return {"score": score, "contact": c["id"]}

FAQ

Common questions

How is the score worked out?
Either with your rules, for example points for a business email, team size and budget, or with AI reading the message and company details. If AI isn't available the rules are used.
Which lead forms can send to it?
Any form or tool that can send its submissions to a web link, such as your website form, Typeform or an ads lead form through its integration.
What goes into the sheet?
One row per lead with the date, name, email, company, source, score and the HubSpot contact ID.
What permissions does it need?
HubSpot contacts write; Sheets edit. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in 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 “Score inbound leads, add them to HubSpot and log them in a sheet” from your assistant

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