Every festival, a sweet shop makes one of two mistakes: trays of leftover sweets on the day after, or an empty counter by evening while customers walk out. Both come from guessing. Festival demand forecasting automation replaces the guess with the shop’s own past sales, lined up the right way, and sends a production plan to the owner ten days before each festival for approval.
Festivals move on the calendar every year, so comparing the same calendar date across years compares the wrong days. The fix is to count days from the festival itself. The day of the festival is offset 0, the day before is −1, two days before is −2, and so on.
day offset = (sale date − festival date) in days
Now “three days before the festival” means the same thing every year, whatever the date. For a big festival I look at a window from 5 days before to 1 day after. Shorter festivals use 3 days before to 1 day after, and bakeries usually only need about 2 days before up to the festival day.
Daily Sales has one row per item per day: Date, Item, Quantity Sold, Leftover at closing, Sold Out Time, and an Estimated flag for old rows filled from memory or notebooks. Festival Calendar is filled once a year with Festival, Date, Days Before and Days After. Pre-Orders records Customer, Item, Quantity and Pickup Date. Production Plan is written by the automation: Item, Date, Planned quantity and the raw material needed.
The most important column is Sold Out Time. Without it, the history only shows what the shop had, not what customers wanted.
If an item sold out at 5 pm, the real demand was higher than the quantity sold. The automation estimates it from the hours the item was actually on the counter:
Example, with illustrative numbers: a shop open from 8 am to 9 pm has 13 open hours. An item that sold 90 kg and ran out at 5 pm was on sale for 9 hours. Corrected demand = 90 × 13 ÷ 9 × 0.8 = 104 kg. The 0.8 keeps the estimate cautious, because evening sales are rarely as strong as afternoon sales.
Rows marked Estimated count at half weight, so remembered numbers never outweigh real ones.
For each item and each day offset, the automation takes the weighted average of the last two years. It then applies a growth factor, which compares this year’s normal weeks with last year’s normal weeks for the same item, so a shop that has grown 15% plans 15% more.
Last comes a buffer that depends on shelf life:
| Item type | Buffer |
|---|---|
| Long-life sweets, such as dry fruit barfi | 10% |
| Cakes and bread | 5% |
| Fresh cream items and anything that spoils within a day | 0% |
Anything that spoils the same day gets no buffer at all. Pre-orders cover those instead.
Pre-orders are the clearest signal a shop gets. When bookings for an item and pickup day reach 70% of the planned quantity, the plan is raised:
new planned = planned × 0.6 + booked, rounded up
The 0.6 is the share of festival sales that walks in without booking. It differs per shop and is learnt by comparing the Pre-Orders tab with Daily Sales after each festival. For example, if 50 kg is planned and 36 kg is already booked, the new plan is 50 × 0.6 + 36 = 66 kg, and the kitchen gets an alert at once.
A Schedule Trigger runs every morning at 6 am. It reads the Festival Calendar and continues only when a festival is exactly ten days away. It then reads Daily Sales for the same festival in the previous two years within the festival window, and two Code nodes do the work above: one lines rows up by day offset and corrects sold-out days and estimated rows, the other applies growth and buffers.
An AI step reads the free-text Notes tab, for example a road closure or a new competitor nearby, and may suggest a change only when it can quote a written reason from those notes. With empty notes, it suggests nothing. The plan then goes to the owner on Telegram with Approve, Edit and Reject buttons and a confidence label. Approved quantities are written to Production Plan with the raw material for each tray, using the same per-batch recipe amounts as bakery recipe scaling with baker’s percentage. A separate trigger watches the Pre-Orders tab for the 70% rule.
Every Google Sheets step retries three times with a five-second wait, and an error workflow sends the owner a Telegram alert if anything fails. When a shop has only one year of history, the plan is marked Low Confidence and the buffer is raised slightly. The n8n documentation covers the Schedule, Telegram and AI Agent nodes used here.
Before using the forecast live, run it as if it were ten days before a festival that has already happened, using only the data that existed then, and compare the plan with what actually sold. I run this on at least two past festivals. The usual fixes after back-testing are setting the buffer on fresh cream items to zero and making sure office gift-box bookings are entered in Pre-Orders, because they are the easiest orders to miss.
n8n and Activepieces can both be self-hosted for free, with a small charge only for the AI step. Make and Zapier can run the same flow but bill by operations or tasks. A shop that wants zero cost can use Google Sheets with Apps Script: a daily time trigger, a Day Offset column, a pivot table by item and offset, and an email when a festival is ten days away, without the AI step.
The festival rush also brings its own risks, so it is worth knowing how to check a fake UPI payment screenshot before handing over large orders. Shops that already plan around a local festival calendar will find most of the inputs are already in place, and the same production plan can feed menu costing so festival prices are set on real costs.
The one number to start writing down today is the sold-out time of every item. Even a shop that is not ready for automation will have a far better forecast next year because of it.
1 Comment
[…] festival orders are where scaling matters most, so it pairs well with a festival demand forecast made a few weeks ahead. Home bakers selling regularly should also have their FSSAI registration in […]