Track menu food costs and flag margin erosion with GPT-6-luna, Google Sheets and Gmail
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
What it does
Food cost creep is quiet. A supplier puts up the price of chicken, nobody updates the recipe card, and the damage only shows up at month end. This n8n workflow keeps every recipe cost current, recomputes what each menu item costs to make, and emails you the moment an item passes its target food cost. Last updated: October 2026. Quick Overview This workflow takes supplier price updates through a webhook, logs them to the Prices tab of a Google Sheets tracker, and recomputes every recipe cost from the latest ingredient prices. A daily sweep at 06:00 flags any menu item whose food cost has passed its target, logs it to the CostAlerts tab and emails an alert listing each flagged recipe with its portion cost and percentage. Every Monday at 07:00 gpt-6-luna reads the week's cost stats and writes one plain-text digest with the worst items and the menu prices that would bring them back in line. How it works 1. Receives a price change on the "When Price Update Received" n8n webhook (POST path menu-cost-intake-0926) and normalizes ingredient, unitprice, unit, supplier, submittedby and owneremail, stamping an updateid and a received timestamp. 2. Validates that ingredient and unitprice are present. If either is missing, the price is not logged and a rejection email lists the required fields and the payload that was received. 3. Appends valid updates to the Prices tab (ingredient, unitprice, unit, pricedate, supplier, submittedby, updateid) and sends a confirmation email naming the ingredient, the new price and the reference. 4. Runs the Daily Margin Sweep at 06:00, reading the Prices, Recipes and Menu tabs. 5. Compute Recipe Costs takes the newest price per ingredient by pricedate, multiplies each recipe line's qtyperportion by that price, and works out costperportion and costpct against the item's saleprice and targetcostpct. Ingredients with no price are listed in missingingredients. 6. Any item whose costpct is above targetcostpct is flagged, appended to the CostAlerts tab with alertdate, recipe, costperportion, costpct, targetcostpct and status flagged, and gathered into one email headed "Menu margin alert: N item(s) over target" that shows portion cost, food cost against target and any missing prices. 7. Runs the Weekly Menu Digest every Monday at 07:00, re-reading the three tabs and computing menuitems, flaggedcount, flaggedrecipes, the three worst items, avgcostpct and the best-margin item. 8. Passes those stats as JSON to the AI Write Digest agent, which writes a plain-text body under 180 words naming the biggest problems first, suggesting a menu price close to portion cost divided by target cost, and saying what to check with suppliers. 9. Emails that digest as "Weekly menu cost digest". If nothing is flagged, it says the menu is in good shape and names the best-margin item. Setup 1. Create a Google Sheets file with four tabs: Prices, Recipes, Menu and CostAlerts. 2. Add the columns the nodes use: ingredient, unitprice, unit, pricedate, supplier, submittedby, updateid in Prices; recipe, ingredient, qtyperportion in Recipes; recipe, saleprice, targetcostpct in Menu; alertdate, recipe, costperportion, costpct, targetcostpct, status in CostAlerts. 3. Replace the sample rows with your own ingredients, recipes and menu items, and point the Google Sheets nodes at your own spreadsheet. 4. Add credentials for Google Sheets OAuth2, Gmail OAuth2 and an OI chat model. 5. Set the recipients: the webhook accepts owneremail in the payload, and the margin alert and weekly digest nodes use a placeholder address. 6. POST price updates to /webhook/menu-cost-intake-0926 sending ingredient and unitprice, plus optional unit, supplier, submittedby and owneremail. 7. Confirm the 06:00 sweep and the Monday 07:00 digest match your timezone, then activate the workflow. Quick Answers What counts as margin erosion here? Each menu item carries a targetcostpct in the Menu tab. The sweep divides the recomputed portion cost by the sale price, and when that per