Skip to content

The moment it happens

Answer Messenger questions and hand off to you

People who message your Page get an answer from your FAQ straight away, and you're emailed when someone needs a person.

Runs
The moment it happens
Apps
Facebook Pages
AI
Yes, uses the built-in AI allowance
Access
pages_messaging

Send this to your assistant

Create a ClickRuntime automation: when someone messages my Facebook Page, answer from my FAQ about opening hours, delivery and returns. If they ask for a person or sound upset, email me the conversation and stop replying to them.

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 message a business Page on Messenger at all hours, and they expect an answer in minutes. A salon gets asked whether Saturday has a free slot at 9 p.m., a shop gets asked where a parcel is, and nobody is awake to reply. Slow answers send people to the next Page in their search, but a bot that keeps answering when the customer is angry or asking for a refund makes things worse.

When a message arrives, Facebook calls ClickRuntime's webhook, which verifies the request, reads the recent conversation history for that person, and uses ClickRuntime's built-in AI to write a reply that is sent straight away. If the AI decides a human is needed, it emails you and pauses the bot for that one customer.

Small businesses with no night staff get the most from it, because the pause means a person takes over cleanly.

What you get out of it

  • Answer customers outside office hours

    A shopper who messages at 10 p.m. gets a reply in seconds instead of finding nothing until morning. That is often the difference between a booked appointment and a customer who went elsewhere.

  • Hand off before things go wrong

    Refund demands and angry messages trigger an email and silence the bot for that person. The customer is never left arguing with software, and you start with the full conversation in front of you.

  • Stop repeating the same answers

    Opening times, delivery areas and sizing come up all day. Letting the AI cover them frees the owner or support person for conversations that need judgment, such as custom orders and complaints.

  • Keep context across messages

    Replies use the recent history for each person, so the bot does not ask for the order number twice. Customers feel followed rather than processed, which reduces abandoned chats. That continuity is what separates a helpful assistant from an irritating one.

  • Control which customers get the bot

    Pausing per user means one escalated customer does not switch off replies for everyone else. You can resume the bot for that person once the matter is resolved. Each customer's status is tracked separately.

How it works

What happens, step by step

  1. When someone messages your Facebook Page, Messenger passes the message to ClickRuntime straight away.

  2. AI reads it along with the last few messages in the conversation and answers using only your FAQ, such as opening hours, delivery and returns.

  3. The answer is sent back to them in Messenger.

  4. If they ask for a person or sound upset, the automation stops replying to them and emails you the conversation so you can take over.

Before it runs live

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

What you get

RunsThe moment it happens
Answer Messenger questions and hand off to youjust nowSucceeded
Messenger · ReplyWe're open Mon-Sat 9am-6pm, and delivery is free over $50. Anything else?

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 Facebook Pages 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_messenger_replies_with_hand_off.pyexample
from clickruntime import on_event, credentials, http, state, ai, notify

G = "https://graph.facebook.com/v21.0"
PAGE_ID = "104857600000000"

def page_token():
    user = credentials.connection("facebook", "work")
    return http.get(f"{G}/{PAGE_ID}", params={"fields": "access_token", "access_token": user}).json()["access_token"]

FAQ = "Open Mon-Sat 9am-6pm. Delivery 2-4 days, free over $50. Returns within 30 days with receipt."
SCHEMA = {"type": "object", "properties": {"handoff": {"type": "boolean"}, "reply": {"type": "string"}},
          "required": ["handoff", "reply"]}

@on_event
def handle(event):
    for entry in event.json.get("entry", []):
        for m in entry.get("messaging", []):
            if "message" not in m or m["message"].get("is_echo"):
                continue
            user, text = m["sender"]["id"], m["message"].get("text", "")
            if state.get(f"paused:{user}"):
                continue
            history = (state.get(f"history:{user}") or [])[-6:] + [f"Customer: {text}"]
            r = ai.generate(f"FAQ: {FAQ}\nConversation:\n" + "\n".join(history) +
                            "\nAnswer from the FAQ only. Set handoff=true if they ask for a person or sound upset.",
                            json_schema=SCHEMA, max_output_tokens=200).json
            if r["handoff"]:
                state.set(f"paused:{user}", True)
                notify.email_me("Messenger customer needs you", "\n".join(history))
                continue
            http.post(f"{G}/{PAGE_ID}/messages", json={"recipient": {"id": user}, "messaging_type": "RESPONSE",
                      "message": {"text": r["reply"]}}, params={"access_token": page_token()}).raise_for_status()
            state.set(f"history:{user}", history + [f"Us: {r['reply']}"])
    return {"ok": True}

FAQ

Common questions

Does the bot tell customers it is automated?
That is your choice. The wording of the replies is set in the instructions the AI follows, so you can have it introduce itself as an assistant, or stay neutral. Many Pages state it plainly in the first message.
What makes it hand a conversation to a person?
You list the triggers, such as refund requests, legal threats, anger or anything it cannot answer from the facts you gave it. When one fires, you receive an email with the thread and the bot stays silent for that person.
Is there a limit on when Messenger lets a Page reply?
Facebook generally allows a Page to reply to a person within 24 hours of their last message. The bot follows that window, so replies to recent conversations work, while contacting someone after a long gap is not possible.
What permissions does it need?
pages_messaging. 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 Messenger questions and hand off to you” from your assistant

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