Skip to content

The moment it happens

Add form leads to HubSpot and email the good ones

Every form lead lands in HubSpot, the promising ones get a personal email from your Gmail within minutes, and you hear about it.

Runs
The moment it happens
Apps
Gmail, HubSpot
AI
Optional
Access
HubSpot contacts write; Gmail gmail.send

Send this to your assistant

Create a ClickRuntime automation: give me a link my website form can send to. Create or update each lead in HubSpot, and if they look like a good fit, email them from my Gmail and let me know.

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 small agency or software team gets a handful of enquiries a day through its website form. Each one should be in HubSpot and each good one deserves a quick, personal reply, but the founder is in meetings and the form notifications pile up. By the time someone answers, the prospect has already booked a call with someone else.

This puts every lead into HubSpot the moment it arrives and sends the promising ones a short note from your own address, so the first reply happens in minutes, not hours, and nobody has to retype details into the CRM.

What you get out of it

  • Leads hear back while they are still interested

    A good-fit lead gets an email from you a minute after submitting the form, while they are still at their desk thinking about the problem.

  • HubSpot is always complete

    Every submission becomes or updates a contact, so nothing lives only in an inbox and reports on lead volume are accurate.

  • Poor fits don't get a sales email

    Students, vendors and spam still go into HubSpot, but only qualified leads get the follow-up, so your outreach stays relevant.

  • You stay in the loop

    You get a short email for each qualified lead with who they are, so you can pick up the conversation yourself.

How it works

What happens, step by step

  1. When someone submits your website form, ClickRuntime receives their details straight away.

  2. It creates the person in HubSpot, or updates them if a contact with that email already exists.

  3. It checks whether they are a good fit using your rules, or with AI reading their message if you prefer.

  4. Good-fit leads get a short email from your Gmail address, and you get an email saying who they are.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect HubSpot
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Add form leads to HubSpot and email the good onesjust nowSucceeded
Email · Qualified leadQualified lead: Northwind Logistics Sam Patel <sam@northwind.example>, team of 40, was sent your follow-up email.

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 Gmail 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.
form_leads_into_hubspot_with_gmail_follow_up.pyexample
import base64
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, notify

def gmail():
    return build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)

def send(g, to, subject, body):
    msg = EmailMessage(); msg["To"] = to; msg["Subject"] = subject; msg.set_content(body)
    g.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()

@on_event
def handle(event):
    lead = event.json or {}
    email = (lead.get("email") or "").strip().lower()
    if not email:
        return {"skipped": "no email"}
    props = {"email": email, "firstname": lead.get("name", ""), "company": lead.get("company", "")}
    r = http.post("https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert",
                  headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"},
                  json={"inputs": [{"idProperty": "email", "id": email, "properties": props}]})
    r.raise_for_status()
    qualified = "@gmail." not in email and int(lead.get("team_size") or 0) >= 10
    if qualified:
        send(gmail(), email, "Thanks for getting in touch",
             f"Hi {props['firstname'] or 'there'},\n\nThanks for your enquiry. When suits you for a quick call this week?")
        notify.email_me(f"Qualified lead: {props['company']}", f"{props['firstname']} <{email}> was emailed.")
    return {"qualified": qualified}

FAQ

Common questions

How does it decide who is a good fit?
You set the rules, such as a business email domain, a minimum team size or a particular service picked on the form. If you prefer, AI can read the message and judge it instead, falling back to your rules when AI isn't available.
What does the follow-up email say?
You write the template, with the person's first name and company filled in. It comes from your Gmail address, so replies go straight to you.
What happens if the same person fills in the form twice?
Their HubSpot contact is matched by email and updated with the new details. You can choose whether they get the follow-up again or only the first time.
What permissions does it need?
HubSpot contacts write; Gmail gmail.send. 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 “Add form leads to HubSpot and email the good ones” from your assistant

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