# Monitor Facebook post safety with Apify and Gemini: n8n workflow

> Started by an incoming Telegram message, and works across Apify, Telegram and n8n data table.

Source: https://millionrounds.com/workflow/monitor-facebook-post-safety-with-apify-and-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Monitor Facebook post safety with Apify and Gemini

Started by an incoming Telegram message, and works across Apify, Telegram and n8n data table. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 28 steps: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmonitor-facebook-post-safety-with-apify-and-gemini)

**28 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 3 Model 8 Logic 10 Service 7

The steps in the order they run, from what starts it.

- 1 **Telegram Trigger** Telegram trigger *Starts it*
- 2 **MongoDB Chat Memory** Memory Mongo Db Chat *Model*
- 3 **SerpAPI Search** Serp Api Tool *Service*
- 4 **Scrape Specific Page Tool** Tool Workflow *Model*
- 5 **Schedule Trigger** Schedule trigger *Starts it*
- 6 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 7 **MongoDB Chat Memory 1** Memory Mongo Db Chat *Model*
- 8 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 9 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 10 **Set Context (Chat)** Set *Logic*
- 11 **Chat AI Agent** Agent *Model*
- 12 **Set Context (Scraper)** Set *Logic*
- 13 **Safety Analysis Agent** Agent *Model*
- 14 **Structured Output Parser** Output Parser Structured *Model*
- 15 **Send Telegram Reply** Telegram *Service*
- 16 **Apify Facebook Scraper** Apify *Service*
- 17 **Format Telegram Message** Code *Logic*
- 18 **Normalize Fields** Set *Logic*
- 19 **Send Notification** Telegram *Service*
- 20 **If row does not exist** Data Table *Service*
- 21 **Data Table Upsert** Data Table *Service*
- 22 **Format Post Content** Set *Logic*
- 23 **Has Image?** Filter *Logic*
- 24 **Aggregate Text** Aggregate *Logic*
- 25 **Download Image** Http Request *Service*
- 26 **Merge Data** Merge *Logic*
- 27 **Aggregate Images** Aggregate *Logic*
- 28 **Final Aggregate** Aggregate *Logic*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 28
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Apify, Telegram, n8n data table
- **Model:** Gemini
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Apify and Telegram accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 28 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 28 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmonitor-facebook-post-safety-with-apify-and-gemini)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Apify](https://millionrounds.com/workflows?service=Apify#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Process Telegram image albums with Data Tables Cache** 28 steps · Telegram, n8n data table](https://millionrounds.com/workflow/process-telegram-image-albums-with-data-tables-cache)
- [**Sync Attio CRM with Jotform and Slack** 28 steps · n8n data table](https://millionrounds.com/workflow/sync-attio-crm-with-jotform-and-slack)
- [**Detect procurement fraud and monitor supplier compliance** 29 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/detect-procurement-fraud-and-monitor-supplier-compliance)
- [**Match teacher substitutes and send notifications with OpenAI** 29 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/match-teacher-substitutes-and-send-notifications-with-openai)
- [**Monitor favorite YouTube channels with RSS** 29 steps · calls a model · Gmail, RSS](https://millionrounds.com/workflow/monitor-favorite-youtube-channels-with-rss)
- [**Monitor semiconductor board reliability with OpenAI and Slack** 29 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/monitor-semiconductor-board-reliability-with-openai-and-slac)
