Introduction
Chasing payments is one of the most time-consuming tasks for freelancers and small businesses. Late invoices disrupt cash flow and strain client relationships. But what if you could automate the entire process? With AI and n8n, you can create a workflow that sends personalized payment reminders, generates invoices, and follows up automatically—all without manual effort. In this tutorial, we'll walk through building an n8n automation that uses AI to craft custom messages and triggers actions based on payment status.
Why Automate Invoice Follow-Ups?
Manual follow-ups are prone to delays, errors, and awkwardness. An automated system ensures timely reminders, reduces late payments, and frees you to focus on revenue-generating work. AI invoice automation takes it further by personalizing each message based on client history, invoice amount, and overdue days. Combined with n8n payment follow-up workflows, you can create a seamless billing experience.
What You'll Need
- An n8n instance (self-hosted or cloud)
- Access to an AI service (e.g., OpenAI API)
- A payment platform (e.g., Stripe, PayPal) or accounting software (e.g., QuickBooks, Xero)
- An email service (e.g., Gmail, SendGrid)
Step 1: Set Up the Trigger
Webhook or Schedule
Start by adding a Webhook node to receive payment events (e.g., invoice.created, payment.failed) from your payment platform. Alternatively, use a Schedule trigger to run daily and check for overdue invoices. For this tutorial, we'll use a Cron node to run every morning at 8 AM.
Step 2: Fetch Unpaid Invoices
HTTP Request Node
Connect an HTTP Request node to your accounting software's API to retrieve invoices with status 'unpaid' or 'overdue'. Map the response fields: invoice ID, client name, amount due, due date, and days overdue. Store this data for the next steps.
Step 3: Generate AI-Powered Reminder Messages
OpenAI Node
Add an OpenAI node to create personalized email content. Use a prompt like: 'Write a friendly payment reminder for {{clientName}} regarding invoice {{invoiceId}} for {{amount}} due on {{dueDate}}. Mention that it's {{daysOverdue}} days overdue. Keep tone professional but warm.' The AI will output a custom message for each client.
Step 4: Send the Email
Email Node (SMTP)
Use an SMTP node to send the generated message. Set the recipient as the client's email, subject as 'Payment Reminder: Invoice {{invoiceId}}', and body as the AI output. You can also attach the invoice PDF if available.
Step 5: Automate Invoice Generation
Conditional Logic
Add an IF node to check if a new invoice needs to be created (e.g., for recurring subscriptions). If true, use another HTTP Request node to create an invoice via your payment platform's API. Then trigger the same AI email flow to notify the client.
Step 6: Handle Responses and Escalations
Wait and Loop
After sending a reminder, use a Wait node to pause for 3 days. Then check if the invoice is still unpaid. If yes, send a second reminder with a firmer tone. After the third reminder, escalate to a human (e.g., send an internal Slack message). This creates an automated billing system that adapts to client behavior.
Best Practices for AI Invoice Automation
- Always review AI-generated messages for tone and accuracy before sending.
- Segment clients: new clients may need gentler reminders than long-term ones.
- Track open rates and payment times to refine your workflow.
- Use tags or custom fields to exclude clients on payment plans.
Conclusion
By combining n8n's powerful automation with AI's language capabilities, you can eliminate the hassle of manual payment follow-ups. This n8n payment follow-up workflow not only saves time but also improves client relationships through timely, personalized communication. Start building your own automated billing system today and watch your cash flow improve.