Google Sheets to Gmail, smarter restaurant forecasts
Running out of a key ingredient feels awful. So does throwing food away because you “played it safe” and over-ordered. Most of the time, the problem isn’t effort. It’s that the numbers live in a spreadsheet, the decisions live in someone’s head, and the daily rush leaves no time to connect the dots.
This Sheets Gmail forecasts automation hits restaurant operators hardest, but kitchen managers and multi-location owners feel it too. You get a daily demand forecast and recommended order quantities, written in plain English, delivered to inboxes automatically.
Below, you’ll see how the workflow turns Google Sheets history into an AI-backed forecast, logs it for tracking, and sends a Gmail summary your team will actually read.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: Google Sheets to Gmail, smarter restaurant forecasts
flowchart LR
subgraph sg0["Scheduled Daily Start Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Scheduled Daily Start", pos: "b", h: 48 }
n1@{ icon: "mdi:database", form: "rounded", label: "Retrieve Past Sales Records", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Prepare Data for Forecast"]
n3@{ icon: "mdi:robot", form: "rounded", label: "Generate AI Forecast", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Normalize AI Result"]
n5@{ icon: "mdi:database", form: "rounded", label: "Append Forecast to Sheet", pos: "b", h: 48 }
n6@{ icon: "mdi:robot", form: "rounded", label: "Compose Forecast Email", pos: "b", h: 48 }
n7@{ icon: "mdi:message-outline", form: "rounded", label: "Dispatch Forecast Email", pos: "b", h: 48 }
n8@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Model", pos: "b", h: 48 }
n9@{ icon: "mdi:wrench", form: "rounded", label: "Reasoning Tool", pos: "b", h: 48 }
n10@{ icon: "mdi:brain", form: "rounded", label: "Gemini Query Model", pos: "b", h: 48 }
n11@{ icon: "mdi:wrench", form: "rounded", label: "Thought Tool", pos: "b", h: 48 }
n9 -.-> n3
n8 -.-> n3
n0 --> n1
n11 -.-> n6
n10 -.-> n6
n6 --> n7
n3 --> n4
n4 --> n5
n1 --> n2
n5 --> n6
n2 --> n3
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n3,n6 ai
class n8,n10 aiModel
class n9,n11 ai
class n1,n5 database
class n2,n4 code
classDef customIcon fill:none,stroke:none
class n2,n4 customIcon
The Challenge: Forecasting demand without living in spreadsheets
If you’re forecasting from memory (or last week’s vibe), you’re basically guessing with expensive ingredients. Sales patterns change with weather, seasonality, events, even one staff member taking a day off. The data is there, but it’s scattered across tabs, inconsistent entries, and half-finished notes that never make it to the person ordering. Then you repeat it tomorrow. And the next day. It’s tiring, and honestly it’s easy to lose confidence in your own numbers.
It adds up fast. Here’s where it breaks down in real kitchens.
- You spend about an hour pulling yesterday’s sales and waste into something you can reason about.
- Small data entry mistakes compound, which means you over-order “just in case.”
- Forecasts don’t get shared consistently, so prep and ordering drift out of sync.
- You can’t easily compare predicted vs. actual over time, so the process never improves.
The Fix: Daily AI forecasting from Google Sheets, emailed via Gmail
This n8n workflow runs on a daily schedule and turns your existing Google Sheets into a forecasting engine. It starts by pulling historical records (sales, usage, and wastage) from your sheet, then cleans and structures the data so an AI model can interpret it reliably. Next, an AI Agent (using a Gemini chat model in the workflow) generates item-level demand predictions, recommended order quantities, and simple notes about waste risk. That output is normalized into a consistent format, appended back into a “Predicted Food Data” Google Sheet for tracking, and then summarized into a short email your staff can scan in under a minute. Finally, Gmail sends the forecast report to whoever needs it.
The workflow begins with a scheduled daily trigger. Google Sheets provides the historical context, AI generates the forecast and the email copy, then Gmail delivers it. You end up with two outcomes at once: a logged forecast trail in Sheets and a daily decision-ready message in inboxes.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say your manager spends about 45 minutes each morning pulling yesterday’s sales, checking waste notes, and drafting an ordering recommendation. That’s roughly 4 hours a week. With this workflow, the “work” is dropping clean data into Google Sheets as you already do, then waiting for the scheduled run; the email lands automatically, and the forecast is logged for you. You’ll usually spend maybe 5 minutes reviewing and making the final call, so you’re getting around 3 hours back each week while making ordering more consistent.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets for sales, waste, and forecast storage
- Gmail to email the daily forecast summary
- Gemini API key (get it from Google AI Studio)
Skill level: Intermediate. You’ll connect Google accounts, create two sheets with the right columns, and paste in one API key.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
Daily scheduled run. At the same time each day, n8n triggers the automation so you’re not relying on someone to remember.
Sales and waste data is pulled from Google Sheets. The workflow retrieves past records, then reformats them into a clean structure so the AI doesn’t have to “guess” what each column means.
AI generates a forecast and recommendations. A Gemini-backed AI Agent predicts demand per item, suggests recommended order quantities, and flags waste risk with quick optimization notes. A short “thinking” tool in the workflow helps keep output consistent, especially when your sheet gets messy.
Results are logged and emailed. The forecast is appended to your prediction sheet in Google Sheets, then a separate AI Agent drafts a human-friendly summary and Gmail sends it to staff and management.
You can easily modify the forecast prompt to focus on high-cost items, key categories (proteins, produce), or local seasonal swings based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
Set the workflow to run automatically each day and kick off the data pull.
- Add the Scheduled Daily Start node as your trigger.
- Set the schedule rule to run daily at Trigger At Hour
22(as shown in the node). - Connect Scheduled Daily Start to Retrieve Past Sales Records.
Step 2: Connect Google Sheets
Pull historical sales data and write the forecast back to your spreadsheet.
- Open Retrieve Past Sales Records and select the spreadsheet by setting Document ID to
[YOUR_ID]and Sheet Name to[YOUR_ID]. - Set Authentication to
serviceAccount. - Credential Required: Connect your
googleApicredentials in Retrieve Past Sales Records. - Open Append Forecast to Sheet and set Operation to
append. - Set Document ID to
[YOUR_ID]and Sheet Name to[YOUR_ID]in Append Forecast to Sheet. - Credential Required: Connect your
googleApicredentials in Append Forecast to Sheet.
predicted Use (kg)), the append step will fail.Step 3: Set Up Data Preparation
Package the raw sheet rows into a single payload for the AI agent.
- In Prepare Data for Forecast, keep the JavaScript Code that bundles all rows into
{ data: { rows: [...] } }. - Ensure Retrieve Past Sales Records outputs into Prepare Data for Forecast.
- Confirm the output is a single item with
json.datato match the AI input.
Step 4: Configure AI Forecasting
Generate the demand forecast using the AI agent and Gemini models.
- Open Generate AI Forecast and set Text to
{{ $json.data }}. - Keep the detailed forecasting System Message in Generate AI Forecast to ensure JSON array output.
- Attach Gemini Chat Model as the language model for Generate AI Forecast.
- Credential Required: Connect your
googlePalmApicredentials in Gemini Chat Model. - Attach Reasoning Tool to Generate AI Forecast for structured reasoning.
Step 5: Normalize and Store Forecast Output
Clean the AI output into rows and append them to your forecast sheet.
- In Normalize AI Result, keep the parsing logic that strips code fences and parses the JSON array.
- Connect Generate AI Forecast to Normalize AI Result, then connect to Append Forecast to Sheet.
- Verify that Append Forecast to Sheet columns match:
Date,Dish,predicted Sales,Raw Material,predicted Use (kg),predicted food waste reduce (kg).
Step 6: Compose and Send the Forecast Email
Create a readable email summary and dispatch it to stakeholders.
- Open Compose Forecast Email and set Text to
{{ $('Generate AI Forecast').item.json.output }}. - Attach Gemini Query Model as the language model for Compose Forecast Email.
- Credential Required: Connect your
googlePalmApicredentials in Gemini Query Model. - Attach Thought Tool to Compose Forecast Email for structured drafting.
- In Dispatch Forecast Email, set Send To to
[YOUR_EMAIL], Subject toNext monday prediction, and Message to{{ $json.output }}. - Credential Required: Connect your
gmailOAuth2credentials in Dispatch Forecast Email.
Step 7: Test and Activate Your Workflow
Validate the forecast output and enable daily runs.
- Click Execute Workflow to run a manual test from Scheduled Daily Start.
- Check that Append Forecast to Sheet creates new rows in the forecast sheet.
- Verify that Dispatch Forecast Email sends a message and the body matches the AI summary.
- When results look correct, toggle the workflow to Active for daily production runs.
Watch Out For
- Google Sheets access can fail if the connected Google account loses permission to the spreadsheet. If the workflow suddenly returns empty rows, check the n8n Google Sheets credential and the file’s sharing settings first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Common Questions
About an hour if your Sheets are already set up.
Yes. You’ll mostly be connecting Google accounts and pasting in an AI API key.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini API usage, which is usually modest for one daily forecast email.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Start with the “Generate AI Forecast” agent prompt, because that’s where you can tell the model what matters to your kitchen (high-cost items, par levels, weekend spikes, event catering). If you want the email to be shorter or more operational, adjust the “Compose Forecast Email” agent prompt to change the tone and the format. Many teams also tweak the “Normalize AI Result” step so the output columns match their exact sheet headings. And if you track weather or local events elsewhere, you can bring that in before forecasting using an HTTP Request node and pass it into the AI prompt.
Usually it’s an expired Google authorization or the wrong Gmail account connected in n8n. Reconnect the Gmail credential, confirm the sending address, then re-run a test execution to see if it’s a permissions or quota issue.
For one location sending one daily forecast email, capacity is basically a non-issue.
Often, yes, because this workflow benefits from multi-step data shaping, structured parsing, and two separate AI “drafting” moments (forecast generation, then email composition). n8n handles branching and custom code steps without turning it into a pricing puzzle, and self-hosting gives you breathing room when you add locations. Zapier or Make can work if you only want a simple “new row → send email” automation, but forecasting is rarely that clean. If your Sheets are messy or you want better control over prompts and formatting, n8n is a safer bet. Talk to an automation expert if you want a quick recommendation based on your setup.
Once this is running, forecasting becomes a daily habit without the daily hassle. The workflow handles the repetitive checking and summarizing so you can spend your time on decisions, not copy-paste.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.