Automation library · Customer support

Answer Facebook Messenger product questions with OpenAI

Started by an event in a connected app, and works across Google Sheets. It hands the judgement calls to OpenAI. 20 steps, 2 branches: a working afternoon to understand properly.

MediumCalls a model: OpenAI

20 stepsMedium: a working afternoon
2Branches: places the flow splits
0Loops or waits
1Service it connects to

The flow

Starts it 1Model 6Logic 8Service 5

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

  1. 1Trigger – New Facebook Messenger MessageFacebook triggerStarts it
  2. 2OpenAI Model, Intent ExtractionLm Chat Open AiModel
  3. 3Structured Output Parser, IntentOutput Parser StructuredModel
  4. 4OpenAI Model, Product MatchingLm Chat Open AiModel
  5. 5Structured Output Parser, Product MatchOutput Parser StructuredModel
  6. 6Split Out Facebook Page EntriesSplit OutLogic
  7. 7AI – Extract Product & Customer IntentAgentModel
  8. 8AI – Match Requested Product in InventoryAgentModel
  9. 9Split Out Messenger EventsSplit OutLogic
  10. 10Combine Intent + Inventory DataMergeLogic
  11. 11Check If Product ExistsIfLogic
  12. 12Check Valid Customer MessageIfLogic
  13. 13Prepare Product Matching PayloadSetLogic
  14. 14Send Facebook Reply, Product FoundFacebook Graph ApiService
  15. 15Send Facebook Reply, Product Not FoundFacebook Graph ApiService
  16. 16ConfigurationSetLogic
  17. 17Log Skipped Event to Google SheetsGoogle SheetsService
  18. 18Log Conversation to Google SheetsGoogle SheetsService
  19. 19Fetch Inventory Records from Google SheetsGoogle SheetsService
  20. 20Aggregate Inventory Into Single ListAggregateLogic

How it's built

Starts on
An event in a connected app
Steps
20, with 2 branches
Size
Medium: a working afternoon
Connects to
Google Sheets
Model
OpenAI

Questions

What does it need to run?

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

What starts it?

It starts on an event in a connected app.

Does it use AI?

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

How long does it take to set up?

Plan an afternoon. 20 steps is enough that you should read each one before running it.

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 20 steps before you point it at anything that matters.