The moment it happens
Score new leads and assign them to a rep from your Airtable team table
Each inbound lead is scored by AI and created in HubSpot with the right owner, chosen from your Airtable sales team table.
- Runs
- The moment it happens
- Apps
- Airtable, HubSpot
- AI
- Yes, uses the built-in AI allowance
- Access
- crm.objects.contacts.write; Airtable read/write
Send this to your assistant
Create a ClickRuntime automation: give me a link my lead form can send to. Score each lead with AI, pick the owner from my Airtable 'Sales team' table based on region and deal size, create the contact in HubSpot with that owner, and log it in Airtable.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A sales team splits leads by region and deal size, with a sales manager keeping the roster in Airtable: who covers EMEA, who takes enterprise, who's on holiday this week. Every new lead waits until the manager reads it, works out who should have it and assigns it in HubSpot, which can take half a day.
This scores each lead as it arrives, reads the current roster from Airtable to find the right rep, and creates the HubSpot contact already assigned to them. The manager changes the routing by editing the Airtable table, with no change to the automation.
What you get out of it
Leads reach the right rep in seconds
The owner is set in HubSpot as the lead is created, so the rep sees it straight away.
Routing rules live in a table you already edit
Change who covers a region or mark someone away in Airtable, and the next lead follows the new rules.
Each lead arrives with a score
AI rates fit and intent from the message, so reps know which to call first.
An audit trail of every assignment
Each lead is logged in Airtable with the score and assigned rep, so you can check fairness and response times.
How it works
What happens, step by step
When someone submits your lead form, ClickRuntime receives their details straight away.
AI reads the lead and gives it a score and an estimated deal size.
It reads your Airtable sales team table and picks the active rep who covers that region and size with the fewest recent leads.
The contact is created in HubSpot with that rep as owner, and the lead is logged in Airtable.
Before it runs live
- Connect Airtable
- 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 Airtable and HubSpot steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, http, ai, state
BASE_ID = "appXXXXXXXXXXXXXX"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "size": {"type": "string", "enum": ["SMB", "Mid-market", "Enterprise"]}}, "required": ["score", "size"]}
def at(method, path="", **kw):
r = http.request(method, f"https://api.airtable.com/v0/{BASE_ID}/{path}", headers={"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}, **kw)
return r.raise_for_status() or r.json()
@on_event
def handle(event):
lead = event.json or {}
if not lead.get("email"):
return {"skipped": "no email"}
res = ai.generate(f"Score this lead 1-10 and estimate its size.\n{str(lead)[:1500]}", json_schema=SCHEMA, max_output_tokens=60).json
region = lead.get("region", "EMEA")
reps = at("GET", "Sales team", params={"filterByFormula": f"AND({{Active}}, {{Region}} = '{region}', FIND('{res['size']}', ARRAYJOIN({{Sizes}})))"})["records"]
counts = state.get("counts") or {}
rep = min(reps, key=lambda r: counts.get(r["id"], 0)) if reps else None
props = {"email": lead["email"], "firstname": lead.get("name", ""), "company": lead.get("company", ""), "lead_score": str(res["score"])}
if rep:
props["hubspot_owner_id"] = rep["fields"]["HubSpot owner ID"]
counts[rep["id"]] = counts.get(rep["id"], 0) + 1
state.set("counts", counts)
r = http.post("https://api.hubapi.com/crm/v3/objects/contacts", json={"properties": props},
headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"})
r.raise_for_status()
at("POST", "Lead log", json={"records": [{"fields": {"Email": lead["email"], "Score": res["score"], "Size": res["size"],
"Rep": rep["fields"]["Name"] if rep else "Unassigned", "HubSpot ID": r.json()["id"]}}]})
return {"score": res["score"], "rep": rep["fields"]["Name"] if rep else None}FAQ
Common questions
What does the Airtable team table need?
How is the rep chosen when several match?
What does the AI look at?
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
Turn people in your Airtable engagement table into HubSpot contacts
People added to your Airtable engagement table, such as those who comment on your LinkedIn posts, become HubSpot contacts and are marked as synced.
See how it worksCopy new HubSpot deals into Airtable
Every new HubSpot deal appears in your Airtable Deals table within 15 minutes, with a heads-up in Slack.
See how it worksStart an Airtable onboarding record when a HubSpot deal is won
When a deal is won, an onboarding record is created in your Airtable tracker and the contact becomes a Customer in HubSpot.
See how it worksKeep exploring
Set up “Score new leads and assign them to a rep from your Airtable team table” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.