Automate your accounts receivable with this sophisticated n8n workflow. It uses a scheduled n8n trigger, PostgreSQL data, and OpenAI integration to generate and send personalized, urgent payment reminders and automatically log payments.
Download this n8n workflow template and start using it instantly.
Finance departments seeking to reduce manual accounts receivable (AR) overhead.
Businesses using PostgreSQL to manage invoice data.
Developers looking for robust n8n templates combining complex logic (Code n8n node) with OpenAI integration.
Anyone who needs a reliable, scheduled n8n trigger for daily financial processes.
Managing overdue invoices is a critical but time-consuming task. Generic, manually sent reminders often lack the nuance required for different stages of debt collection. This advanced n8n workflow solves these problems by creating a proactive, dual-path automation system.
The reminder path runs daily, querying your PostgreSQL database for invoices that are due soon or already overdue. Crucially, it uses smart logic implemented in a custom Code n8n node to determine the appropriate reminder frequency and urgency (e.g., 'first reminder' vs. 'final notice'). The generated data is then fed to an OpenAI n8n node, ensuring every email is highly personalized, professional, and context-aware.
Simultaneously, the payment tracker path uses an n8n webhook trigger to instantly capture payment notifications from external systems, updating the invoice status in PostgreSQL immediately and sending automatic confirmation emails. This comprehensive n8n solution ensures faster payment cycles and accurate financial tracking.
This automation consists of two primary, independent flows, each initiated by a specific n8n trigger.
lastremindersent to determine if a new reminder is required and, if so, its specific type and urgency level (e.g., 'upcoming' for due-soon, or 'critical' for 30+ days overdue).invoices table using the 'Update Reminder Status' Postgres n8n node and saves a record of the activity to a separate log table.To deploy this comprehensive n8n workflow, follow these steps:
invoices and invoiceactivitylog) with columns like invoiceid, duedate, paymentstatus, and lastreminder_sent. Schedule Daily Check (n8n trigger): The primary automation n8n trigger for the reminder flow. It is configured to run daily using a CRON expression (0 9 ).
Postgres n8n node (Fetch Pending Invoices): Executes SQL to retrieve unpaid invoices due within 7 days or overdue. This connection to your financial data is central to the n8n workflow.
If n8n node (Filter Overdue Invoices): Ensures only records marked 'unpaid' are processed for reminder generation.
Code n8n node (Calculate Reminder Logic): Contains custom JavaScript to implement complex business logic, deciding the timing and urgency of the reminder based on due dates and previous contact history.
Set n8n node (Prepare AI Prompt): Maps the structured invoice data into a clear prompt template for the LLM.
OpenAI/Langchain Agent n8n node: Uses the specified model (e.g., gpt-4o-mini) to dynamically generate professional email content, demonstrating the power of integrating AI into an n8n workflow.
Code n8n node (Format Email): Transforms the plain text AI response into clean HTML, ensuring the final email is highly presentable, complete with invoice tables.
EmailSend n8n node: Handles the dispatch of the personalized reminder emails.
Postgres n8n node (Update Reminder Status): Updates metadata in the database after the reminder is sent, preventing over-spamming the client.
Webhook n8n trigger (Payment Received): Provides a robust entry point for external systems to notify this n8n workflow that a payment has occurred.
Postgres n8n node (Update Payment Status): Crucial n8n node that switches the invoice status to 'paid' and records the relevant payment details.
Use this powerful n8n workflow to automate invoice data extraction from PDFs sent via Telegram. It leverages OpenAI's GPT-4o and logs structured data into Airtable. Explore more n8n templates.

Automate accounts payable using this sophisticated n8n workflow. Extract structured PDF invoice data using GPT-4o, match vendors against an Airtable database, and manage the entry process automatically. Leverage the power of n8n templates for finance automation.

Use this advanced n8n workflow template for automated invoice processing. Extract data via AI (ScrapeGraphAI), validate business rules, and route high-value invoices for Telegram approval. Optimize your n8n automation.

Use this powerful n8n workflow to automatically trigger AI code reviews on GitHub push events using Groq's LLM, parse diffs with an n8n node, and send detailed HTML reports via Gmail.

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.







































