# Classify and respond to Facebook Messenger inquiries: n8n workflow

> 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...

Source: https://millionrounds.com/workflow/classify-and-respond-to-facebook-messenger-inquiries (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Chat assistants](https://millionrounds.com/workflows?category=Chat+assistants#library)

# 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.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fclassify-and-respond-to-facebook-messenger-inquiries)

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

**3** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 4 Logic 4 Service 13

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

- 1 **Error Handler Trigger** Error trigger *Starts it*
- 2 **Trigger – Fetch New Facebook Messages (Every Hour)** Schedule trigger *Starts it*
- 3 **Model – GPT-4 Language Model** Lm Chat Open Ai *Model*
- 4 **Parse AI Output (JSON Parser)** Output Parser Structured *Model*
- 5 **Memory – Conversation Context Buffer** Memory Buffer Window *Model*
- 6 **Slack: Send Error Alert** Slack *Service*
- 7 **Fetch Facebook Conversations (Graph API)** Facebook Graph Api *Service*
- 8 **AI – Classify Message (Lead / Query / Spam)** Agent *Model*
- 9 **Format Incoming Message Data** Set *Logic*
- 10 **Route Messages by Category** Switch *Logic*
- 11 **Slack Approval – Lead Message** Slack *Service*
- 12 **Slack Approval – Query Message** Slack *Service*
- 13 **Log to Google Sheets – Spam Messages** Google Sheets *Service*
- 14 **Check Lead Approval Status** Switch *Logic*
- 15 **Check Query Approval Status** Switch *Logic*
- 16 **Send AI Reply – Lead Approved** Facebook Graph Api *Service*
- 17 **Send Fallback Reply – Lead Rejected** Facebook Graph Api *Service*
- 18 **Send AI Reply – Query Approved** Facebook Graph Api *Service*
- 19 **Send Fallback Reply – Query Rejected** Facebook Graph Api *Service*
- 20 **Log to Google Sheets – Lead Approved** Google Sheets *Service*
- 21 **Log to Google Sheets – Lead Rejected** Google Sheets *Service*
- 22 **Log to Google Sheets – Query Approved** Google Sheets *Service*
- 23 **Log to Google Sheets – Query Rejected** Google Sheets *Service*

## 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.

## 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%2Fclassify-and-respond-to-facebook-messenger-inquiries)
- **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.

[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also chat assistants, with the same services where possible, closest in size first.

- [**Assess procurement inflation risk with Groq and Google Sheets** 23 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/assess-procurement-inflation-risk-with-groq-and-google-sheet)
- [**Build an engineering knowledge graph with ClickUp and GitHub** 23 steps · calls a model · Slack](https://millionrounds.com/workflow/build-an-engineering-knowledge-graph-with-clickup-and-github)
- [**Create AI Instagram Reels with OpenAI and Veo3** 23 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/create-ai-instagram-reels-with-openai-and-veo3)
- [**Find LinkedIn engagement opportunities with Apify and Gemini** 23 steps · calls a model · Apify, Google Sheets](https://millionrounds.com/workflow/find-linkedin-engagement-opportunities-with-apify-and-gemini)
- [**Omni-Sentinel AI: autonomous enterprise auditor & ROI engine** 23 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/omni-sentinel-ai-autonomous-enterprise-auditor-and-roi-engin)
- [**Reply to Instagram comments and send DMs** 23 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/reply-to-instagram-comments-and-send-dms)
