Google Sheets to Gmail, weekly sales forecasts sent
Weekly forecasting sounds simple until you’re staring at a Google Sheet on Sunday night, trying to guess next week’s sales and inventory with half-complete data and a tired brain. That’s when mistakes slip in, orders get padded “just in case,” and food waste quietly creeps up.
This Sheets Gmail forecast automation hits restaurant operators first, honestly. But multi-location managers feel it too, and agency consultants building reporting for hospitality clients run into the same “spreadsheet swirl.” You get a reliable weekly forecast, delivered automatically to the right inboxes.
Below, you’ll see exactly what the workflow does, what you need to run it in n8n, and how to think about customizing it for your menu, categories, and seasonality.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: Google Sheets to Gmail, weekly sales forecasts sent
flowchart LR
subgraph sg0["Scheduled Forecast Kickoff Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Scheduled Forecast Kickoff", pos: "b", h: 48 }
n1@{ icon: "mdi:database", form: "rounded", label: "Retrieve Past Sales Sheet", 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/>Shape Data for AI"]
n3@{ icon: "mdi:robot", form: "rounded", label: "AI Forecast Generator", pos: "b", h: 48 }
n4@{ icon: "mdi:wrench", form: "rounded", label: "Reasoning Helper Tool", pos: "b", h: 48 }
n5@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Model", pos: "b", h: 48 }
n6["<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/>Parse AI Forecast JSON"]
n7@{ icon: "mdi:database", form: "rounded", label: "Append Forecast to Sheet", pos: "b", h: 48 }
n8@{ icon: "mdi:message-outline", form: "rounded", label: "Send Forecast Email", pos: "b", h: 48 }
n5 -.-> n3
n4 -.-> n3
n0 --> n1
n2 --> n3
n3 --> n6
n1 --> n2
n6 --> n7
n7 --> n8
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 ai
class n5 aiModel
class n4 ai
class n1,n7 database
class n2,n6 code
classDef customIcon fill:none,stroke:none
class n2,n6 customIcon
Why This Matters: Weekly forecasts shouldn’t depend on guesswork
If your sales forecasting process is “copy last week, adjust a bit, and hope,” you’re not alone. The real cost isn’t just the time spent in Google Sheets. It’s the second-order mess: over-ordering ingredients that expire, under-ordering items that force 86’s mid-service, and the endless Slack messages asking, “What are we expecting next week?” Then there’s the mental load. You can’t plan promos, staffing, or purchasing when the numbers arrive late and feel shaky.
It adds up fast. Here’s where it usually breaks down in the real world.
- Someone exports or filters the wrong date range, so the “historical trend” is quietly off.
- Menu items get renamed or categorized differently over time, which makes manual rollups unreliable.
- The forecast lives in one person’s spreadsheet tab, and stakeholders don’t see it until it’s already outdated.
- Inventory planning turns into a safety-stock habit, and waste becomes the hidden line item.
What You’ll Build: A weekly forecast that writes itself and emails your team
This n8n workflow runs on a weekly schedule and turns your existing Google Sheets history into an actionable forecast. First, it pulls your past sales and raw material usage from a structured sheet (week/date, menu item, sales quantity, revenue, material used, inventory level, category). Then it reshapes that data into a clean input for an AI forecasting agent powered by Google Gemini, which looks for trends, seasonality, and patterns you might miss when you’re rushing. After that, the workflow parses the AI output into readable JSON, appends the new forecast rows into a dedicated “Forecast Output” sheet, and emails a summary through Gmail to stakeholders who need to plan purchasing and prep.
The workflow starts with a scheduled kickoff. Google Sheets provides the historical data, Gemini generates the prediction, and Gmail delivers the result. Your forecast ends up in two places: logged back to Sheets for tracking, plus a clean weekly email for quick decisions.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you run a weekly forecast for 25 menu items and share it with 6 stakeholders. Manually, it’s common to spend about 2 hours pulling the right date range, cleaning categories, updating formulas, and then drafting an email that explains what changed. With this workflow, the weekly trigger runs automatically, Gemini generates the forecast, and Gmail sends the summary once the rows are logged. Most teams get that “forecast session” down to a quick 10-minute review.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets for your historical sales and inventory data.
- Gmail to email weekly forecasts to stakeholders.
- Google Gemini API credentials (get it from Google AI Studio / Google Cloud console).
Skill level: Intermediate. You’ll be connecting accounts, matching sheet columns, and lightly adjusting prompts or data formatting.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
Weekly schedule trigger. The workflow starts automatically at the time you choose (for example, early Monday morning) so the forecast arrives before purchasing decisions.
Pull historical data from Google Sheets. n8n loads your past weekly sales, revenue, raw material used, inventory level, and category fields, using the sheet as the single source of truth.
Prepare the dataset for the AI forecast. The workflow reshapes rows into a structured input so the AI agent can detect trends without getting confused by messy columns or inconsistent text.
Generate, parse, and store the forecast. Google Gemini produces predicted sales and recommended inventory/material requirements, n8n parses the response into clean JSON, and then appends the results into your Forecast Output sheet.
Email the weekly summary via Gmail. Stakeholders receive the forecast in their inbox, so planning happens from a shared view instead of scattered messages and screenshots.
You can easily modify the AI prompt and the email summary to match your menu structure and reporting style. 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 on a weekly schedule for forecasting.
- Add and open Scheduled Forecast Kickoff.
- Set the schedule rule to weekly by configuring Interval with Field =
weeksand Trigger At Hour =20.
Step 2: Connect Google Sheets
Pull historical sales data and prepare the destination sheet for forecasts.
- Open Retrieve Past Sales Sheet and set Document ID to
[YOUR_ID]and Sheet Name tocurrent data. - Credential Required: Connect your googleApi credentials in Retrieve Past Sales Sheet.
- Open Append Forecast to Sheet, set Operation to
append, Document ID to[YOUR_ID], and Sheet Name toprediction data. - Keep Columns mapping as
autoMapInputDatawith the listed forecast fields (e.g.,Date,Neapolitan Pizza Sold,Flour (kg)). - Credential Required: Connect your googleApi credentials in Append Forecast to Sheet.
Step 3: Set Up AI Forecasting
Shape the sheet data and generate a forecast using the AI agent and Gemini model.
- Open Shape Data for AI and keep the JavaScript Code as provided to bundle all rows into a single payload.
- Open AI Forecast Generator and set Text to
={{ $json.data }}. - Confirm AI Forecast Generator includes the system message and is configured for Prompt Type =
define. - Open Gemini Chat Model and set Model Name to
models/gemini-2.5-pro. - Credential Required: Connect your googlePalmApi credentials in Gemini Chat Model.
- Note that Reasoning Helper Tool is an AI tool sub-node connected to AI Forecast Generator; add credentials on Gemini Chat Model (parent LLM), not on the tool node.
Step 4: Configure Output Actions
Parse the AI result, append it to the sheet, and email the forecast summary.
- Open Parse AI Forecast JSON and keep the JavaScript Code that strips markdown fences and parses JSON.
- Confirm the flow from Parse AI Forecast JSON to Append Forecast to Sheet is connected.
- Open Send Forecast Email and set Send To to
[YOUR_EMAIL]. - Set Subject to
Next Monday forecastand Message to=Dear Manager,<br><br>Here is the latest weekly forecast summary.<br><br><b>Forecast Date:</b> {{ $json.Date }}<br><br><b>Sheet Reference:</b> [SHEET_REFERENCE]<br><br>Thanks,<br>Operations Team. - Credential Required: Connect your gmailOAuth2 credentials in Send Forecast Email.
Step 5: Test and Activate Your Workflow
Run the workflow end-to-end, verify the outputs, then enable it for weekly forecasting.
- Click Execute Workflow to trigger Scheduled Forecast Kickoff manually.
- Verify Retrieve Past Sales Sheet outputs rows and Shape Data for AI consolidates them into a single
datapayload. - Confirm AI Forecast Generator produces a JSON forecast and Parse AI Forecast JSON returns parsed fields.
- Check that Append Forecast to Sheet adds a new row and Send Forecast Email delivers the summary.
- Toggle the workflow to Active so Scheduled Forecast Kickoff runs weekly at
20:00on the defined schedule.
Troubleshooting Tips
- Google Sheets credentials can expire or lack access to the right spreadsheet. If runs start failing, check the Google connection in n8n and confirm the file is shared with the connected account.
- If you adjust the schedule or add extra processing, timing can change. When downstream nodes fail on missing data, it’s usually because the AI response wasn’t parsed correctly or returned a different shape than expected.
- Gemini outputs are only as good as the instructions you give it. The default prompt can be too generic, so add your category rules and naming conventions early or you will be editing forecasts every week.
Quick Answers
About 30 minutes if your Sheets and accounts are ready.
No. You’ll mostly connect Google accounts and map the right sheet columns. There are “code” steps in the workflow, but you can usually use the provided defaults.
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 Google Gemini API usage costs, which depend on how much text you send and generate each week.
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.
Yes, and you probably should. The easiest change is updating the “Generate Forecast with AI” step (the Gemini chat model inside the AI Agent) so it focuses on your categories, seasonality rules, and how you define “recommended inventory.” You can also adjust the “Shape Data for AI” step to include extra columns like promos or holidays. Many teams tweak the Gmail email body to highlight top risers, likely low-stock items, and a short “what changed this week” note.
Usually it’s permissions or the spreadsheet ID changing. Reconnect your Google Sheets credentials in n8n, confirm the right Google account has access to the file, and double-check the selected worksheet/tab. If it fails only sometimes, rate limits can also show up when you pull large ranges.
For a typical restaurant sheet (dozens to a few hundred rows per week), it runs comfortably on n8n Cloud Starter and scales fine as history grows. If you self-host, execution limits aren’t the constraint; your server resources are. The practical bottleneck is usually how much data you feed the AI each run, so consider summarizing older history into weekly aggregates.
Often, yes. This workflow isn’t just “move rows and send an email.” You’re reshaping data, generating an AI forecast, parsing structured JSON, appending records, and then sending a stakeholder-friendly summary. n8n handles branching and data wrangling without feeling like you’re fighting the tool, and self-hosting is there if you don’t want execution limits. Zapier or Make can still work if your version is very simple, but the moment you want better prompts, validations, or richer formatting, n8n is usually the calmer place to build. If you’re on the fence, Talk to an automation expert and get a straight recommendation.
Once this is running, your weekly forecast becomes a routine output instead of a recurring fire drill. The workflow handles the repetitive prep work so you can make better calls, faster.
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.