How to Use AI to Forecast Restaurant Inventory Needs

Use AI to analyze historical sales data and predict upcoming inventory requirements.

What This Integration Does

Purchasing decisions in a restaurant are usually a mix of gut feel, last week's order, and whatever the manager remembers about the upcoming week. This workflow replaces that with a weekly forecast that combines historical sales velocity, current on-hand stock, and known calendar context (weekend, holiday, local event), then posts a suggested order list for human review before anything is bought.

The workflow runs once a week on a schedule, typically the day before your standing supplier order is due. It pulls four weeks of consumption history and live inventory counts from MarketMan, asks the Spojit AI Agent to forecast next week's demand per item, computes a suggested order quantity (forecast minus on-hand, with a buffer), and posts the result to Slack or Monday.com. Nothing is ordered automatically - the output is a decision aid for whoever signs off on POs.

Prerequisites

  • A MarketMan connection with permission to read inventory items, inventory counts, and historical orders.
  • A Slack connection with permission to post to your purchasing channel, or a Monday.com connection with a board for procurement review.
  • An AI provider configured in your workspace (the Spojit AI Agent uses your default LLM).
  • A clear list of which MarketMan items you want forecasted - the workflow can be scoped by category or by buyer to keep it focused.

Step 1: Schedule Trigger

Drop a Trigger node onto the canvas and set its type to Schedule. Pick a cadence that lines up with your purchasing rhythm - weekly on Sunday evening is common for chefs who order Monday morning. The trigger fires the workflow with no payload; everything else is read at run time.

Step 2: Authenticate and Fetch Catalog

Add a Connector node pointing at the marketman connector. MarketMan's tools are organised around a short-lived token. Call get-token first if your connection uses the manual auth flow, then call get-inventory-items to retrieve the catalog. Store the result as {{ items }} - you'll need the item IDs and units of measure in later steps.

Step 3: Pull Four Weeks of Order History

Add another Connector node for marketman and pick the get-orders-by-delivery-date tool. Range it from 28 days ago to today. This gives the model real consumption signal (what was actually replenished) rather than noisy sales counts. If you also want to capture line-level waste, add a parallel call to get-waste-events over the same window and feed both into the prompt.

Step 4: Read Current On-Hand Counts

Add a Connector node calling get-inventory-counts on the marketman connector. This is what's physically on the shelf right now. Store it as {{ onHand }}. The forecast minus on-hand is what you actually need to order; without this step the AI would over-suggest.

Step 5: AI Forecast and Order Recommendation

Add an AI Agent node. Pass it the four-week history, current on-hand counts, and any calendar context you have (next week's reservations, holidays, special events). Use a prompt like:

You are a restaurant purchasing assistant. For each item below, forecast
expected consumption for the next 7 days using the 4-week history.
Subtract on-hand stock, add a 15% safety buffer, and round up to the
supplier pack size. Return JSON: [{ itemId, name, forecastQty,
onHandQty, suggestedOrderQty, reasoning }].

Constrain the output with a structured schema so downstream steps can iterate over it without parsing free text. The AI Agent will return a clean array you can pass to a Loop node if you want to enrich each line.

Step 6: Post Forecast for Human Review

Add a Connector node for slack and pick the send-message tool. Format the forecast as a readable table with item name, on-hand, suggested order, and the AI's reasoning. Include a thread reply prompting the buyer to react with a checkmark to approve. If your team works in Monday.com, swap in the monday connector and create-item to drop each line as a row on a Purchasing board instead.

Tips

  • Forecast at the right grain - forecast by purchasable unit (case, kg) not by recipe portion, otherwise suggested quantities won't match supplier packs.
  • Keep the prompt anchored in data - paste the raw history as JSON in the prompt rather than asking the model to remember trends. Determinism matters here.
  • Cache the catalog - get-inventory-items changes slowly. Run it once a day in a separate workflow and store the result in MongoDB or a JSON variable instead of fetching it every forecast.

Common Pitfalls

  • Stale on-hand counts - if staff don't reconcile inventory daily, the AI will over-suggest. Either tighten reconciliation cadence or have the prompt flag items where on-hand looks suspicious.
  • Mixing units - MarketMan can return both recipe and purchase units. Feed the model purchase units only, and convert before the prompt if needed.
  • Calendar blindness - the model won't know about a public holiday or a 200-cover function unless you put it in the prompt. Pull events from your booking system or pass them as variables.

Testing

Run the workflow manually with the schedule disabled. Inspect the AI output in the run log - confirm the forecast quantities look directionally right against what the buyer would normally order. Post to a private Slack channel first so the team can compare AI suggestions to actual orders for two or three weeks before promoting the workflow to the live purchasing channel.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.