Documented Build · v1.0
Smart Invoice Chaser & Cash-Flow Radar
Tracks overdue invoices, sends a safe friendly reminder, routes escalations through Telegram, and turns outstanding balances into a weekly cash-flow radar.
READ-ONLY ADAPTERGoogle Sheets is the demonstrated source. The included QuickBooks Online adapter is documented and intentionally disconnected.
Choose one source per installation. The guide documents the complete QuickBooks migration boundary.
The ageing policy
Every day overdue changes what the system may do.
The cadence becomes more deliberate as risk rises. Select a stage to see its control boundary.
Current
Open invoices stay visible in the weekly radar but do not enter reminder delivery before their due date.
Friendly
The workflow rereads status, balance, dispute flag, email, and currency, then sends one deterministic friendly reminder automatically.
Firm
A proposed reminder enters Approval Queue and reaches the owner in Telegram. Customer delivery waits for an explicit decision.
Urgent
The owner reviews the higher-risk escalation, with Edit, Skip, and Defer available alongside approval.
Final
A controlled final automated-stage notice can be approved without invented fees, threats, or repeated post-30-day chasing.
Weekly cash-flow radar
See the money that is late—not just the invoices that exist.
Every Monday, the system groups collectible balances by age, highlights exposure, and sends the finance owner a compact Telegram view plus an email record.
Sample data for interface demonstration—no client or performance claim.
Consistent follow-up
A balanced 1/7/14/30-day policy replaces ad-hoc chasing without turning finance messages into spam.
Paid-invoice protection
Status and balance are reread immediately before customer delivery, including after a Telegram approval delay.
Visible cash exposure
A weekly radar groups up to 500 open invoices by ageing and delivers the result to Telegram and email.
Owner control in Telegram
Resolve the escalation without opening n8n.
This visual simulator mirrors the four finance-bot actions. It does not send a message or email.
Reread, then send
The dispatcher checks the live invoice again and sends only if the current status, balance, currency, dispute flag, and recipient remain valid.
Authorized reminder + audit eventPre-send safety gate
The invoice is checked again at the last responsible moment.
A payment can arrive while an escalation waits in Telegram. The workflow therefore trusts neither the morning scan nor the saved approval snapshot at delivery time.
- Paid, void, cancelled, disputed, missing, zero-balance, and wrong-currency invoices cannot send.
- The four-hour fallback notifies the owner but cannot approve customer delivery.
- QuickBooks remains read-only and disconnected in the demonstrated build.
- Reminder wording is deterministic; an LLM is optional and provider-neutral.
- Google Sheets is suitable for one worker; transactional state is required before multi-worker scale.
Free starter files
Start with the workbook. Import the system around it.
Every release file is inactive, stripped of credentials and personal environment values, and matched to a SHA-256 integrity manifest.
Complete starter bundle
Four sanitized workflows, the tracker workbook, Docker Compose baseline, release notes, and integrity manifest.
Download ZIPInvoice tracker workbook
Invoices, Approval Queue, and Reminder Log tabs with fictional sample records.
Download XLSXFinance error handler
Safe Telegram alerts for production workflow failures.
Download JSONDaily scanner and planner
Ageing, automatic Day 1, escalation planning, and parked QuickBooks adapter.
Download JSONApproval dispatcher
Telegram actions, edited reminders, live rechecks, and SMTP delivery.
Download JSONFallback and radar
Four-hour owner fallback and weekly ageing exposure report.
Download JSONDocker Compose baseline
Optional persistent n8n self-hosting baseline with sanitized domain and timezone placeholders.
Download YAMLSanitized public release: no customer records, owner emails, live bot IDs, spreadsheet IDs, sender addresses, credential bindings, or QuickBooks company values are included.
Implementation manual
Google Sheets today. QuickBooks when you are ready.
Overview
Website summary
Turn an invoice tracker into a controlled accounts-receivable follow-up system and a weekly view of cash-flow exposure.
The Smart Invoice Chaser checks up to 500 open invoices each morning, selects the next eligible reminder stage, rereads the invoice before delivery, and records every action. A one-day friendly reminder sends automatically. Seven-, fourteen-, and thirty-day escalations wait for the owner to Approve, Edit, Skip, or Defer them in Telegram. A four-hour email fallback prevents approvals from disappearing, while the weekly radar summarizes outstanding cash by ageing bucket.
Google Sheets is the connected and demonstrated source. A visible, disconnected QuickBooks Online adapter is included for installers who want to replace the invoice source after configuring Intuit OAuth and completing the documented live-recheck changes.
Best for
- founders and small finance teams managing recurring receivables;
- agencies, consultancies, professional services, and B2B suppliers;
- teams that already track invoice status in Google Sheets;
- QuickBooks Online users who can complete and test a read-only adapter;
- n8n builders who need a reusable approval state-machine pattern.
What the build proves
- deterministic ageing and balance logic can drive reminder stages safely;
- low-risk reminders can be automatic while escalations stay human-controlled;
- Telegram actions can resolve a stored approval in a later execution;
- invoices can be reread immediately before customer contact;
- one report workbook can provide queue state, audit history, and management reporting;
- source adapters can normalize Google Sheets or QuickBooks into one invoice schema;
- scheduled operational alerts can be split from customer-email authorization.
End-to-end flow
Google Sheets (active) QuickBooks Online (adapter)
\ /
\---- canonical invoice ---/
|
Daily ageing scan
|
+--------------+---------------+
| |
Day 1 friendly Day 7 / 14 / 30
final state check Telegram approval
| / | | \
SMTP reminder Approve Edit Skip Defer
| \ / \ /
+---------- final source recheck -----+
|
Reminder Log + Queue
Hourly: four-hour owner fallback email
Weekly: Telegram snapshot + owner email radar
The four included workflows
00 — Finance Error Handler
Receives unhandled workflow errors, removes sensitive and oversized context, and alerts the finance owner in Telegram.
01 — Daily Invoice Scanner and Reminder Planner
Reads invoices, queue state, and reminder history; calculates ageing; sends the friendly stage automatically; and creates Telegram approval cards for escalations. The disconnected QuickBooks source mapper lives beside the active Sheets path.
02 — Telegram Escalation Approval Dispatcher
Owns the finance bot’s Telegram Trigger. It validates callbacks, handles Approve/Edit/Skip/Defer, rereads invoice state, sends authorized SMTP messages, and records the final resolution.
03 — Approval Fallback and Cash-Flow Radar
Checks hourly for approvals that have waited four hours and emails the owner once. Each Monday it calculates ageing exposure and sends the owner a Telegram snapshot plus email report.
Reminder policy
| Stage | Threshold | Default action |
|---|---|---|
| Day 1 friendly | 1 day overdue | Automatic after live-state check |
| Day 7 firm | 7 days overdue | Telegram approval required |
| Day 14 urgent | 14 days overdue | Telegram approval required |
| Day 30 final | 30 days overdue | Telegram approval required |
The planner chooses the highest eligible unsatisfied stage. It does not repeatedly send a final notice.
Safety boundaries
- No reminder sends when the invoice is paid, void, cancelled, disputed, missing, zero-balance, invalid, or in a different currency.
- Approvals expire; repeated callbacks cannot produce a second state transition.
- QuickBooks is read-only and not connected in the demonstration build.
- The four-hour fallback notifies the owner but cannot authorize a customer email.
- Reminder text is deterministic by default. An LLM is optional, not required.
- This system does not process payments, calculate fees, reconcile accounts, or replace accounting/legal policy.
Operating assumptions
- one n8n worker;
- one configured currency;
- no more than 500 open invoices per run;
- Google Sheets as the initial queue and audit store;
- SMTP as the connected email provider, with Gmail documented as an optional manual replacement;
- owner-reviewed finance exceptions and quarterly regression testing.
Downloads
Complete starter bundle
Download the ZIP when installing the project for the first time. It contains the four sanitized n8n workflows, the formatted tracker workbook, a sanitized Docker Compose baseline, release notes, and a SHA-256 integrity manifest.
| Import order | File | Purpose |
|---|---|---|
| 1 | 00-finance-error-handler.json | Safe Telegram production-error alerts |
| 2 | 01-daily-invoice-scanner-reminder-planner.json | Daily scan, reminder planning, automatic Day 1, escalation queue |
| 3 | 02-telegram-escalation-approval-dispatcher.json | Finance bot actions, edited reminders, approved delivery |
| 4 | 03-approval-fallback-cash-flow-radar.json | Four-hour fallback and weekly cash-flow reporting |
| — | smart-invoice-chaser-tracker.xlsx | Three-tab Google Sheets starter workbook |
| — | 04-docker-compose.yml | Optional persistent self-hosted n8n baseline |
Importing a workflow never imports working secrets. Every credential binding, account ID, chat ID, spreadsheet ID, sender address, and live URL is removed or replaced before publication.
Compatibility
- Designed for n8n 2.x using built-in Schedule, Google Sheets, Telegram, Telegram Trigger, Send Email, QuickBooks, Code, If, and Error Trigger nodes.
- Google Sheets is the tested demonstration source.
- The QuickBooks node and mapper are intentionally disconnected.
- SMTP is the default customer and owner email path.
- Reminder wording is deterministic; no LLM account is required.
Release contents
smart-invoice-chaser-v1.0/
├── 00-finance-error-handler.json
├── 01-daily-invoice-scanner-reminder-planner.json
├── 02-telegram-escalation-approval-dispatcher.json
├── 03-approval-fallback-cash-flow-radar.json
├── smart-invoice-chaser-tracker.xlsx
├── 04-docker-compose.yml
├── README.md
└── release-manifest.json
Before importing
- Extract the ZIP locally.
- Compare file hashes with
release-manifest.jsonif the bundle was redistributed. - Import into a test project, not directly into an existing production workflow.
- Keep every workflow unpublished until the test matrix passes.
- Use fictional invoices and tester-owned mailboxes during setup.
Licence and support boundary
Free for personal and commercial implementation. Third-party service charges, accounting obligations, email deliverability, data retention, and regulatory compliance remain the installer’s responsibility. The template is provided without an uptime or collections-results warranty.
Install
Before you begin
Prepare:
- an n8n 2.x instance you administer;
- a stable public HTTPS n8n URL for Telegram webhooks;
- the four workflow JSON files, tracker workbook, and optional
04-docker-compose.ymlbaseline; - a dedicated Telegram bot and the owner’s chat/user ID;
- a Google account with Sheets access;
- an SMTP account and verified sender;
- one installation currency and timezone;
- optionally, a QuickBooks Online sandbox/company and Intuit developer app.
Step 1 — Run n8n safely
For self-hosting, use the included 04-docker-compose.yml as a baseline, or apply the same settings to your existing deployment. Replace the example domain and timezone before starting it. Keep the persistent data volume and retain the same encryption key. Configure the public webhook URL before enabling the Telegram Trigger.
N8N_HOST=n8n.example.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.example.com/
GENERIC_TIMEZONE=Africa/Lagos
N8N_PROXY_HOPS=1
Do not remove the persistent volume during routine restarts.
From the extracted release folder, start the optional baseline with:
docker compose -f 04-docker-compose.yml up -d
If n8n is already running, do not launch a second container; copy only the relevant settings into the deployment you already manage.
Step 2 — Create the tracker
- Upload
smart-invoice-chaser-tracker.xlsxto Google Drive. - Open it with Google Sheets and save/convert it as a Google spreadsheet.
- Confirm the tabs are exactly
Invoices,Approval Queue, andReminder Log. - Keep the headers unchanged.
- Share only with the finance owner and the Google account connected to n8n.
- Copy the spreadsheet ID and the
gidfor each tab.
Step 3 — Import the workflows
In n8n, create a dedicated project and import the JSON files in numeric order. Confirm all four import as unpublished and show missing credentials/placeholders.
Step 4 — Create credentials
Create and test:
- Telegram API credential for the dedicated finance bot;
- Google Sheets OAuth2 credential;
- SMTP credential for customer reminders and owner reports;
- optional Gmail OAuth2 replacement;
- optional QuickBooks OAuth2 credential.
Step 5 — Replace installation values
Replace every visible placeholder:
<OWNER_CHAT_ID>and<OWNER_USER_ID>;<OWNER_EMAIL>;<SPREADSHEET_ID>;<INVOICES_SHEET_ID>,<APPROVAL_QUEUE_SHEET_ID>, and<REMINDER_LOG_SHEET_ID>;<VERIFIED_FROM_ADDRESS>and<SENDER_NAME>;<TIMEZONE>and the three-letter installation currency.
Step 6 — Keep one invoice source
For the demonstrated build, leave Google Sheets connected and QuickBooks disconnected. If adopting QuickBooks, complete the QuickBooks chapter and replace every source read/recheck before publishing. Do not run both sources into the planner unless you add explicit deduplication.
Step 7 — Configure failure handling
Set workflow 00 as the Error Workflow for workflows 01, 02, and 03. Save failed production executions. During commissioning, also save successful executions.
Step 8 — Test while unpublished
Use the manual trigger and fictional invoice records. Complete Day 1, Approve, Edit, Skip, Defer, pre-send payment, fallback, radar, invalid data, and duplicate-action tests.
Step 9 — Publish in order
- Finance Error Handler.
- Telegram Escalation Approval Dispatcher.
- Approval Fallback and Cash-Flow Radar.
- Daily Invoice Scanner and Reminder Planner.
Only one active Telegram Trigger may use the dedicated finance bot.
Installation is complete when
- no production node shows a missing credential or placeholder;
- a fictional Day 1 invoice sends once to a tester-owned mailbox;
- an escalation reaches Telegram and all four owner actions work;
- payment recorded before approval blocks customer delivery;
- the fallback email sends once after the configured threshold;
- the radar totals match a manual calculation;
- a controlled error reaches Telegram without invoice body or secret data.
Official references
Credentials
Store every secret in n8n’s credential manager. Never paste tokens, OAuth secrets, SMTP passwords, or authorization headers into Code/Set nodes, sticky notes, screenshots, or public JSON.
Telegram finance bot
Create and connect the bot
- Start BotFather in Telegram and send
/newbot. - Choose a finance-specific display name and unique username ending in
bot. - Store the returned token in a password manager.
- Open the new bot and send
/start. - In n8n, create a Telegram API credential and paste the token.
- Use a temporary unpublished Telegram Trigger to capture one owner message.
- Record
message.chat.idas<OWNER_CHAT_ID>andmessage.from.idas<OWNER_USER_ID>. - Remove the temporary trigger before publishing workflow 02.
Use the credential on every Telegram node in all four workflows. Restrict the dispatcher trigger to the owner chat and user.
Google Sheets OAuth
n8n Cloud
Use the managed Google sign-in when available. Grant access only to the account that can edit the tracker.
Self-hosted n8n
- Create a Google Sheets OAuth2 credential in n8n and copy its exact redirect URL.
- Create/select a Google Cloud project.
- Enable Google Sheets API and Google Drive API.
- Configure the OAuth consent screen.
- Create a Web application OAuth client.
- Add the exact n8n redirect URL.
- Paste Client ID and Client Secret into n8n.
- Sign in with the tracker account and test the credential.
SMTP
Collect the provider’s host, port, username, password/app password, encryption requirement, and permitted From address. Create an SMTP credential, test it, and attach it to every Send Email node.
During setup, send only to a mailbox you own. The displayed From address must be allowed by the provider and domain authentication should be configured before production use.
Gmail alternative
No Gmail Send nodes are included or parked in the four workflow files. This is an optional manual provider swap, not an additional downloadable workflow.
If using Gmail instead of SMTP:
- create a Gmail OAuth2 credential;
- place a Gmail Send node where each SMTP node currently sits;
- copy To, Subject, and Body expressions;
- disconnect SMTP completely;
- keep only one provider connected;
- repeat automatic, approved, edited, fallback, and radar tests.
QuickBooks Online OAuth
The template’s QuickBooks node is intentionally disconnected.
- Create a QuickBooks OAuth2 credential in n8n and copy the displayed OAuth Redirect URL.
- Sign in to the Intuit Developer Portal and create an app.
- Select the QuickBooks Online Accounting scope/product.
- In the app’s Keys and credentials settings, choose Development for a sandbox or Production for a live company.
- Add the exact n8n redirect URL. Intuit requires an HTTPS redirect URI for normal hosted integrations.
- Copy the matching Client ID and Client Secret into n8n.
- Save, choose Connect/Sign in with Intuit, select the intended company, and authorize accounting access.
- Test first with an Intuit sandbox company.
Intuit authorization returns a company realmId; n8n’s credential handles the token exchange and refresh flow. Do not copy tokens into workflow fields.
Credential acceptance checklist
- Telegram can send a plain test message and the trigger identifies only the owner.
- Google can read
Invoicesand append a disposable test row to a separate test tab. - SMTP sends to a tester mailbox with the intended From identity.
- QuickBooks, if used, lists fictional/sandbox invoices without any write operation.
- Credentials remain visibly absent from exported public workflow JSON.
Official references
Google Sheets
Import the starter workbook
Upload smart-invoice-chaser-tracker.xlsx, open it with Google Sheets, and convert it to a native Google spreadsheet. Do not rename the three tabs or their headers.
Invoices tab
| Field | Purpose |
|---|---|
invoice_id | Stable unique key used in idempotency and lookups |
invoice_number | Customer-facing invoice reference |
customer_name / customer_email | Reminder recipient identity |
issue_date / due_date | ISO dates used for ageing |
original_amount / balance_due | Numeric invoice values |
status | Open, Partially Paid, Overdue, Paid, Void, Cancelled, or Disputed |
currency | Three-letter currency matching the installation currency |
payment_link / payment_instructions | Optional customer payment guidance |
is_disputed | Explicit TRUE/FALSE safety control |
source / source_record_id | Adapter provenance |
last_synced_at / updated_at | Source freshness context |
Dates should use YYYY-MM-DD; money columns must be numeric; invoice_id must never change for the same invoice.
Approval Queue tab
This is mutable workflow state. One row represents one invoice/stage approval and stores:
approval_idandidempotency_key;- invoice facts and balance snapshot;
- proposed and final subject/body;
PENDING,EDITING,DEFERRED,APPROVED,SKIPPED, or final state;- fallback, expiry, defer, Telegram message, owner action, and delivery fields.
Do not edit pending rows manually while the workflow is active unless following a documented recovery procedure.
Reminder Log tab
The log is append-only. It records every planned, sent, skipped, deferred, fallback-notified, blocked, and failed event. Do not sort only part of the sheet or reuse event IDs.
Configure every Sheets node
Attach the Google credential, set the same <SPREADSHEET_ID>, and select the correct sheet ID:
- invoice reads and live rechecks →
Invoices; - queue reads/upserts →
Approval Queue; - audit appends and radar history →
Reminder Log.
Source rules
- Active statuses: Open, Partially Paid, Overdue.
- Blocked statuses: Paid, Void, Cancelled, Disputed.
is_disputed = TRUEalways blocks.balance_due <= 0always blocks.- Currency mismatch excludes the invoice from reminders and radar totals.
- Missing/invalid recipient email blocks delivery.
Workbook maintenance
Freeze and protect header rows, keep filters on, restrict sharing, back up the workbook, and archive old log rows under the business retention policy. Before multi-worker n8n or higher concurrency, migrate queue state to PostgreSQL or another transactional store.
QuickBooks
What is included
Workflow 01 contains two parked nodes:
QuickBooks Online - Get Invoices (Disconnected);Map QuickBooks to Canonical Invoice.
They show the source adapter and field mapping but are not connected to the demonstrated Google Sheets path. The public build makes no claim that QuickBooks was executed against a live company.
Recommended adoption path
Start in an Intuit sandbox. Keep the Google workbook for Approval Queue and Reminder Log even when QuickBooks becomes the invoice source.
Step 1 — Create an Intuit app
- Sign in to the Intuit Developer Portal.
- Create an app and select QuickBooks Online Accounting.
- Open Keys and credentials.
- Use Development keys with a sandbox company first.
- Add the exact HTTPS redirect URI displayed by the n8n QuickBooks credential.
- Copy the corresponding Client ID and Client Secret.
Redirect URIs are exact: scheme, host, path, casing, and trailing slash must match.
Step 2 — Create the n8n credential
- Open n8n Credentials and create a QuickBooks OAuth2 credential.
- Paste the Development Client ID and Client Secret.
- Save, connect to Intuit, and choose the sandbox company.
- Confirm the credential completes authorization.
- Never paste access or refresh tokens into nodes.
Step 3 — Test the parked source node
On QuickBooks Online - Get Invoices (Disconnected):
- select the new QuickBooks credential;
- keep Resource = Invoice;
- keep Operation = Get All/List;
- start with a small return limit before enabling Return All;
- execute only this node against fictional sandbox invoices;
- inspect
Id,DocNumber,CustomerRef,BillEmail,TxnDate,DueDate,TotalAmt,Balance,CurrencyRef, andSalesTermRef.
QuickBooks responses may omit fields that have no value, so missing email, due date, or currency must be treated as validation failures rather than silently guessed.
Step 4 — Validate the canonical mapping
Execute Map QuickBooks to Canonical Invoice and confirm it outputs the same fields as the Sheets source. Pay particular attention to:
invoice_id = Id;invoice_number = DocNumber;customer_email = BillEmail.Address;original_amount = TotalAmt;balance_due = Balance;currency = CurrencyRef.value;source = QUICKBOOKS.
The adapter treats a positive balance as open and zero as paid. Add business-specific status/dispute logic if the company uses additional QuickBooks fields or linked records.
Step 5 — Replace the source path
This is an implementation change, not a credential-only switch:
- keep workflows unpublished;
- disconnect
Installation Settings → Read Invoice Tracker; - connect
Installation Settings → QuickBooks Online - Get Invoices; - connect QuickBooks → canonical mapper;
- feed the mapped invoice collection into the reminder/log/queue planning sequence;
- update
Plan Next Reminder Stateso it reads the mapper output rather thanRead Invoice Tracker; - replace every Google Sheets
Invoiceslive-recheck node in workflows 01 and 02 with a QuickBooks invoice read/query bysource_record_id; - retain Google Sheets nodes used for Approval Queue and Reminder Log;
- repeat the complete acceptance matrix.
Do not connect QuickBooks only at the first scan while leaving pre-send rechecks pointed at Sheets. That would make the safety gate read a different source of truth.
Step 6 — Query and pagination
The template targets at most 500 open invoices. For larger companies, use bounded QuickBooks queries and pagination. Intuit queries operate on one entity at a time and support STARTPOSITION and MAXRESULTS; confirm the n8n node’s pagination behaviour against sandbox data.
Step 7 — Move to production
After sandbox tests:
- configure the Intuit app’s Production keys and production redirect URI;
- create a separate production n8n credential;
- authorize the intended QuickBooks company;
- run read-only reconciliation against a controlled invoice sample;
- confirm currency, balances, email fields, and paid invoices match QuickBooks UI;
- publish only after the pre-send payment test passes.
Read-only boundary
The workflow reads invoices. It does not create, update, email, void, or receive payment against QuickBooks records. Customer reminders are sent by the configured email provider and state is recorded in the Google workbook.
Official references
Configure
Required replacement table
| Placeholder | Where | Value |
|---|---|---|
<OWNER_CHAT_ID> | Telegram send nodes and queue context | Numeric private chat ID |
<OWNER_USER_ID> | Telegram Trigger restriction and callback checks | Numeric Telegram user ID |
<OWNER_EMAIL> | Installation/Owner Settings | Finance owner mailbox |
<SPREADSHEET_ID> | Every Google Sheets node | Google spreadsheet ID |
<INVOICES_SHEET_ID> | Invoice reads | Invoices gid |
<APPROVAL_QUEUE_SHEET_ID> | Queue reads/writes | Approval Queue gid |
<REMINDER_LOG_SHEET_ID> | Log reads/appends | Reminder Log gid |
<VERIFIED_FROM_ADDRESS> | SMTP nodes | Provider-authorized sender |
<SENDER_NAME> | SMTP nodes | Business/accounts team name |
<CURRENCY> | Settings nodes | One ISO currency such as USD, GBP, EUR, NGN |
<TIMEZONE> | Workflow settings | IANA timezone such as Africa/Lagos |
Workflow 00 — Finance Error Handler
Attach the finance Telegram credential, replace the owner chat ID, and publish first. Keep the sanitizer: production alerts should name the workflow, execution, failed node, concise error, and time—never the reminder body or credentials.
Workflow 01 — Daily scanner and planner
Triggers and settings
- Use
Manual Test Triggerduring setup. Daily 08:00 Triggerruns every morning in the workflow timezone.- In
Installation Settings, set currency, owner email, and the four-hour fallback threshold.
Google Sheets path
Configure the invoice, log, and queue nodes with the correct tab IDs. Google Sheets is the active path. Keep the QuickBooks pair disconnected unless following the complete QuickBooks migration chapter.
Planner behaviour
Plan Next Reminder State:
- limits invoice input to 500 records;
- excludes invalid, settled, disputed, zero-balance, and wrong-currency invoices;
- calculates whole days overdue;
- selects the highest eligible stage;
- checks Reminder Log and Approval Queue idempotency keys;
- creates deterministic subject/body text and approval/fallback timestamps.
Day 1 path
The automatic branch rereads Invoices, validates the current status/balance/email, sends through SMTP, and appends a SENT event. Do not remove the reread.
Escalation path
The approval branch upserts one queue row, sends a Telegram card with Approve/Edit/Skip/Defer, and stores the Telegram message ID.
Workflow 02 — Telegram dispatcher
- Use the dedicated finance bot.
- Receive callback queries and messages.
- Restrict Chat IDs and User IDs to the owner.
- Confirm no other published Telegram Trigger uses this bot token.
- Configure every queue/log Sheets node.
- Configure every live invoice re-read.
- Attach SMTP only to the approved and edited delivery nodes.
Approve and Edit reread the invoice immediately before sending. Skip and Defer never contact the customer.
Workflow 03 — Fallback and radar
Four-hour fallback
The hourly trigger finds PENDING approvals whose fallback_due_at has passed and fallback_sent_at is empty. The owner receives one email and the queue timestamp is updated.
Weekly radar
The Monday 08:30 branch reads up to 500 invoices and recent log activity, then groups exposure into current, 1–7, 8–14, 15–30, and 31+ day buckets. It sends a compact Telegram message and an owner email.
Optional LLM customization
No model is required or connected. Deterministic reminder templates reduce cost and factual drift. If an installer adds OpenAI, Anthropic, OpenRouter, NVIDIA, Gemini, or another n8n-compatible chat model, use it only to rewrite tone after invoice facts are assembled. Preserve the subject/body schema, never allow the model to invent balances/dates/fees, and keep the same human approval and live-state checks.
Workflow settings
- Error workflow: workflow 00 on workflows 01–03.
- Timezone: one configured IANA timezone.
- Execution timeout: bounded; the included baseline is 300 seconds.
- Save failed production executions.
- Save successful executions during commissioning, then apply the retention policy.
Test
Use fictional companies, invoice numbers, balances, and tester-owned email addresses. Keep all workflows unpublished until the matrix passes.
Test 1 — Credentials and workbook
- Telegram sends to the owner and rejects a non-owner identity.
- Google reads all three tabs and can write a disposable test row.
- SMTP delivers to a tester mailbox with the correct From identity.
- Workbook headers match exactly and contain no formula errors.
- Optional QuickBooks reads only sandbox invoices.
Test 2 — Reminder thresholds
Create separate open invoices at 1, 7, 14, and 30+ days overdue. Confirm the highest eligible unsatisfied stage is selected and only Day 1 takes the automatic path.
Test 3 — Automatic Day 1
- Use a tester-owned customer email.
- Run workflow 01 manually.
- Confirm one final invoice reread.
- Confirm exactly one friendly reminder arrives.
- Confirm Reminder Log records the stage, current balance, SMTP result, and idempotency key.
- Run again and confirm no duplicate email.
Test 4 — Approve
Create a Day 7/14/30 invoice, wait for the Telegram card, verify the facts, and press Approve. Confirm one live reread, one customer email, one final queue state, one log event, and one owner confirmation.
Test 5 — Edit reminder
Press Edit, reply to the exact Telegram force-reply prompt, and change the body. Confirm the edited body—not the stored proposal—arrives once and is saved as final_body.
Test 6 — Skip and Defer
- Skip: no customer email, queue/log record SKIPPED.
- Defer: no customer email,
defer_untilset, owner confirmation received, item not reconsidered before the defer time.
Test 7 — Payment before delivery
After the Telegram card arrives, change status to Paid or balance to zero, then press Approve. Expected: no customer email; the owner sees a blocked/no-send outcome and the audit record explains the changed state.
Repeat for Partially Paid with a positive balance and confirm the newly read balance is used.
Test 8 — Blocked and invalid records
Test future due date, due today, Paid, Void, Cancelled, Disputed, is_disputed = TRUE, zero/negative balance, missing ID, missing/invalid email, invalid date, invalid number, and wrong currency. None may create a misleading sent state.
Test 9 — Idempotency and stale actions
- Repeat the daily run.
- Press the same button twice.
- Press an expired button.
- Send an unrelated Telegram message.
- Reuse an invoice number with a different invoice ID.
Expected: no duplicate customer delivery and no unrelated state transition.
Test 10 — Four-hour fallback
In a test copy, shorten the threshold. Confirm the owner receives one fallback email, fallback_sent_at is populated, a second hourly run does not resend, and the email cannot authorize delivery.
Test 11 — Weekly radar
Create known balances across every ageing bucket. Calculate totals manually, then run the radar branch. Telegram and email must match the manual total, exclude disputes/wrong currency, and report recent reminder counts accurately.
Test 12 — Provider failures
Safely test invalid/revoked credentials or a controlled error for Google, Telegram, SMTP, and optional QuickBooks. Confirm bounded failure, useful execution data, Telegram production alert, and no false SENT record.
Test 13 — Scale and isolation
Run with 500 fictional open invoices. Confirm the run remains bounded and one malformed invoice does not stop other valid records. Do not claim a higher tested scale without evidence.
Acceptance matrix
| Scenario | Customer email | Telegram | Queue/log |
|---|---|---|---|
| Day 1 valid | Friendly reminder once | Optional status | SENT event |
| Day 7/14/30 valid | None before approval | Review card | PENDING |
| Approve | Proposed body once | Completion | APPROVED/SENT |
| Edit | Edited body once | Prompt + completion | EDITED/SENT |
| Skip | None | Skipped | SKIPPED |
| Defer | None | Deferred | DEFERRED |
| Paid before send | None | Blocked status | BLOCKED/no false send |
| Four-hour pending | None | Original card remains | Fallback timestamp once |
| Wrong currency/dispute | None | No approval | Excluded/flagged |
Operate & Fix
Daily operating loop
- Review finance Telegram approvals and production alerts.
- Check invoice number, due date, current balance, recipient, and proposed wording.
- Approve, edit, skip, or defer within the approval window.
- Confirm Telegram reports the result.
- Investigate failed/blocked delivery rows and failed n8n executions.
Weekly review
- Compare the cash-flow radar to the source ledger.
- Review top overdue invoices and unresolved disputes.
- Check fallback notifications and old pending approvals.
- Confirm email/Telegram/Google provider limits and credential health.
“Paid customer received a reminder”
Pause workflows 01 and 02, preserve the execution/log evidence, and verify whether the invoice source was updated before the final reread. Check status spelling, numeric balance, invoice identity, source record ID, and whether all QuickBooks recheck nodes were replaced when switching source.
Duplicate reminder
Check for duplicate published scanner workflows, cleared n8n/static state, changed invoice IDs, modified stage names, duplicate queue/log rows, and callbacks that bypassed expected-state validation.
Telegram trigger will not activate
Confirm the bot has been started, n8n has a stable public HTTPS webhook URL, proxy headers are correct, workflow 02 is published, and no other active Telegram Trigger uses the same bot token.
Telegram action is ignored
Check owner chat/user IDs, pending status, expiry, callback approval ID, exact force-reply message ID for edits, and execution errors in workflow 02.
Google read/write failure
Check OAuth access, workbook sharing, spreadsheet/tab IDs, exact headers, API quota, and whether a tab was renamed or protected against the connected account.
SMTP success but missing mail
Check spam/quarantine, From-address authorization, SPF/DKIM/DMARC, provider logs, recipient spelling, and throttling. Do not mark delivery successful solely because the node did not throw; preserve provider IDs when available.
QuickBooks authorization or 401 failure
Confirm Development vs Production keys, exact redirect URI, authorized company, current n8n credential, and Intuit app status. Reconnect through OAuth rather than copying access tokens manually.
QuickBooks invoice is missing fields
Intuit responses can omit empty properties. Inspect the source invoice/customer, then decide whether to enrich the adapter or block the record. Never invent an email, currency, date, or balance.
Radar total is wrong
Check installation currency, excluded disputes/wrong-currency records, invalid dates, positive balances, time zone around midnight, and manual ageing boundaries. Reconcile a small sample before changing the aggregation code.
Backups and retention
Back up n8n persistent data/database and encryption key together. Back up/export the Google workbook. Restrict access to finance operators. The reference execution retention is 90 days, but the business must choose a policy appropriate to customer and financial data.
When to redesign the state layer
Move Approval Queue and Reminder Log to PostgreSQL or another transactional store before multiple n8n workers, higher concurrency, or stronger conditional-update guarantees. Google Sheets is transparent and accessible, but it is not a transactional queue.
Customize
Change the reminder cadence
Edit the stages array in Plan Next Reminder State, update subjects/tones, and repeat threshold, idempotency, and stale-action tests. Do not add repeated final notices without an explicit business policy and owner control.
Change wording or brand
Keep invoice number, due date, freshly read balance/currency, payment guidance, and the “already paid/report an issue” route. Never add unsupported fees, legal threats, account restrictions, or promises.
Add an LLM safely
The build deliberately needs no LLM. If desired, connect any n8n-compatible provider—OpenAI, Anthropic, OpenRouter, NVIDIA, Gemini, or another supported chat model—to rewrite tone only.
Required guardrails:
- construct invoice facts deterministically before the model;
- give the model only the minimum required fields;
- require structured output containing subject and body;
- forbid invented values, fees, policies, and legal language;
- validate length and required invoice facts after generation;
- keep Telegram approval for escalation stages;
- keep the final source reread immediately before sending;
- provide a deterministic fallback when the provider fails.
Switch SMTP to Gmail
Gmail nodes are not included in the release. Add a Gmail Send node beside each SMTP node, copy the To, Subject, and Body expressions, then disconnect SMTP and connect Gmail in its place. Verify sender behaviour and rerun automatic, approved, edited, fallback, and radar delivery tests. Never leave both providers connected.
Add another invoice source
Create a dedicated adapter that outputs the canonical invoice schema. Preserve stable invoice identity and build matching live-recheck nodes for workflows 01 and 02. Keep one source connected unless explicit cross-source deduplication exists.
The demonstration headers are a contract, not a restriction on your accounting system. If your sheet uses different column names, either rename its headers to the canonical names documented in the Google Sheets chapter or add a Code/Edit Fields adapter immediately after the source read. Map every custom column to the canonical names before any ageing, safety, approval, or reporting node runs; apply the same mapping to every live recheck as well.
Add 61+ ageing
The confirmed design distinguishes 31–60 and 61+ exposure. If the imported radar version groups everything above 30 days, split the final bucket, update Telegram/email wording, and verify totals still reconcile.
Add reminders or approval expiry sweep
You may notify the owner again or expire stale rows, but a timeout must never authorize customer delivery. Record reminder/expiry events and invalidate old buttons where possible.
Move state to PostgreSQL
Use unique constraints on idempotency keys, transactions/conditional updates for state changes, indexes on status/timestamps, and a full audit table. Preserve the same PENDING → EDITING/APPROVED/SKIPPED/DEFERRED/COMPLETED boundaries.
Add CRM or accounting handoff
Create a post-resolution branch that receives the final audit object. Do not make customer delivery depend on a non-essential CRM write; log and alert when the secondary integration fails.
Production-hardening roadmap
- stable named HTTPS domain and monitored webhook health;
- automated n8n/database/encryption-key backups;
- transactional state for multiple workers;
- provider monitoring and rate-limit handling;
- formal customer communication, privacy, and retention policies;
- reconciliation checks between source invoices and radar totals;
- release tests after n8n, Google, Intuit, Telegram, or email-provider changes.