Downloads
Download the n8n workflow (JSON)
weekly-cash-flow-forecast-n8n-claude.json · n8n workflow · 20 steps · starts with Every Monday at 9 AM · uses Google Sheets, Anthropic, WhatsApp, Gmail · 34 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 Monday at 9 AM, n8n reads your latest bank balance, unpaid customer invoices and upcoming bills from Google Sheets, plus unpaid Razorpay payment links. A code step spreads every amount over the next 4 weeks and calculates the closing balance for each week, against a minimum buffer you choose. Claude then explains the numbers in plain words: which week is tight, why, and what you could do about it. You get a short WhatsApp and the full table by email. For overdue invoices, Claude drafts polite payment reminders; you approve them in one email and they go to your customers.
Who it is for
Founders and owners of small and mid-sized businesses without a full-time CFO: traders, manufacturers, agencies, clinics, D2C brands. Anyone who has ever found out about a cash crunch from the bank app two days before salaries.
What you need
- n8n (Cloud or self-hosted), time zone set to Asia/Kolkata
- A Google Sheet with four tabs (bank balance, money due in, bills due out, forecast log)
- A Razorpay account, if you use payment links (optional)
- An Anthropic API key for Claude
- A WhatsApp Business Cloud API number and Gmail
The workflow, step by step
Step 1 · Every Monday, one run
Every Monday at 9 AM the check starts. A guard makes sure it runs only once a week, even if someone clicks run again.
- Every Monday at 9 AM (Schedule Trigger).
- Already ran this week? (Remove Duplicates on the ISO week).
Step 2 · Money in, money out, balance
n8n reads your latest bank balance, unpaid customer invoices and upcoming bills from Google Sheets, plus unpaid Razorpay payment links. Salary, rent and EMIs repeat every month automatically.
- Bank balance, Money due in and Bills due out (Google Sheets).
- Razorpay payment links (HTTP Request to
https://api.razorpay.com/v1/payment_links): links that are created or partially paid count as money due in.
Step 3 · The 4-week view, in code
A code step spreads every amount into the next 4 weeks and works out the closing balance each week. Overdue invoices are flagged, not trusted. Every number is calculated here, never by AI.
- Build 4-week view (Code): opening, in, out and closing per week; the lowest week; a severity of ok, watch or danger; overdue invoices and the top 5 to chase.
- Log forecast (Google Sheets, append or update on Week of): your weekly history.
Step 4 · Claude flags the risks
Claude reads the numbers and explains them in plain words: which week is tight, why, and what you could do. You get a short WhatsApp and the full table by email.
- Explain risks with Claude (Basic LLM Chain) with Claude (temperature 0.2) and Forecast fields (Structured Output Parser).
- WhatsApp summary (WhatsApp template
cashflow_weekly). - Email the forecast (Gmail, HTML table with tight weeks shaded). It also receives WhatsApp's error output, so you always get the forecast.
Step 5 · Chase overdue, after your OK
Claude drafts polite payment reminders for the biggest overdue invoices. You get one email with the list. Tap Approve and each customer gets their reminder, and the sheet records it.
- Anyone to chase? (IF), Approve payment reminders (Gmail Send and Wait) and Approved? (IF).
- Split chase list (Code): one reminder per customer, with the email address taken from your sheet.
- Send payment reminder (Gmail), Mark reminder sent (Google Sheets) and Alert: reminder failed (WhatsApp, on the error output).
Setup
- Import the JSON into n8n and set the workflow time zone to Asia/Kolkata.
- Create the tabs:
-
Bank balance: Date, Balance. Ask your accountant to add one row every Friday evening. -Money due in: Invoice, Customer, Email, Amount, Received so far, Due date, Expected date, Status, Last reminded. -Bills due out: Bill, Amount, Due date, Repeats (monthly or blank), Day of month, Status. Add salaries, rent, EMIs, GST and TDS payments, and supplier bills. -Forecast log: Week of, Opening, W1 to W4 closing, Lowest week, Severity, Overdue total. - In Razorpay, create API keys (Settings > API Keys) and add them to an n8n Basic Auth credential on Razorpay payment links. If you do not use payment links, delete that node and connect Bills due out straight to Build 4-week view.
- Set your minimum cash buffer in Build 4-week view (
BUFFER). - Create the WhatsApp utility template
cashflow_weeklywith one variable. ReplaceYOUR_PHONE_NUMBER_ID,91YOUR_NUMBER,YOUR_SHEET_IDand your email address. - Run it once by hand and compare the 4-week table with what your accountant expects. Then activate.
How to customise
- Tally or Zoho Books: export outstanding receivables and payables to the sheet weekly, or replace the sheet reads with API calls.
- Razorpay settlements: add a call to
/v1/settlementsto count captured payments that will settle this week. - Weekly reminders only for big amounts: filter the chase list in code, for example invoices above Rs 50,000.
- Shared with your CA: add the CA's email to Email the forecast.
Guardrails
- Every number is calculated from your sheets, not by AI. Customer reminders go out only after you tap Approve.
- Customer email addresses come from your sheet, never from Claude.
- Claude is told never to suggest loans, tax changes or anything that is not a simple business action.
- The workflow only reads Razorpay and your sheets. It never moves money.
- A forecast is only as good as its inputs: if the bank balance is more than 7 days old, Claude flags it.
Troubleshooting
- Opening balance is 0: the
Bank balancetab needs a Date in dd/mm/yyyy and a number in Balance. - Salaries missing: set Repeats = monthly and Day of month = 1 for that row.
- Razorpay 401 error: check the key id and secret, and that you use live keys for live data.
- Reminders not sent after approval: the Invoice in Claude's draft must match the sheet exactly; check Split chase list output.
- Ran twice on Monday: it should not; the weekly guard stops the second run.
Want the members-only resources too?
A free account unlocks them all, including the ones shared in DMs.

