Downloads
Download the n8n workflow (JSON)
daily-closing-sales-report-n8n-claude.json · n8n workflow · 20 steps · starts with Every day 9 PM · uses Google Sheets, Anthropic, WhatsApp, Gmail · 32 KB
Import into n8n: Create Workflow, then the menu, then Import from File.
How to import it into n8n
- In n8n, create a new workflow.
- Open the ⋯ menu at the top right and choose Import from File, then pick the downloaded .json. (Or open the file, copy everything and paste it on the canvas.)
- Open each node with a warning and connect your own account: the file carries no passwords or keys.
- Run it once with Test workflow, check the result, then switch it to Active.
What this workflow does
Every night at 9 PM it reads today's bills from your POS export sheet, your stock levels and the cash your cashier counted. A Code node does every sum: total sales, bill count, cash vs UPI vs card, top items, voided bills, the cash drawer gap and items below their reorder level. Claude turns those numbers into five short lines, and the report lands on the owner's WhatsApp at 9:01 PM. If something needs reordering, you get one approval email. Approve, and the order goes to your distributor.
No more "aaj kitna hua?" calls to the counter at 10:40 PM.
Who it is for
Kirana and general stores, pharmacies, restaurants and cafes, and owners running two or three outlets who are not at the counter every night.
What you need
- An n8n account (Cloud or self-hosted)
- A Google Sheet that your POS exports to (most billing apps can export a day's bills as CSV; paste it into the
Salestab or use the POS's own Sheets sync) - An Anthropic API key for Claude
- A WhatsApp Business Cloud API number and one approved utility template
- Gmail, for the reorder approval and the backup report
The workflow, step by step
Step 1 · At 9 PM, n8n pulls the day
Every day 9 PM starts the run. Set report date holds today's date, last week's date, your shop name, the owner's WhatsApp number and the cash float. Check report log looks in the Reports tab and Already sent today? stops the run if tonight's row already says Sent, so a manual re-run never sends twice. Then Get today's bills, Get stock levels, Get counted cash and Get last week's total read the four tabs.
Step 2 · Code does the maths, not AI
Total up the day adds up live bills (voided bills are counted separately), splits payments into Cash, UPI and Card, ranks the top 5 items by value, finds every item at or below its reorder level and works out the cash gap: counted cash minus (float + cash sales).
Step 3 · Claude writes 5 lines you can read
Write closing summary sends the numbers to Claude with strict rules: use only these numbers, one line each, mention a cash gap or many voids. Summary format forces five named fields. Check Claude's numbers then confirms the sales line contains the exact Code total; if not, it uses a plain line instead.
Step 4 · The report lands on WhatsApp
Send to owner sends the closing_report template with the five lines as variables. Log the day writes the totals to the Reports tab with Status Sent (matched on Date). If WhatsApp fails, its error output goes to Report failed alert, which emails the same report.
Step 5 · Reorder with one tap
Any low stock? checks the list. Approve reorder emails you the items with suggested quantities and Approve / Reject buttons. Reorder approved? lets only an Approve through to Email supplier order, which emails your distributor. A failed send also goes to Report failed alert.
Setup
- Import the JSON into n8n (Create Workflow → ⋯ → Import from File).
- Create the Google Sheet with tabs
Sales,Stock,Cash countandReports(columns are in the Setup sticky note) and paste its ID into every Sheets node. - Connect Anthropic on Claude, WhatsApp on Send to owner, and Gmail on the three Gmail nodes.
- In Meta Business Manager, create a utility template named
closing_reportwith six body variables, one per line, and wait for approval. Put your phone number ID in Send to owner. - Edit Set report date: shop name, owner number, emails, cash float.
- Add a few test bills for today, click Execute workflow, and check WhatsApp and the
Reportstab. Then activate.
How to customise
- Different closing time: change the cron in Every day 9 PM (
0 22 * * *is 10 PM). - Several outlets: add an Outlet column to
Sales, and loop the workflow per outlet or group by outlet in Total up the day. - Several suppliers: add a Supplier email column to
Stockand group the reorder list by it. - Hindi report: add "write in simple Hindi" to the Claude system message. The numbers check still works because the total is written in digits.
Guardrails
- Every number comes from the Code node. Claude only words it, and a check rejects a sales line that does not match.
- Nothing is ordered from a supplier until you tap Approve.
- The report is logged once per day; a re-run does not send a second message.
Troubleshooting
- Template error from WhatsApp: variables cannot contain line breaks or more than four spaces in a row. The check node already strips them; make sure the template has exactly six variables.
- Totals look wrong: check the
Line totalandPaymentheaders match your POS export, and that amounts are numbers, not text like "Rs. 285". - Cash gap always large: set the real opening float in Set report date.
- No approval email: Gmail send-and-wait needs your n8n instance reachable from the internet so the buttons can call back.
Want the members-only resources too?
A free account unlocks them all, including the ones shared in DMs.

