Automation library · AI assistants

Smart human takeover & auto pause AI-powered Facebook Messenger

Started by another system calling it, and works across n8n data table. It hands the judgement calls to Gemini. 32 steps, 5 branches, 2 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini

32 stepsLarge: read it before trusting it with anything live
5Branches: places the flow splits
2Loops or waits
1Service it connects to

The flow

Starts it 2Model 2Logic 15Service 13

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

  1. 1Facebook WebhookWebhookStarts it
  2. 2Google Gemini Chat ModelLm Chat Google GeminiModel
  3. 3Confirm WebhookRespond To WebhookStarts it
  4. 4Is messageIfLogic
  5. 5Process Merged MessageAgentModel
  6. 6Set ContextSetLogic
  7. 7Format for Facebook OutputCodeLogic
  8. 8Is from page?IfLogic
  9. 9Loop Over ItemsSplit In BatchesLogic
  10. 10User is ReciepientSetLogic
  11. 11User is SenderSetLogic
  12. 12Update FALSE to TRUEData TableService
  13. 13Delay Between MessagesWaitLogic
  14. 14Is from AI?IfLogic
  15. 15Check Paused ListData TableService
  16. 16Update Page RepData TableService
  17. 17Send TextHttp RequestService
  18. 18Insert to Paused ListData TableService
  19. 19In Paused List?IfLogic
  20. 20Clean HistoryData TableService
  21. 21Insert human repData TableService
  22. 22Comparison timeSetLogic
  23. 23Insert To UnprocessedData TableService
  24. 24SeenHttp RequestService
  25. 25Is still Pause?IfLogic
  26. 26Get MaxID and Merged MessCodeLogic
  27. 27Insert To ProcessedData TableService
  28. 28Remove from Paused ListData TableService
  29. 29Get history messageData TableService
  30. 30Get 15 newest rowsCodeLogic
  31. 31Merge History and Find Min_IDCodeLogic
  32. 32Send TypingHttp RequestService

How it's built

Starts on
Another system calling it
Steps
32, with 5 branches, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
n8n data table
Model
Gemini

Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls Gemini. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 32 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 32 steps before you point it at anything that matters.