Automation library · Customer support

Facebook Messenger chatbot with OpenAI

Started by another system calling it. It calls services over plain HTTP rather than through connectors. 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, 3 loops or waits: 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
3Loops or waits
0Services by connector: it calls them over plain HTTP

The flow

Starts it 2Model 7Logic 8Service 6

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

  1. 1WebhookWebhookStarts it
  2. 2ThinkTool ThinkModel
  3. 3HTTPHttp Request ToolService
  4. 4Google DocsGoogle Docs ToolService
  5. 5MemoryMemory Buffer WindowModel
  6. 6OpenAI Chat ModelLm Chat Open AiModel
  7. 7OpenAI ChatLm Chat Open AiModel
  8. 8If3IfLogic
  9. 9IfIfLogic
  10. 10AI AgentAgentModel
  11. 11AI Agent1AgentModel
  12. 12Respond to WebhookRespond To WebhookStarts it
  13. 13Classify textOpen AiModel
  14. 14WaitWaitLogic
  15. 15Wait1WaitLogic
  16. 16If2IfLogic
  17. 17User Replay MessageFacebook Graph ApiService
  18. 18Edit FieldsSetLogic
  19. 19Edit Fields1SetLogic
  20. 20Admin Message1Facebook Graph ApiService
  21. 21Wait3WaitLogic
  22. 22User MessageFacebook Graph ApiService
  23. 23Admin MessageFacebook Graph ApiService

How it's built

Starts on
Another system calling it
Steps
23, with 3 branches, 3 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Nothing by connector; it calls services over plain HTTP
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, and a key for OpenAI. 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 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.