# AI-powered food order processing with Facebook Messenger: n8n workflow

> Started by another system calling it, and works across Google Calendar and Google Sheets. It puts OpenRouter behind a retrieval step, so answers are drawn...

Source: https://millionrounds.com/workflow/ai-powered-food-order-processing-with-facebook-messenger (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [E-commerce](https://millionrounds.com/workflows?category=E-commerce#library)

# AI-powered food order processing with Facebook Messenger

Started by another system calling it, and works across Google Calendar and Google Sheets. It puts OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 17 steps, 3 branches: a working afternoon to understand properly.

Medium Calls a model: OpenRouter Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-powered-food-order-processing-with-facebook-messenger)

**17 steps** Medium: a working afternoon

**3** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 5 Model 3 Logic 4 Service 5

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

- 1 **Memory Buffer (Customer Session)** Memory Buffer Window *Model*
- 2 **OpenRouter Model** Lm Chat Open Router *Model*
- 3 **Webhook - FB Messenger** Webhook *Starts it*
- 4 **AI Agent (Order Assistant)** Agent *Model*
- 5 **Validate Webhook Subscription** If *Logic*
- 6 **Respond 200 OK** Respond To Webhook *Starts it*
- 7 **Respond Challenge** Respond To Webhook *Starts it*
- 8 **Respond 202 (Error fallback)** Respond To Webhook *Starts it*
- 9 **Send Message to FB (Text)** Http Request *Service*
- 10 **Send Message to FB (Image)** Http Request *Service*
- 11 **Check for Menu Trigger** If *Logic*
- 12 **Send Generic Text (HTTP)** Http Request *Service*
- 13 **Parse Order Text** Code *Logic*
- 14 **Validate Parsed Order** If *Logic*
- 15 **Respond Raw Items (Debug)** Respond To Webhook *Starts it*
- 16 **Create Calendar Event** Google Calendar *Service*
- 17 **Append or Update Orders Sheet** Google Sheets *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 17, with 3 branches
- **Size:** Medium: a working afternoon
- **Connects to:** Google Calendar, Google Sheets
- **Model:** OpenRouter
- **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 Calendar and Google Sheets accounts, and a key for OpenRouter. 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 OpenRouter. 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?

Plan an afternoon. 17 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 17 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%2Fai-powered-food-order-processing-with-facebook-messenger)
- **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 Calendar](https://millionrounds.com/workflows?service=Google+Calendar#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)

## Workflows like it

Also e-commerce, with the same services where possible, closest in size first.

- [**Automate Shopify New Product Promotions with WhatsApp** 17 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/automate-shopify-new-product-promotions-with-whatsapp)
- [**E-commerce price monitor with Firecrawl and Claude** 17 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/e-commerce-price-monitor-with-firecrawl-and-claude)
- [**Generate AI inventory reorder recommendations from Airtable** 17 steps · calls a model · Airtable, Asana](https://millionrounds.com/workflow/generate-ai-inventory-reorder-recommendations-from-airtable)
- [**Shopify partner directory scrape and personalize outreach** 17 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/shopify-partner-directory-scrape-and-personalize-outreach)
- [**AI blog generator for Shopify products with Gemini** 18 steps · calls a model · Google Sheets, Shopify](https://millionrounds.com/workflow/ai-blog-generator-for-shopify-products-with-gemini)
- [**Automate WhatsApp orders & inventory with Gemini** 16 steps · calls a model · Google Sheets, WhatsApp](https://millionrounds.com/workflow/automate-whatsapp-orders-and-inventory-with-gemini)
