The moment it happens
Answer Facebook comments and messages from your FAQ in Drive
Questions in comments and Messenger on your Page get a reply drawn from the FAQ documents you keep in Google Drive.
- Runs
- The moment it happens
- Apps
- Facebook Pages, Google Drive
- AI
- Yes, uses the built-in AI allowance
- Access
- pages_manage_engagement, pages_messaging; drive.readonly
Send this to your assistant
Create a ClickRuntime automation: when someone comments on my Facebook Page or sends a Messenger message, answer from my FAQ document in Drive if it covers the question, and leave it for me if it doesn't.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A holiday cottage company gets the same questions all day on Facebook: are dogs allowed, is there parking, what time is check-in. The answers are all in a Drive document, but someone still has to copy them into replies, often hours later.
Comments and messages are now answered within a minute from the FAQ document, in a friendly tone. Questions the document doesn't cover are left for the team, so nothing is made up.
What you get out of it
Instant answers
People get a reply while they're still deciding to book.
Answers from your own document
Replies only use what's in your FAQ, so they're accurate.
Update once, answer everywhere
Change the Drive document and the next reply uses the new answer.
Hard questions left for you
Anything not in the FAQ is passed over for a person to answer.
How it works
What happens, step by step
Facebook tells ClickRuntime about each new comment or message on your Page.
It loads your FAQ document from Drive, re-reading it at most once an hour.
AI checks whether the FAQ answers the question and, if it does, writes a short reply.
The reply is posted under the comment or sent in Messenger; questions it can't answer are left for you.
Before it runs live
- Connect Facebook Pages
- Connect Google Drive
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
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 and Google Drive steps into one automation
Under the hood
The code that runs this automation
import time
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, ai, state
FAQ_DOC, PAGE_ID, G = "faq-doc-id", "1234567890", "https://graph.facebook.com/v21.0"
@on_event
def handle(event):
entry = (event.json or {}).get("entry", [{}])[0]
change = (entry.get("changes") or [{}])[0].get("value", {})
msg = (entry.get("messaging") or [{}])[0]
text = change.get("message") or msg.get("message", {}).get("text")
if not text or change.get("from", {}).get("id") == PAGE_ID:
return {"skipped": True}
cache = state.get("faq") or {}
if time.time() - cache.get("at", 0) > 3600:
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
cache = {"at": time.time(), "text": drive.files().export(fileId=FAQ_DOC, mimeType="text/plain").execute().decode()[:15000]}
state.set("faq", cache)
r = ai.generate(f"FAQ:\n{cache['text']}\n\nQuestion: {text[:500]}\nReply briefly using only the FAQ, or say NONE.",
max_output_tokens=200).text.strip()
if r == "NONE":
return {"answered": False}
t = {"access_token": credentials.connection("facebook", "work")}
if change.get("comment_id"):
http.post(f"{G}/{change['comment_id']}/comments", data={**t, "message": r})
else:
http.post(f"{G}/{PAGE_ID}/messages", json={**t, "recipient": {"id": msg["sender"]["id"]}, "message": {"text": r}})
return {"answered": True}FAQ
Common questions
What if the FAQ doesn't cover a question?
Does it reply to every comment?
How quickly do document changes take effect?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Post images from Drive with captions in your brand voice
Images from your Drive folder are posted to your Facebook Page with captions written from the brand guide kept in Drive, one at a time.
See how it worksPost Instagram Reels from a Drive folder
Videos you drop in a Drive folder are posted as Instagram Reels with captions, one at a time on your schedule.
See how it worksPost image carousels from Drive to Instagram and Facebook
Images in your Drive folder are posted as carousels on Instagram and as photo posts on your Facebook Page, with captions, on your schedule.
See how it worksKeep exploring
Set up “Answer Facebook comments and messages from your FAQ in Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.