Data Processing & Analysisintermediate
October 16, 2025
6 min read
55 minutes
Comprehensive Restaurant Performance Reporting and Optimization - n8n Workflow
Automate restaurant analytics with n8n and Google Gemini AI, turning sales, waste, and feedback into daily actionable insights via email.
By Kazi Sakib

Running a restaurant means juggling dozens of moving parts. You've got sales data scattered across spreadsheets, food waste eating into your profits, and customer feedback buried in forms. By the time you manually compile everything into a report, the day is over and you're too exhausted to act on the insights.
What if you could wake up every morning to a comprehensive email that tells you exactly what happened yesterday, what's working, what's broken, and what to do about it today?
That's exactly what this n8n workflow does. It pulls data from three critical areas of your restaurant operations, runs them through Google Gemini AI for deep analysis, and delivers a polished daily report straight to your inbox. No manual work. No data entry. Just actionable intelligence ready when you need it.
What You'll Need Before Starting
This workflow connects multiple systems to create a seamless analytics pipeline. Here's what you need to set up:
Required APIs and Accounts
- Google Sheets API: Your data lives here. You'll need three sheets for sales records, food waste logs, and customer feedback.
- Google Gemini API: The AI brain of the operation. Sign up for access to Gemini 2.5 Pro to power your analysis.
- Gmail API: For automated email delivery of your daily reports.
- n8n account: The workflow automation platform that connects everything together.
Key Components in the Workflow
This workflow uses several specialized n8n nodes to handle different tasks:
- Google Sheets nodes: Pull data from your spreadsheets
- Code nodes: Normalize and format data for AI processing
- Google Gemini Chat Model nodes: The AI that analyzes your data
- Think Tool nodes: Enable advanced AI reasoning capabilities
- AI Agent nodes: Execute sophisticated data analysis with custom prompts
- Merge node: Combine insights from multiple analysis streams
- Gmail node: Send the final report to your team
Step 1: Set Up Your Data Collection Points
First, you need to organize your data sources. The workflow expects three Google Sheets with specific structures:
Your Sales sheet should track Date, Dish Name, Category, Quantity Sold, Unit Price, Total Revenue, Cost Per Unit, Profit Margin, Peak Hour, and Weather Impact. This gives the AI enough context to understand not just what sold, but why it sold.

img_1.png
The Food Waste sheet logs Date, Item Name, Category, Waste Type, Quantity Wasted, Unit, Cost Per Unit, Total Waste Cost, Waste Reason, and Prevention Action. Every thrown-out ingredient becomes a data point for optimization.
Your Feedback sheet captures Date, Customer ID, Dish Name, Overall Rating, Food Quality, Service Rating, Ambiance Rating, Feedback Type, and Comments. This turns subjective opinions into measurable trends.
Once your sheets are ready, connect three Google Sheets nodes in n8n, each pointing to the respective tab. These nodes fire simultaneously when you trigger the workflow.
Step 2: Normalize Your Data for AI Processing
Raw spreadsheet data is messy. Rows come in one at a time, and the AI needs to see the complete picture. That's where the normalization code nodes come in.
Each data stream passes through a JavaScript code node that bundles all rows into a single structured object. This transformation is critical because it allows the AI to perform aggregate analysis, spot patterns, and calculate metrics across your entire dataset.
The code is straightforward. It collects all incoming items, extracts the JSON from each, and wraps everything in a clean payload that the AI can digest in one go.

img_2.png
Step 3: Deploy Specialized AI Analysts
Here's where the magic happens. Each data type gets its own dedicated AI agent with a custom-built system prompt that turns Gemini into a domain expert.
The Sales Analyst AI validates your data, calculates profit margins, identifies top performers by quantity and revenue, analyzes weather impacts, and highlights peak hours. It doesn't just report numbers; it explains what's driving your business.
The Food Waste Analyst AI breaks down waste by category and type, pinpoints your costliest waste items, evaluates your prevention actions, and recommends improvements based on proven strategies like FIFO inventory management and staff training programs.
The Customer Feedback Analyst AI aggregates ratings across multiple dimensions, performs sentiment analysis on comments, identifies dish-specific issues, detects common themes, and prioritizes action items based on impact and urgency.
Each AI agent connects to a Google Gemini Chat Model node configured with Gemini 2.5 Pro, and a Think Tool that enables deeper reasoning capabilities. The agents output structured JSON reports packed with insights.

img_3.png
Step 4: Clean and Validate AI Outputs
AI responses aren't always perfectly formatted. They might include markdown wrappers, inconsistent data types, or extraneous text. That's why each AI agent connects to a formatting code node.
These nodes strip out code fences, parse the JSON, convert string numbers into actual numeric types, normalize arrays and objects, and validate that all expected fields are present. They ensure consistency so the final merge step works flawlessly.
Step 5: Synthesize Cross-Dataset Insights
Individual reports are useful, but the real value comes from connecting the dots. A Merge node combines all three formatted reports into a single dataset.
This merged data flows into one final AI agent, the Daily Performance Analyst. This agent receives all three reports and synthesizes them into a cohesive narrative. It correlates insights across datasets. For example, if a dish has high waste, low customer ratings, and declining sales, it flags this as a critical issue requiring immediate attention.
The system prompt for this agent is designed to produce a plain-text email body. No JSON, no markdown, just clean prose formatted with headers, bullet points, and clear action items. It includes key metrics at a glance, detailed insights from each area, cross-analysis findings, and next-day suggestions organized by category.
Step 6: Deliver Insights Automatically
The final formatted email passes through one last code node that strips any remaining wrapper text, then connects directly to a Gmail node. You configure the recipient email, add a subject line, and you're done.
Every time you trigger this workflow manually or on a schedule, it runs the entire analysis pipeline and delivers a comprehensive report to your inbox. No manual compilation. No copy-pasting between tools. Just actionable intelligence ready to drive decisions.

img_4.png
Why This Workflow Changes the Game
This isn't just automation for automation's sake. It solves real operational challenges that plague restaurant managers every day.
Time savings are massive. What used to take hours of manual analysis now runs in minutes. Your team can focus on execution instead of data wrangling.
Consistency improves decision quality. Human analysis is prone to bias and fatigue. The AI applies the same rigorous methodology every single day, ensuring nothing slips through the cracks.
Cross-dataset correlation reveals hidden patterns. When you analyze sales, waste, and feedback in isolation, you miss critical connections. This workflow surfaces relationships that would be nearly impossible to spot manually.
Practical Applications Beyond Daily Reporting
While daily reports are the primary use case, this workflow architecture adapts to other scenarios:
Run it weekly for deeper trend analysis. Trigger it after major events to measure impact. Use it for A/B testing menu changes. Clone it for multi-location analysis by adding location-specific data sources.
The modular design means you can swap data sources, modify AI prompts, add new analysis dimensions, or integrate additional systems without rebuilding from scratch.
Your Restaurant, Now Smarter
The restaurant industry runs on razor-thin margins. Every percentage point of waste reduction, every uptick in customer satisfaction, every optimization of your menu mix directly impacts your bottom line.
This n8n workflow transforms scattered operational data into strategic intelligence. It takes the guesswork out of daily management and replaces gut feelings with data-backed recommendations.
Stop drowning in spreadsheets. Start waking up to insights.
Share this article
Help others discover this content
Tap and hold the link button above to access your device's native sharing options
More in Data Processing & Analysis
Continue exploring workflows in this category

Data Processing & Analysisintermediate
1 min read
Generate Creative Solutions with Dual AI Agents, Randomization & Redis - Workflow
Kazi Sakib
Oct 21
Est: 35 minutes

Data Processing & Analysisadvanced
1 min read
Fully Automated Tech News Publishing Pipeline with n8n, OpenAI, Google Workspace & Slack
Nayma Sultana
Oct 20
Est: 1 hour

Data Processing & Analysisintermediate
1 min read
Build an AI-Powered Data Analytics Department with n8n and OpenAI: A Multi-Agent Workflow Guide
Kazi Sakib
Oct 20
Est: 45 minutes