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.
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
When a lead is submitted, ClickRuntime receives the details straight away.
It gives the lead a score from 1 to 10, using AI on the message or your own rules.
It creates or updates the contact in HubSpot with the score, and adds a row to your Leads sheet.
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
Build your own
Need it to work differently?
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
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?
Which lead forms can send to it?
What goes into the sheet?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Log a weekly HubSpot revenue forecast in a sheet
Every Monday your weighted pipeline forecast is added to your Forecast sheet and you get an email with the highlights.
See how it worksEnrich companies from a sheet and update HubSpot
Companies you add to your Enrich sheet are researched, created or updated in HubSpot with industry, size and a summary, and the row is marked done.
See how it worksTrack weekly HubSpot lifecycle numbers in a sheet
Every Monday a new row in your Pipeline metrics sheet shows how many contacts reached each lifecycle stage last week, split by source.
See how it worksKeep exploring
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.