Skip to content

The moment it happens

Reply to new leads by text and email within seconds

Every new lead, from a form, a missed call or a voicemail, gets a text and an email within seconds, and you're told about it.

Runs
The moment it happens
Apps
Gmail, Twilio
AI
Optional
Access
Twilio account SID/token; gmail.send

Send this to your assistant

Create a ClickRuntime automation: when a new lead comes in from my form or a missed call, text them and email them a short personal reply from my Gmail, and email me a heads-up.

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 come in from all directions: web forms, calls you couldn't take, voicemails. Each one is someone ready to talk right now, and every hour without a reply makes a sale less likely.

Replying within seconds by both text and email reaches the lead however they prefer, and a heads-up to you means you can follow up personally as soon as you're free.

What you get out of it

  • Seconds, not hours

    Every lead hears from you almost immediately.

  • Reach them both ways

    A text gets noticed; an email holds the detail and your signature.

  • Every source covered

    Form leads and missed calls get the same quick reply.

  • You're in the loop

    A heads-up email tells you who to call next.

How it works

What happens, step by step

  1. A new lead arrives from your form, or Twilio reports a missed call.

  2. Leads already contacted this week are skipped.

  3. A short reply is written, optionally personalised by AI from their message.

  4. The lead gets a text and an email from your Gmail, and you get a heads-up 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 Twilio
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Reply to new leads by text and email within secondsjust nowSucceeded
SMS · LeadHi Jordan, thanks for asking about rewiring your kitchen. We'll call you within the hour to book a visit.

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 Twilio 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.
instant_reply_to_new_leads_by_sms_and_email.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
import base64, time
from clickruntime import on_event, credentials, http, state, ai, notify

FROM = "+15005550006"

def sms(to, body):
    return Client(credentials.secret("TWILIO_ACCOUNT_SID"), credentials.secret("TWILIO_AUTH_TOKEN")).messages.create(to=to, from_=FROM, body=body)
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()

def send_email(to, subject, text):
    gmail().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()}).execute()

@on_event
def handle(event):
    f = event.json or {}
    phone = f.get("phone") or (f.get("From") if f.get("CallStatus") in ("no-answer", "busy") else None)
    email, name = f.get("email"), f.get("name", "there")
    key = f"lead:{phone or email}"
    if not (phone or email) or time.time() - (state.get(key) or 0) < 7 * 86400:
        return {"skipped": True}
    text = f"Hi {name}, thanks for getting in touch with Northwind Electrical. We'll call you shortly."
    if f.get("message"):
        text = ai.generate(f["message"][:800], system=f"Write a 2-sentence friendly reply to {name} from Northwind Electrical.", max_output_tokens=80).text.strip()
    if phone: sms(phone, text)
    if email: send_email(email, "Thanks for getting in touch", text)
    notify.email_me(f"New lead: {name}", f"Phone: {phone}\nEmail: {email}\n{f.get('message', '')}")
    state.set(key, time.time())
    return {"lead": phone or email}

FAQ

Common questions

Can AI personalise the message?
Optionally. It can write a line responding to what the lead asked; otherwise a standard message is used.
What if there's no email address?
Missed callers only get a text. Form leads with no phone only get an email.
Will leads be contacted twice?
No. Each phone number or email is remembered for a week.
What permissions does it need?
Twilio account SID/token; 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 “Reply to new leads by text and email within seconds” from your assistant

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