Automation library · Chat assistants

Classify and respond to Facebook Messenger inquiries

Started by a clock, and works across Google Sheets and Slack. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 23 steps, 3 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

23 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Model 4Logic 4Service 13

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

  1. 1Error Handler TriggerError triggerStarts it
  2. 2Trigger – Fetch New Facebook Messages (Every Hour)Schedule triggerStarts it
  3. 3Model – GPT-4 Language ModelLm Chat Open AiModel
  4. 4Parse AI Output (JSON Parser)Output Parser StructuredModel
  5. 5Memory – Conversation Context BufferMemory Buffer WindowModel
  6. 6Slack: Send Error AlertSlackService
  7. 7Fetch Facebook Conversations (Graph API)Facebook Graph ApiService
  8. 8AI – Classify Message (Lead / Query / Spam)AgentModel
  9. 9Format Incoming Message DataSetLogic
  10. 10Route Messages by CategorySwitchLogic
  11. 11Slack Approval – Lead MessageSlackService
  12. 12Slack Approval – Query MessageSlackService
  13. 13Log to Google Sheets – Spam MessagesGoogle SheetsService
  14. 14Check Lead Approval StatusSwitchLogic
  15. 15Check Query Approval StatusSwitchLogic
  16. 16Send AI Reply – Lead ApprovedFacebook Graph ApiService
  17. 17Send Fallback Reply – Lead RejectedFacebook Graph ApiService
  18. 18Send AI Reply – Query ApprovedFacebook Graph ApiService
  19. 19Send Fallback Reply – Query RejectedFacebook Graph ApiService
  20. 20Log to Google Sheets – Lead ApprovedGoogle SheetsService
  21. 21Log to Google Sheets – Lead RejectedGoogle SheetsService
  22. 22Log to Google Sheets – Query ApprovedGoogle SheetsService
  23. 23Log to Google Sheets – Query RejectedGoogle SheetsService

How it's built

Starts on
A clock
Steps
23, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, Slack
Model
OpenAI
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 Google Sheets and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. 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 23 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 23 steps before you point it at anything that matters.