Skip to content

The moment it happens

Answer incoming texts with AI

Customers who text your number get a reply based on your FAQ, even when they send several messages in a row.

Runs
The moment it happens
Apps
Twilio
AI
Yes, uses the built-in AI allowance
Access
read+write

Send this to your assistant

Create a ClickRuntime automation: when someone texts my Twilio number, wait 10 seconds for any follow-up messages, then reply with an AI answer based on the FAQ below about our opening hours, pricing and service area.

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

Customers text a business number the way they would text a friend, and they expect an answer in minutes. A salon gets 'are you open Sunday?' at 9 pm, a plumber gets 'do you cover Kingston?' during a job, and nobody can reply until the next morning. By then the customer has called a competitor, and the business never knew the question was asked.

When a text or WhatsApp message arrives on your Twilio number, this waits briefly to gather any follow-up messages from the same sender, then asks an AI step to write a sensible reply using the conversation so far, and sends it back through Twilio. The customer gets an answer within seconds, day or night.

It suits small service businesses whose number receives many routine questions about hours, prices, areas covered and bookings.

What you get out of it

  • Questions answered at any hour

    A customer who texts at 9 pm gets a reply at 9 pm. Many buyers choose whoever responds first, so a quick reply to a simple question is often the difference between a booking and a lost lead.

  • Staff time goes to real conversations

    Routine questions about opening times or service areas no longer interrupt the person on a job. They only step in when a customer needs something the replies cannot handle, which is a better use of skilled hours.

  • Replies that follow the conversation

    The AI sees the earlier messages from the same sender, so it does not ask twice for a postcode or repeat itself. Customers get a coherent thread instead of a series of disconnected canned answers.

  • Messages grouped before replying

    People often send three short texts in a row. Waiting a moment to collect them means the reply answers everything at once, and the customer is not flooded with several separate responses to half a thought.

  • Works on both SMS and WhatsApp

    Twilio carries both channels, so customers can use whichever they prefer. You keep one number and one set of replies instead of separate processes for text messages and WhatsApp chats.

How it works

What happens, step by step

  1. When a customer texts your Twilio number, ClickRuntime picks it up straight away.

  2. If they send several messages in a row, it waits briefly and reads them together, along with your earlier conversation.

  3. AI writes a short reply using only the answers in your FAQ.

  4. The reply is texted back to the customer from your number.

Before it runs live

  • Connect Twilio
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Answer incoming texts with AIjust nowSucceeded
SMS · Customer conversationCustomer: how much is a call out? and are you open sat Northwind Plumbing: Call-out is $80. We're open weekdays 7–19, and our emergency line runs 24/7.

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 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.
ai_replies_to_incoming_texts.pyexample
import time
from clickruntime import on_event, credentials, http, state, ai

FAQ = "Northwind Plumbing. Call-out $80. Open 7–19 weekdays. Emergency line 24/7. Book at northwind.example/book"

@on_event
def handle(event):
    sms = event.json  # Twilio messaging webhook (form fields)
    sender = sms["From"]
    convo = state.get(f"sms:{sender}") or {"history": [], "last": 0}
    convo["history"].append(f"Customer: {sms['Body']}")
    if time.time() - convo["last"] < 20:  # several texts in a row: answer once
        state.set(f"sms:{sender}", convo)
        return {"buffered": True}
    reply = ai.generate("\n".join(convo["history"][-12:]), system=f"Reply by SMS (max 300 chars) using only: {FAQ}", max_output_tokens=120).text
    sid = credentials.secret("TWILIO_ACCOUNT_SID")
    http.post(f"https://api.twilio.com/2010-04-01/Accounts/{sid}/Messages.json",
              auth=(sid, credentials.secret("TWILIO_AUTH_TOKEN")), data={"To": sender, "From": sms["To"], "Body": reply})
    convo["history"].append(f"Us: {reply}")
    convo["last"] = time.time()
    state.set(f"sms:{sender}", convo)
    return {"replied": True}

FAQ

Common questions

Can the AI quote prices or confirm bookings?
It can only state what you put in its instructions, such as price ranges, opening hours and areas served. For anything it does not know, you can tell it to say someone will follow up, so it never invents an answer.
What if the customer asks for a human?
You can instruct the AI to hand over when it sees phrases like speak to someone or complaint. It then tells the customer a person will reply, and you can have it email you the thread so nobody is left waiting.
Will it reply to every text, including spam?
It replies to every inbound message unless you add rules. Common choices are to ignore messages containing links, to skip numbers on a block list, or to limit replies per sender so a spam loop cannot run up costs.
What permissions does it need?
read+write. 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 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 “Answer incoming texts with AI” from your assistant

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