πŸ’¬ Send AI-parsed restaurant orders and status updates via Telegram and Google Sheets

⚑ 292 views Β· πŸ’¬ Support Chatbots

Description

πŸ• AI-Powered Restaurant Order & Notification System

A Complete n8n Workflow for Automated Ordering and Customer Updates

This professional n8n workflow provides an end-to-end solution for small restaurants. It includes a Telegram Customer Bot for placing orders and an Automated Notification System that updates customers via Google Sheets.


πŸ“– Description

This system eliminates the need for manual order taking and status updates. It features:

  1. AI Order Bot: Customers chat with a Telegram bot to view the menu and place orders. An AI agent (Claude Haiku) parses natural language (e.g., β€œ2 pizza + 1 coke”) into structured data.
  2. Order Management: Orders are saved automatically to Google Sheets for staff to manage.
  3. Real-Time Notifications: As staff change the status in the sheet (e.g., to Preparing or Ready), n8n instantly notifies the customer via Telegram.

Key Bot Commands

CommandDescription
/startWelcome message and instructions
/menuView today’s food and drink offerings
/helpSee all available commands
STATUS [Queue #]Check the live status of an order
CANCEL [Queue #]Cancel an order (only if Pending)
/myordersView your last 5 orders

πŸ›  Setup Requirements

1. Google Sheets Configuration

Your spreadsheet acts as your Admin Dashboard. Ensure Row 1 has these exact headers in order:

ColumnHeader NameDescription
AQueue NumberAuto-generated by the bot (e.g., #4582)
BChat IDCustomer’s Telegram ID β€” captured automatically
CNameCustomer’s first name
DOrderItems ordered β€” parsed and cleaned by AI
EStatusDropdown: Pending, Preparing, Ready, Completed, Cancelled
FOrder TimeTimestamp of when the order was placed
GOrder DateDate of the order
HLast Status SentInternal: Tracks last notification sent to prevent duplicates

> ⚠️ Important: Set up a Data Validation dropdown on column E with the values: Pending, Preparing, Ready, Completed, Cancelled. This is how staff update order status.

> ⚠️ Important: In the Read All Rows node, go to Options β†’ Output Row Number and ensure it is enabled. The workflow uses row_number to write back to the correct cell.


2. n8n Credential Configuration

You need 3 credentials set up in n8n before activating:

Credential TypeWhere UsedNotes
Anthropic APIClaude Haiku nodeRequired for AI order parsing
Google Sheets OAuth2 APIAll Google Sheets nodesConnect your Google account
Telegram Bot APIAll Telegram nodesUse your bot token from @BotFather

Steps:

  1. Go to n8n β†’ Settings β†’ Credentials β†’ Add Credential
  2. Add each credential type above
  3. After importing the workflow, open each node and select the correct credential

3. Workflow Import Steps

  1. Copy the workflow JSON
  2. In n8n, click + β†’ Import from JSON β†’ Paste and confirm
  3. Connect all credentials in each node
  4. Ensure Output Row Number is enabled in Read All Rows node options
  5. Pre-fill column H (Last Status Sent) with the current Status for all existing rows to prevent old rows from firing notifications on first run
  6. Turn the workflow Active

πŸ— How It Works

Phase 1: The Customer Bot (Workflow 1)

Customer texts bot
       ↓
Route Message β€” detects command type
       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ /start    β†’ Welcome message         β”‚
β”‚ /help     β†’ Help guide              β”‚
β”‚ /menu     β†’ Today's menu            β”‚
β”‚ /myorders β†’ Last 5 orders           β”‚
β”‚ STATUS    β†’ Live order status       β”‚
β”‚ CANCEL    β†’ Cancel if Pending only  β”‚
β”‚ [order]   β†’ AI parses β†’ saves       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↓
Order saved to Google Sheet (Status = Pending)
Customer receives queue number + wait time

Phase 2: The Staff Notification System (Workflow 2)

Every 1 minute β€” Schedule Trigger fires
       ↓
Read ALL rows from Google Sheet
       ↓
For EACH row independently (runOnceForEachItem):
  - Skip if no Queue Number or Chat ID
  - Skip if Status = Pending
  - Skip if Status = Last Status Sent (already notified)
  - βœ… Send notification if Status changed
       ↓
Send Telegram message to that customer only
       ↓
Write new Status into column H (Last Status Sent)
β†’ Prevents duplicate notification next minute

Status Flow & Customer Messages

Staff sets Status toCustomer receives
PreparingπŸ‘¨β€πŸ³ β€œYour order is being Prepared! We’ll notify you when it’s ready.”
ReadyπŸ• β€œYour order is READY for collection! Please collect from the counter.”
Completedβœ… β€œOrder marked as Completed. Thank you for dining with us!”
Cancelled❌ β€œYour order has been Cancelled. We apologise for the inconvenience.”

πŸ”’ Order Cancellation Rules

Customers can only cancel orders in Pending status. All other states are protected:

Current StatusCustomer tries CANCELResponse
PendingCANCEL 1234βœ… Cancelled successfully
PreparingCANCEL 1234⚠️ Cannot cancel β€” being prepared
ReadyCANCEL 1234⚠️ Already ready β€” please collect
CompletedCANCEL 1234⚠️ Already completed
CancelledCANCEL 1234⚠️ Already cancelled
Someone else’s orderCANCEL 1234❌ You can only cancel your own orders

πŸ“¦ Required Credentials Summary

CredentialProviderFree Tier
Anthropic APIanthropic.comPaid β€” ~$5 minimum deposit
Google Sheets OAuth2 APIGoogle Cloud ConsoleFree
Google Sheets Trigger OAuth2 APIGoogle Cloud ConsoleFree
Telegram Bot API@BotFather on TelegramFree forever

πŸ§ͺ Test Scenarios

Run these in order to verify the full system:

  1. /start β†’ Should receive welcome message
  2. /menu β†’ Should see the menu with prices
  3. Type 2 pizza + 1 coke β†’ Should get queue number
  4. STATUS [queue] β†’ Should show ⏳ Pending
  5. In sheet: change Status to Preparing β†’ Within 1 min, customer gets πŸ‘¨β€πŸ³ message
  6. In sheet: change Status to Ready β†’ Customer gets πŸ• message
  7. STATUS [queue] β†’ Should now show πŸ• Ready
  8. CANCEL [queue] β†’ Should say β€œalready ready, please collect”
  9. In sheet: change Status to Completed β†’ Customer gets βœ… message
  10. /myorders β†’ Should show order history with final status

⚠️ Known Limitations


πŸ—‚ File Structure

restaurant_WITH_STICKIES.json   β€” Complete workflow (W1 + W2) with sticky notes
restaurant_workflow_docs.md     β€” This documentation file

Built with n8n β€’ Claude Haiku AI β€’ Google Sheets β€’ Telegram Bot API

πŸ”— Nodes Used

Google Sheets, HTTP Request, Telegram, Telegram Trigger, Schedule Trigger, AI Agent

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup