Every hour
Enrich 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.
- Runs
- Every hour
- Apps
- Google Sheets, HubSpot
- AI
- Yes, uses the built-in AI allowance
- Access
- Sheets edit; HubSpot crm.objects.companies/contacts.read+write
Send this to your assistant
Create a ClickRuntime automation: every hour, take new companies from my 'Enrich' sheet, research each one from its website, create or update it in HubSpot with industry, size and a short summary, and mark the row done.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A sales team builds target lists in a Google Sheet: a company name and website, collected from events, directories or a colleague's list. Before anyone can prioritise, each company needs an industry, a rough size and a line on what they do, and filling that in by hand for 200 rows is a week of tab-switching.
This takes each new row, reads the company's website, has AI write the industry, size band and a short summary, and puts the company into HubSpot with those details. The row is marked done with a link back, so the sheet shows exactly what has been processed.
What you get out of it
Target lists become usable CRM records
Each company arrives in HubSpot with the fields your team filters on, not just a name.
No duplicates in HubSpot
Companies are matched by website domain, so existing records are updated instead of copied.
The sheet shows progress
Each processed row is marked done with the HubSpot ID, so you can see what's left at a glance.
Research happens while you work on something else
New rows are picked up every hour, so adding twenty companies before lunch means they're ready by the afternoon.
How it works
What happens, step by step
Every hour, ClickRuntime reads your Enrich sheet and picks out rows without a status.
For each company it reads the website and AI writes the industry, size band and a short summary.
It looks for the company in HubSpot by website domain, then updates it or creates a new one.
The row is marked done with the HubSpot ID, so it isn't processed again.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect HubSpot
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 bs4 import BeautifulSoup
from clickruntime import on_trigger, credentials, http, ai, report_fetched
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
SCHEMA = {"type": "object", "properties": {"industry": {"type": "string"}, "size": {"type": "string"}, "summary": {"type": "string"}}, "required": ["industry", "size", "summary"]}
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 sheets():
return build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values()
@on_trigger
def run(event):
rows = sheets().get(spreadsheetId=SHEET_ID, range="Enrich!A2:C").execute().get("values", [])
todo = [(i + 2, r) for i, r in enumerate(rows) if len(r) >= 2 and len(r) < 3]
report_fetched(len(todo))
if not todo:
return {"enriched": 0}
for row, (name, site) in todo[:20]:
domain = site.replace("https://", "").replace("http://", "").strip("/")
text = BeautifulSoup(http.get(f"https://{domain}").text, "html.parser").get_text(" ", strip=True)[:3000]
info = ai.generate(f"Company {name}. Website text:\n{text}\nGive industry, size band and a 2-sentence summary.", json_schema=SCHEMA, max_output_tokens=200).json
props = {"name": name, "domain": domain, "industry_note": info["industry"], "size_band": info["size"], "description": info["summary"]}
hit = hs("POST", "/crm/v3/objects/companies/search", json={"filterGroups": [{"filters": [{"propertyName": "domain", "operator": "EQ", "value": domain}]}]})["results"]
cid = hs("PATCH", f"/crm/v3/objects/companies/{hit[0]['id']}", json={"properties": props})["id"] if hit else hs("POST", "/crm/v3/objects/companies", json={"properties": props})["id"]
sheets().update(spreadsheetId=SHEET_ID, range=f"Enrich!C{row}", valueInputOption="RAW", body={"values": [[f"done {cid}"]]}).execute()
return {"enriched": min(len(todo), 20)}FAQ
Common questions
Where does the information come from?
What do I need in the sheet?
What if the website can't be read?
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
Sync leads from a Google Sheet into HubSpot
New rows in your Leads sheet become HubSpot contacts within 15 minutes, without duplicates, and each row gets its HubSpot ID.
See how it worksLog new HubSpot form submissions to Google Sheets
Each new submission to a HubSpot form becomes a row in a Google Sheets tab, one column per form field, with the page it came from.
See how it worksFlag stalled HubSpot deals with a suggested follow-up
Each weekday, deals that have gone quiet for two weeks are listed in your Stalled deals sheet with a suggested follow-up, and owners get a Slack nudge.
See how it worksKeep exploring
Set up “Enrich companies from a sheet and update HubSpot” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.