Back to Alchemy
Alchemy RecipeIntermediateautomation

Automate restaurant menu engineering with sales analysis and supplier cost optimisation

Most restaurant managers make menu decisions based on what they think customers want, not what the data says. A dish that feels popular might be bleeding money; another that seems niche could be a margin goldmine. The result: menus that drift further from profitability each quarter, staff confusion about what to promote, and missed opportunities to negotiate better supplier pricing based on actual purchasing patterns. Restaurants that implement data-driven menu engineering see 15-20% margin improvements within six months. The catch is that most don't have access to the tools or the time to analyse their sales data, cross-reference it with supplier costs, and then brief their copywriters on what to emphasise. It's a workflow that requires moving data between five different systems, often with manual handoffs that introduce delays and errors. This post shows you how to automate that entire process. You'll connect your sales data to cost analysis, generate data-backed supplier quotes, and produce optimised menu copy, all without touching a spreadsheet.

The Automated Workflow

The workflow runs on a schedule, typically weekly or after a major sales cycle. It pulls your sales data, identifies high-margin and low-margin dishes, requests updated supplier pricing for low-margin ingredients, and generates rewritten menu descriptions that emphasise the profitable dishes. We'll use n8n as the orchestrator because it's self-hosted, has strong native support for scheduling and conditional logic, and integrates cleanly with both APIs and webhooks. If you prefer a hosted solution, Zapier works just as well, though you'll lose some of the granular control around error handling.

Step 1: Trigger and data collection

The workflow starts on a fixed schedule (say, Monday at 6 AM). n8n pulls your sales data from your POS system via API or CSV upload. Most modern POS systems (Toast, Square, Lightspeed) provide an API endpoint that returns transaction data filtered by date range. For this example, assume you're pulling from a generic REST API that returns JSON sales data:

GET /api/v2/sales?start_date=2026-03-01&end_date=2026-03-07&group_by=item

The response includes item name, quantity sold, revenue, and cost of goods sold (COGS).

json
{ "items": [ { "id": "dish_001", "name": "Pan-seared salmon", "quantity_sold": 156, "revenue": 4680, "cogs": 1560, "margin_percent": 66.7 }, { "id": "dish_002", "name": "House pasta", "quantity_sold": 203, "revenue": 4060, "cogs": 1625, "margin_percent": 60.0 } ]
}

Step 2: Analyse margins in Deepnote

Once n8n fetches this data, it triggers a Deepnote notebook via webhook. Deepnote is a collaborative data science environment where you can run Python to segment dishes into margin tiers and identify your top-margin and bottom-margin items. The notebook performs these calculations: - Sorts dishes by margin percentage and profit contribution;

  • Flags any dish in the bottom quartile with volume above 50 units/week as "cost optimisation target";
  • Identifies which supplier ingredients appear most frequently in low-margin dishes. n8n sends the raw JSON sales data to Deepnote via a POST request to your notebook's webhook:
POST https://deepnote.com/api/v1/projects/{project_id}/notebooks/{notebook_id}/webhook
Content-Type: application/json { "sales_data": { ... }, "analysis_date": "2026-03-07", "target_margin_threshold": 0.60
}

Deepnote produces an output JSON file containing three lists: high-margin dishes, low-margin dishes, and supplier targets.

Step 3: Request supplier quotes

n8n takes the supplier targets list and feeds it into Estimatic AI, which generates cost estimates for bulk orders of specific ingredients. You configure Estimatic with your supplier relationships upfront; it then queries available pricing for salmon fillets, pasta, etc. at the volumes you typically order. The n8n node hits Estimatic's API:

POST https://api.estimatic.ai/v2/estimates
Content-Type: application/json
Authorization: Bearer {ESTIMATIC_API_KEY} { "items": [ { "supplier_id": "sup_045", "ingredient_name": "Atlantic salmon fillet, 6oz", "volume_units": 200, "unit_type": "pieces" } ], "delivery_date": "2026-03-14", "request_format": "json"
}

Estimatic returns updated costs. If the new cost is lower than your current COGS, n8n flags that saving for the next step.

Step 4: Generate menu copy

Armed with margin analysis and updated supplier costs, n8n sends data to Copy.ai, which generates refreshed menu descriptions. You provide Copy.ai with a brief that includes the dish name, current description, and a fact about its margin or ingredient quality.

POST https://api.copy.ai/v1/generate
Content-Type: application/json
Authorization: Bearer {COPY_AI_API_KEY} { "project_id": "rest_menu_2026", "content_type": "menu_item_description", "briefs": [ { "dish_name": "Pan-seared salmon", "current_description": "Fresh salmon with seasonal vegetables", "tone": "premium, ingredient-focused", "highlight": "67% margin, locally-sourced Atlantic salmon", "max_words": 25 } ]
}

Copy.ai returns new descriptions optimised to highlight the margin drivers. For low-margin dishes, the copy shifts focus to justify the price or mentions cost-saving opportunities ("now sourced directly from our supplier partner").

Step 5: Consolidate and export

n8n gathers the outputs: updated descriptions from Copy.ai, supplier quotes from Estimatic, and margin analysis from Deepnote. It formats everything into a markdown report and sends it via email to your manager, or posts it directly to a Slack channel:

POST https://hooks.slack.com/services/{YOUR_WEBHOOK_URL}
Content-Type: application/json { "text": "Weekly Menu Engineering Report", "attachments": [ { "title": "High-Margin Dishes (Promote)", "text": "Pan-seared salmon (67%), House pasta (60%)" }, { "title": "Supplier Opportunities", "text": "Save £240/month on salmon by switching to Atlantic Catch Ltd" } ]
}

Throughout this workflow, n8n handles all conditional branching. If Estimatic returns no quotes, n8n skips that supplier and logs the failure. If the margin analysis finds no actionable items, the workflow still completes but sends a summary saying "all dishes within healthy range". Error handling is built in; failed steps trigger alerts rather than silent failures.

The Manual Alternative

If you prefer human review at critical junctures, you can pause the workflow at Step 3. After Deepnote produces the margin analysis, n8n sends you a summary and waits for your approval before requesting supplier quotes. You might review the identified cost-saving opportunities, verify that your preferred suppliers are listed, and then click "Proceed" to continue. This adds a day or two to the cycle but gives you control over which suppliers you engage and lets you catch data anomalies before they influence copy decisions.

Pro Tips

Start with a pilot menu section.

Run the workflow first on appetisers or desserts only, not your entire menu.

That lets you validate the accuracy of your POS data and the quality of Copy.ai output before scaling.

Monitor Estimatic rate limits.

Estimatic throttles requests to 10 per minute for free accounts. If you have more than 10 ingredients to quote weekly, upgrade to their professional tier or stagger requests across two workflow runs.

Use Claude Opus 4.6 as a fallback for margin analysis.

If you don't have a Deepnote subscription, you can replace that step with an n8n call to Claude Opus 4.6 via the Anthropic API. Feed Claude your raw sales JSON and ask it to segment dishes and flag cost targets. It's slower than a Deepnote notebook but works without extra tooling.

Build a historical margin table.

Store the weekly margin outputs in a simple SQLite database or Google Sheet. After six weeks, you'll see which dishes are consistently high or low margin, which helps you spot seasonal shifts rather than react to one-week anomalies.

Validate supplier quotes against your current contracts.

Before Copy.ai rewrites a description to emphasise "direct-sourced Atlantic salmon", cross-check that you've actually negotiated a new rate with that supplier. Add a manual verification step to Estimatic results if your supplier relationships are complex or have minimum order quantities.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
n8nSelf-hosted (free)£0Run on your own server; optional paid cloud hosting is £25+
DeepnoteFree or Pro£0–£50Free tier works for weekly analysis; Pro for faster compute
Estimatic AIProfessional£100–£200Depends on quote volume; free tier limited to 10 requests/min
Copy.aiStarter£49Includes 150k words/month; most restaurants need less
SlackFree or Pro£0–£12.50Webhook integration is free on any plan
POS system API accessExisting plan£0Assuming you already subscribe to Toast, Square, or similar