Skip to content

Every 15 minutes

Score new leads in a sheet and email the best ones

Each new lead in your sheet gets a score and a reason, and you get an email with a suggested first message for any strong one.

Runs
Every 15 minutes
Apps
Gmail, Google Sheets
AI
Yes, uses the built-in AI allowance
Access
Sheets read+write; Gmail gmail.send

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, score new rows in my Leads sheet against my ideal customer, write the score and reason back, and email me any lead above 80 with a suggested first email.

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 consultant collects enquiries from her website form into a Google Sheet. Some are ideal clients with budget and urgency, others are students or vendors pitching their own services. She reads every row, decides who to contact, and often replies to the best ones a day later than she should.

Scoring each row as it lands and emailing only the strongest leads means you reply to the right people first, with a draft already written. Consultants, agencies and small sales teams use it to respond quickly without reading every enquiry.

What you get out of it

  • The best leads get an answer the same day

    An email within minutes for leads above your bar means you can write back while the prospect is still comparing options.

  • A first email ready to send

    Each alert includes a suggested opening message based on what the lead wrote. You edit and send instead of starting from a blank page.

  • Every lead scored the same way

    Scores follow one description of your ideal client, so judgement does not drift with how busy the day is.

  • The sheet becomes a ranked list

    A score and reason on every row lets you sort the sheet and work through the remaining leads in order.

How it works

What happens, step by step

  1. Every 15 minutes ClickRuntime reads your Leads sheet and finds rows without a score.

  2. AI compares each lead with your description of an ideal customer and gives it a score from 0 to 100 and a reason.

  3. The score and reason are written back into the row, so it is not scored twice.

  4. For any lead above 80, you get an email with the lead's details and a suggested first email.

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 your Google Sheets account and pick the spreadsheets it may use

What you get

RunsEvery 15 minutes
Score new leads in a sheet and email the best onestoday, 9:00Succeeded
Email · Hot lead (88)Acme Analytics, 60 staff, wants help with a product launch in January. Suggested first email included.

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 Google Sheets 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.
score_inbound_leads_in_a_sheet_and_email_the_hot_ones.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, notify, ai, report_fetched

SHEET_ID = "your-spreadsheet-id"
ICP = "Marketing teams at B2B companies with 10-200 staff and a budget over 5,000 a month."
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}, "first_email": {"type": "string"}}}

@on_trigger
def run(event):
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    rows = sheets.values().get(spreadsheetId=SHEET_ID, range="Leads!A2:G").execute().get("values", [])
    new = [(i + 2, r) for i, r in enumerate(rows) if len(r) < 6 or not r[5]]
    report_fetched(len(new))
    if not new:
        return {"summary": "Nothing new"}
    for row_no, r in new:
        lead = ", ".join(r[:5])
        res = ai.generate(f"Ideal customer: {ICP}\nLead: {lead}\nScore 0-100, give a reason and a short first email.", json_schema=SCHEMA, max_output_tokens=400).json
        sheets.values().update(spreadsheetId=SHEET_ID, range=f"Leads!F{row_no}:G{row_no}", valueInputOption="RAW",
                               body={"values": [[res["score"], res["reason"]]]}).execute()
        if res["score"] > 80:
            notify.email_me(f"Hot lead ({res['score']}): {r[1] if len(r) > 1 else r[0]}", f"{lead}\n\nWhy: {res['reason']}\n\nSuggested email:\n{res['first_email']}")
    return {"scored": len(new)}

FAQ

Common questions

How does it know which rows are new?
It looks for rows with an empty score column. Once a row is scored it is never scored again, even if you edit other columns.
Which columns does it need?
Any columns your form fills, such as name, company, budget and message. You add two empty columns for the score and the reason.
Can I change the score that triggers an email?
Yes. 80 is a sensible starting point, but you can raise it to see fewer alerts or lower it to see more.
What permissions does it need?
Sheets read+write; Gmail gmail.send. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “Score new leads in a sheet and email the best ones” from your assistant

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