Skip to content

Every 15 minutes

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.

Runs
Every 15 minutes
Apps
Google Sheets, HubSpot
AI
Not needed
Access
Sheets edit; HubSpot contacts write

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, create or update HubSpot contacts from new rows in my 'Leads' sheet, matching on email, and write the HubSpot ID back to the row.

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

Leads often start life in a spreadsheet: an event team typing badge scans, a partner sharing a list, or an assistant collecting enquiries from phone calls. Someone then has to import the sheet into HubSpot, and doing it every few days means duplicates, missed rows and a CRM that's always a bit behind.

This keeps the sheet and HubSpot in step. Anyone can keep adding rows as they normally would, and every new row turns into a HubSpot contact with the ID written back, so it's obvious which rows are synced.

What you get out of it

  • People keep working in the sheet

    Event staff or partners don't need HubSpot access; they just fill in rows.

  • No duplicate contacts

    Each row is matched by email, so existing contacts are updated rather than created twice.

  • You can see what's synced

    The HubSpot ID in each row shows at a glance which leads made it into the CRM.

  • Fast enough to act on

    New rows appear in HubSpot within 15 minutes, so follow-up can start the same day.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime reads your Leads sheet and picks out rows without a HubSpot ID.

  2. It sends those rows to HubSpot in one batch, matching existing contacts by email.

  3. New people become contacts and existing ones are updated with the row's details.

  4. Each contact's HubSpot ID is written back to its row, so it isn't sent again.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect HubSpot

What you get

RunsEvery 15 minutes
Sync leads from a Google Sheet into HubSpottoday, 9:00Succeeded
Google Sheets · LeadsRow 214: jo.evans@fabrikam.example, Jo Evans, Fabrikam: HubSpot ID 90311457

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • 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.
sync_leads_from_a_sheet_into_hubspot_contacts.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, report_fetched

SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"

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="Leads!A2:E").execute().get("values", [])
    todo = [(i + 2, r + [""] * (5 - len(r))) for i, r in enumerate(rows) if r and "@" in r[0] and (len(r) < 5 or not r[4])][:100]
    report_fetched(len(todo))
    if not todo:
        return {"synced": 0}
    inputs = [{"idProperty": "email", "id": r[0].strip().lower(), "properties": {"email": r[0].strip().lower(), "firstname": r[1], "lastname": r[2], "company": r[3]}} for _, r in todo]
    resp = http.post("https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert", json={"inputs": inputs},
                     headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"})
    resp.raise_for_status()
    ids = {c["properties"]["email"]: c["id"] for c in resp.json()["results"]}
    data = [{"range": f"Leads!E{row}", "values": [[ids.get(r[0].strip().lower(), "")]]} for row, r in todo]
    sheets().batchUpdate(spreadsheetId=SHEET_ID, body={"valueInputOption": "RAW", "data": data}).execute()
    return {"synced": len(ids)}

FAQ

Common questions

What columns does my sheet need?
An email column is required. First name, last name, company and phone are used if present, and one empty column holds the HubSpot ID.
What if a row has no email?
It is skipped and left without an ID, so you can see it needs fixing. Once an email is added, it is picked up on the next run.
Does editing a row later update HubSpot?
Only rows without a HubSpot ID are sent. To push a change, clear the ID cell and the row is synced again on the next run.
What permissions does it need?
Sheets edit; HubSpot contacts write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 “Sync leads from a Google Sheet into HubSpot” from your assistant

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