Skip to content

Every 15 minutes

Moderate Facebook comments and log their sentiment

New comments on your Page are sorted by AI: spam is hidden, questions get a reply, and every comment is logged with its sentiment in your sheet.

Runs
Every 15 minutes
Apps
Facebook Pages, Google Sheets
AI
Yes, uses the built-in AI allowance
Access
pages_read_engagement, pages_manage_engagement; Sheet edit

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check new comments on my Facebook Page posts. Hide spam, reply to simple questions, log each comment with its sentiment in my Comments sheet, and email me about any angry ones.

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 restaurant's Facebook Page gets comments every day: compliments, booking questions, the odd complaint, and a steady trickle of spam links. The owner checks once a day at best, so spam sits under posts for hours and questions go unanswered.

Every new comment is now read within 15 minutes. Spam is hidden, simple questions get a polite reply, and every comment is logged in a sheet with its sentiment. Angry comments come straight to the owner's inbox so they can respond personally.

What you get out of it

  • A clean Page

    Spam links and scams are hidden before most followers see them.

  • Questions answered quickly

    Simple questions about hours or bookings get a reply in minutes.

  • Complaints reach you fast

    Negative comments are emailed straight away, so you can step in personally.

  • Sentiment over time

    The sheet shows how people feel about your posts week by week.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime checks your recent Page posts for new comments.

  2. It skips comments it has already handled.

  3. AI marks each one as spam, question, positive, neutral or negative; spam is hidden and simple questions get a reply.

  4. Every comment is logged in your sheet with its sentiment, and negative ones are emailed to you.

Before it runs live

  • Connect Facebook Pages
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsEvery 15 minutes
Moderate Facebook comments and log their sentimenttoday, 9:00Succeeded
Google Sheets · Comments17 Oct 19:42 | Are you open on Mondays? | question (replied)

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

PAGE_ID, SHEET_ID = "1234567890", "your-spreadsheet-id"
G, FAQ = "https://graph.facebook.com/v21.0", "Open Tue-Sun 12-22. Book at northwind-kitchen.example/book."

@on_trigger
def run(event):
    t, seen, rows = {"access_token": credentials.connection("facebook", "work")}, set(state.get("seen") or []), []
    posts = http.get(f"{G}/{PAGE_ID}/posts", params={**t, "limit": 10}).json()["data"]
    new = [c for p in posts for c in http.get(f"{G}/{p['id']}/comments", params=t).json()["data"] if c["id"] not in seen]
    report_fetched(len(new))
    if not new:
        return {"summary": "No new comments"}
    for c in new:
        r = ai.generate(f"Facts: {FAQ}\nComment: {c['message'][:500]}", max_output_tokens=150, json_schema={"type": "object",
                        "properties": {"label": {"enum": ["spam", "question", "positive", "neutral", "negative"]}, "reply": {"type": "string"}}}).json
        if r["label"] == "spam":
            http.post(f"{G}/{c['id']}", data={**t, "is_hidden": "true"})
        elif r["label"] == "question" and r.get("reply"):
            http.post(f"{G}/{c['id']}/comments", data={**t, "message": r["reply"]})
        elif r["label"] == "negative":
            notify.email_me("Negative comment on your Page", c["message"])
        rows.append([c["created_time"], c["message"], r["label"]])
        seen.add(c["id"])
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Comments!A:C", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
    state.set("seen", list(seen)[-2000:])
    return {"handled": len(new)}

FAQ

Common questions

Does it delete comments?
No. Spam is hidden, which keeps it out of sight but lets you unhide it if a real comment was caught by mistake.
What kind of questions does it answer?
Only the ones you give answers for in the prompt, such as opening hours or how to book. Anything else is logged for you to answer.
Will it reply to complaints?
No. Negative comments are left for you and emailed so you can respond in your own words.
What permissions does it need?
pages_read_engagement, pages_manage_engagement; Sheet edit. 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 “Moderate Facebook comments and log their sentiment” from your assistant

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