n8n Finance Automation: Accounts Payable, AR, and Spend Tracking Workflows
n8n finance automation covers accounts payable, invoice chasing, vendor payments, and spend alerts without per-task billing. Browse ready-made templates.
Finance operations teams at growing companies hit the same wall around 200–300 customers: the spreadsheet that tracked invoices at 50 clients can't track them at 300. Reminders go unsent. Vendor payment approvals sit in someone's inbox for a week. Anomalies surface in the monthly close, not the day they happen.
n8n finance automation addresses this at the workflow level. Rather than buying a dedicated AP software subscription, a separate AR tool, and a standalone spend-alert service, you connect the systems already in place (Google Sheets, Xero, Slack, Gmail) and build the routing logic once.
Two things make n8n particularly suited to financial workflows. It's self-hosted, so sensitive invoice data doesn't transit a third-party middleware layer. And there's no per-execution billing, which matters when a reminder workflow runs 10 escalation steps across 200 vendors per month.
What n8n Finance Automation Can Handle
Finance workflows that fit naturally into n8n pipelines:
- Pulling overdue invoices from Xero or QuickBooks via the HTTP Request node (v4.2) and routing them into a timed reminder sequence
- Routing vendor payment requests through a multi-level approval chain in Slack or Gmail
- Monitoring OpenAI API spend daily, logging costs to Google Sheets, and firing a budget alert before the bill surprises anyone
- Flagging transactions that deviate more than 20% from the rolling 30-day average
- Generating weekly spend snapshots in Google Sheets from raw transaction exports
- Syncing approved expenses from Airtable into an accounting system without manual re-entry
- Sending dunning emails for overdue subscription accounts at day 3, day 7, and day 14
That's seven distinct automation candidates — each one can run as a standalone n8n workflow with its own schedule and audit log.
Self-hosted n8n means invoice amounts, vendor records, and payment data never leave your own servers. For teams operating under SOC 2 or ISO 27001, that removes one vendor risk assessment from the compliance checklist entirely.
The Finance Workflow Pipeline
Almost every financial workflow follows the same structure:
Trigger → Fetch / Ingest → Evaluate → Route → Act → Log
A concrete invoice-chasing example:
Schedule Trigger v1.2 (cron: 0 9 * * 1-5, weekdays only)
→ HTTP Request v4.2: GET /invoices?status=overdue (Xero API)
→ Code node v2 (jsCode): filter where days_overdue > 7, compute severity
→ Switch v3: 7–13 days | 14–29 days | 30+ days
→ Gmail v2: tier-1 reminder | tier-2 reminder | owner escalation email
→ Google Sheets v4: append row to reminder_log tab
The Schedule Trigger fires on weekdays at 9am — no midnight runs where approvers aren't watching Slack. The Code node (v2, jsCode param) computes days_overdue from the date string returned by Xero, because Xero's ISO 8601 date format isn't what the downstream Gmail node expects. Add a Code node between every external API call and the next action step. That's not optional advice; it's the difference between a reminder going to the right vendor or the wrong one.
Three AP/AR Patterns That Work in Production
1. Invoice Chase and Escalation
This is the pattern that saves the most manual hours immediately. The Automated Invoice Chase and Escalation template handles the full cycle: it receives overdue invoice events via webhook, classifies each one as mild, moderate, or severe based on configurable day thresholds, then generates AI-written payment reminders using GPT-4o-mini and sends them via SMTP. When an invoice crosses 30 days, it fires a full-detail escalation email to the business owner automatically.
The webhook source is flexible: it works with Stripe, QuickBooks, Xero, or any custom trigger. Every reminder and escalation writes a row to a Google Sheets tracking tab, so there's always an audit trail that doesn't depend on the n8n execution log.
One caveat worth knowing: Xero's API is capped at 60 requests per minute and 5,000 per day. A workflow pulling 300+ invoices per run needs chunking logic in the Code node plus a Wait node set to 1,000ms between chunks. Without this, the workflow silently drops items at scale with no obvious error in the log.
2. Vendor Payment Escalation
The Vendor Payment Escalator template adds staged escalation logic to vendor invoice management. It detects overdue invoices daily, scores each one into a reminder stage (gentle, firm, or urgent), then generates personalized AI reminder emails via SendGrid at the exact escalation level. When a payment crosses a critical overdue threshold, it fires a Slack channel alert. The alert includes invoice number, amount, vendor name, and days overdue.
Every reminder delivery logs to Google Sheets for a full accounts-receivable audit trail. The overdue thresholds and sender details live in a single Config node, so adjusting escalation timing doesn't require touching the workflow logic itself.
Don't use inline webhook approval for anything that might wait in a Slack queue for hours. The Webhook node's default timeout is 120 seconds. Large payments that need two human approvals before proceeding should use an async pattern: one workflow creates the request and logs it; a separate workflow fires when the approval webhook returns. Mixing the two into a single inline flow will hit the timeout and leave the approval in an ambiguous state.
3. AI Spend Tracking
Once n8n starts running LLM workflows (lead scoring, content summarization, email drafting), OpenAI costs accumulate faster than expected. A single summarization workflow running every 15 minutes across a large data set can push $150–$200 per month before anyone checks. That's a number that shows up at billing time, not the day it starts.
The AI Agent Spend Tracker template pulls daily usage from the OpenAI usage API, calculates per-model costs using a built-in pricing table for all major GPT models, and sends an email alert the moment daily spend exceeds a configurable budget threshold. It also logs every daily snapshot to Google Sheets so cost trends are visible over time. The @n8n/n8n-nodes-langchain.openAi v2.1 node exposes token counts at $json.output[0].usage.total_tokens — the Code node in this template converts those counts to USD using the current model rate.
A workflow making 96 OpenAI calls per day (every 15 minutes, 24 hours) generates 2,880 calls per month. At GPT-4o pricing, that's a $40–$80 monthly line item per workflow, before you've run any other LLM pipeline on the same instance.
n8n Nodes for Financial Workflows
| Node | Version | Purpose |
|---|---|---|
n8n-nodes-base.httpRequest | v4.2 | Call Xero, QuickBooks, Stripe, or OpenAI usage APIs |
n8n-nodes-base.code | v2 | Filter arrays, compute date diffs, format currency values |
n8n-nodes-base.scheduleTrigger | v1.2 | Daily invoice runs, weekly spend reports |
n8n-nodes-base.switch | v3 | Route by amount, payment status, or days overdue |
n8n-nodes-base.gmail | v2 | Reminder emails, multi-level approval requests |
n8n-nodes-base.slack | v2 | Escalation alerts, approval threads for large payments |
n8n-nodes-base.googleSheets | v4 | Reminder counters, approval logs, spend ledger |
@n8n/n8n-nodes-langchain.openAi | v2.1 | Token usage extraction for spend tracking |
The n8n-nodes-base.code v2 node is the one that holds finance workflows together. Accounting APIs return raw JSON with date formats, currency strings, and amount representations that don't match what Gmail or Slack expects downstream. The execution log shows you a missing parse step clearly in testing. In production, it doesn't announce itself. It just sends the reminder to the wrong person.
Setting Up n8n Finance Automation
Starting from scratch, or adding financial workflows to an existing instance:
- Confirm credential types before building. Xero uses OAuth2. QuickBooks also uses OAuth2. Stripe uses an API key. Create all credentials in n8n's credential store first. The HTTP Request node can't test the connection until the credential exists.
- Start with invoice chasing. It's self-contained, the feedback loop is fast, and the value is obvious. Run it in test mode against real invoice data, verify the output JSON before enabling the schedule.
- Add a Google Sheet as the audit log. Every action (reminder sent, approval requested, escalation fired) should write a timestamped row. The n8n execution log alone isn't enough for a compliance review.
- Schedule during business hours. Finance workflows that route to humans (via Slack or email) don't belong on a midnight cron. Set the Schedule Trigger to fire between 8am and 5pm in the approver's timezone.
- Use the Automated Invoice Chase and Escalation template as the AR workflow foundation. It already handles reminder counters, severity classification, escalation thresholds, and per-invoice state tracking. Building from scratch means rebuilding what's already there.
- Add spend tracking before going heavy on LLM workflows. The AI Agent Spend Tracker installs in under 10 minutes. It pays for itself the first month you have more than two AI-powered workflows running on schedule.
What Breaks in Production
A few failure patterns that show up predictably in n8n finance automation deployments.
Rate limits hit first when workflows process large data sets. Xero's 60-requests-per-minute cap isn't obvious during testing with a handful of invoices. In production with hundreds, the workflow starts dropping items silently. Fix: batch the invoice array in the Code node and add a Wait node set to 1,000ms between each chunk.
Duplicate reminders happen when a schedule re-runs after a failed execution that didn't mark invoices as "reminded." Always write a reminded_at timestamp back to the source system before the execution ends. If you can't write back to the accounting platform, write to a Google Sheet row keyed by invoice ID. That row becomes the deduplication gate on the next run.
If you're building spend tracking alongside existing n8n AI automation workflows, keep the spend tracker as a separate workflow on its own schedule. Nesting it inside an LLM workflow creates a dependency loop when the tracker itself makes an OpenAI API call.
For the Xero OAuth2 setup and the invoice-specific flow in detail, the n8n invoice payment automation guide covers the integration step by step.
The three patterns above cover most of what finance and operations teams need from n8n finance automation in the first six months. Invoice chasing saves the most manual time up front. Payment escalation replaces the longest email chains. Spend tracking becomes necessary the moment a second LLM workflow goes live on a schedule. Each one stands alone — you don't need all three before the first one delivers value.
See the Vendor Payment Escalator template →Common questions
Can n8n automate invoice chasing without writing custom code?
How does n8n handle multi-level vendor payment approval workflows?
What's the difference between automating AP versus AR in n8n?
Get the workflow templates this guide is built on
Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.
More automation guides

How to Build OpenAI Workflows with n8n (Classify, Summarize, and Generate at Scale)
n8n OpenAI workflows connect a self-hosted automation engine to capable text models, and the integration is more direct than most tutorials suggest. The pattern goes like this: something triggers the…

How to Automate HR Workflows with n8n (Onboarding, Compliance, and Wellness Monitoring)
HR Admin Runs on Repetition. n8n Handles Repetition. Every new hire triggers the same chain of tasks. Welcome email, Notion page, Trello cards, payroll enrollment reminder, badge request. Someone copy…

How to Automate HubSpot with n8n (Contacts, Deals, and Email Sequences)
HubSpot Automation That Goes Beyond the Built-In Workflow Builder HubSpot's native workflow builder handles simple branching inside HubSpot well. The moment you need to sync a closed deal to your acco…