How to Track Restaurant Waste with MarketMan and Slack Alerts
Monitor food waste data from MarketMan and alert your team when waste exceeds targets.
What This Integration Does
Food waste is the single largest controllable cost in most restaurants, and it almost always grows quietly until someone runs a month-end report. This workflow surfaces waste as soon as it's logged in MarketMan: it tots up waste events daily, compares against per-category targets, and pings the kitchen-leadership Slack channel when something crosses the line. The point isn't to embarrass anyone - it's to give the chef a same-day signal that prep was off or storage failed.
The workflow runs daily after service, fetches the previous day's waste events from MarketMan, sums them by category and reason code, compares against thresholds you configure once (in dollars, kilos, or percent of category usage), and posts a structured Slack summary. If any category busts its target, the message escalates with a bolded heading, the top offending items, and a suggestion to investigate. Otherwise it sends a tidy "all good" digest.
Prerequisites
- A MarketMan connection with permission to read waste events and inventory items.
- A Slack connection with permission to post to your operations channel.
- Per-category waste targets defined somewhere the workflow can read - either as a workflow variable, a JSON file via the http connector, or a MongoDB collection.
- Staff trained to log waste in MarketMan (with reason codes) - the workflow's signal is only as good as what gets logged.
Step 1: Schedule Trigger
Drop a Trigger node and set it to Schedule. Run it at 23:30 local time after service has closed, or at 07:00 the next morning if you'd rather the chef see it with coffee. Both work; the data is the same.
Step 2: Compute the Reporting Window
Add a Variable assignment using the date connector to compute windowStart and windowEnd covering yesterday's trading day in venue-local time. If your venue runs a late trading day, use start-of with a 04:00 offset so the window aligns with how the kitchen actually thinks about a service.
Step 3: Fetch Waste Events from MarketMan
Add a Connector node pointing at marketman. If your connection requires manual token auth, call get-token first. Then call get-waste-events scoped between {{ windowStart }} and {{ windowEnd }}. Store as {{ wasteEvents }}. Each event includes the item, quantity, unit, reason code, and (usually) a dollar value.
Step 4: Aggregate by Category and Reason
Add a Transform node that groups wasteEvents two ways:
- By category - total quantity and total dollar value for each food category.
- By reason code - so spoiled / expired / over-prep / dropped each get their own line.
Also compute the per-category waste percent if you have category usage handy (fetch get-inventory-items or a sales summary in parallel). Percent-of-usage is the metric most chefs steer by; raw dollars alone don't tell you whether a $200 protein-waste day is a disaster or a Tuesday.
Step 5: Compare Against Targets
Add a Condition node that walks through each category and flags any where the aggregated value exceeds the configured target. Mark the worst three items in the breached category for inclusion in the alert. Store the resulting list as {{ breaches }}. If breaches is empty, the daily digest is the "all good" path. If it isn't, you're sending an escalation.
Step 6: Post Summary to Slack
Add a Connector node pointing at slack and pick send-message. Compose a Block Kit message with three sections:
- Header: trading day, total waste $ and kg.
- By category: each row showing today's value vs target, with a green check or red X.
- Top offenders: the three line items contributing most, with reason codes.
For breach days, set the message to also mention the kitchen lead via <@USERID> so it pings them. For clean days, post quietly without the mention. Pin the breach messages with pin-message so they don't scroll away before the next prep meeting.
Tips
- Steer by percent, not dollars - waste in absolute terms scales with the size of service. Compare waste against revenue or category usage for a meaningful trend line.
- Surface reason codes - "expired" vs "over-prep" vs "drop" have totally different fixes. Don't aggregate them away before the chef sees the breakdown.
- Weekly rollup - clone this workflow to run weekly with a 7-day window. Daily catches incidents; weekly catches drift.
Common Pitfalls
- Inconsistent logging - if night staff dump waste without entering reason codes, half the value of this workflow disappears. Make logging part of the close-down checklist.
- Unit mismatch - MarketMan can record waste in recipe or purchase units. Normalize to one unit (usually purchase) in the Transform step before summing.
- Alert fatigue - if the breach threshold is set too tight, the team will mute the channel within a week. Tune thresholds from real data after the first month rather than guessing day one.
Testing
Pick a recent day with known waste, run the workflow manually, and confirm the Slack output matches your end-of-day report from MarketMan exactly. Temporarily set a target to an unrealistically low value to confirm the breach path renders correctly with the mention and the top-offender list. Then revert the target and enable the schedule.