Send tone-adjusted overdue invoice reminders

Posted on Mar 23 • Originally published at Medium. Task: Posted on Mar 23 • Originally published at Medium In this article, I will walk you step by step through how to build your own AI agent using the open-source automation platform n8n. This agent will track overdue invoices and automatically send reminder emails to customers. The final system will look like this: If you want to use n8n for free, you can install and run it locally. For this, you need to install Docker on your computer. If you want to use n8n for free, you can install and run it locally. For this, you need to install Docker on your computer. First, go to the Docker Desktop website and download the version suitable for your operating system, then install it. Docker allows n8n to run on your computer in an isolated environment. First, go to the Docker Desktop website and download the version suitable for your operating system, then install it. Docker allows n8n to run on your computer in an isolated environment. To make sure your workflows and connections in n8n are not lost when you shut down your computer, we need to create a “storage space.” Open your terminal (CMD or PowerShell) and run the following command: To make sure your workflows and connections in n8n are not lost when you shut down your computer, we need to create a “storage space.” Open your terminal (CMD or PowerShell) and run the following command: Now, let’s start n8n. Paste the following command into your terminal: Once the installation is complete, open your browser and go to: http://localhost:5678 In this project, our scenario is as follows: we have a table that stores customers’ payment statuses. Normally, checking this table every day and manually sending reminder emails to overdue customers is time-consuming. The AI Agent we build will handle this process automatically in three steps: Data Retrieval: It checks the table and identifies which customers have outstanding debts and how many days they are overdue. Data Retrieval: It checks the table and identifies which customers have outstanding debts and how many days they are overdue. Analysis: Based on the amount and delay duration, it decides the tone of the email (a gentle reminder or a more urgent warning). Analysis: Based on the amount and delay duration, it decides the tone of the email (a gentle reminder or a more urgent warning). Action: It sends personalized emails automatically to customers. Action: It sends personalized emails automatically to customers. We will build this system in n8n using the following components: Trigger (When Chat Message Received): Listens for commands in the chat and starts the workflow. Trigger (When Chat Message Received): Listens for commands in the chat and starts the workflow. AI Agent: The main node that manages the process. AI Agent: The main node that manages the process. Gemini Chat Model: The “brain” that enables decision-making. Gemini Chat Model: The “brain” that enables decision-making. Memory: Short-term memory so the agent doesn’t forget what it’s doing. Memory: Short-term memory so the agent doesn’t forget what it’s doing. Tools: Used to read the table and send emails. Tools: Used to read the table and send emails. After completing the setup, let’s create a project in n8n. Click the + icon on the right side and select “On Chat Message”. This adds the required trigger. Click the + icon on the right side and select “On Chat Message”. This adds the required trigger. Then click the + button again and type “AI Agent” in the search bar. Add it and double-click on it to configure the settings. Then click the + button again and type “AI Agent” in the search bar. Add it and double-click on it to configure the settings. After this, you can close the window. The AI Agent has three outputs: Chat Model, Memory, and Tool. Click on the Chat Model input and select Gemini. Then, double-click on it to configure the settings. Create a new credential, obtain your API key from Google AI Studio, and paste it into the required field. Finally, choose the gemini-2.0-flash-lite model, as it provides a higher usage limit. Click on the Chat Model input and select Gemini. Then, double-click on it to configure the settings. Create a new credential, obtain your API key from Google AI Studio, and paste it into the required field. Finally, choose the gemini-2.0-flash-lite model, as it provides a higher usage limit.; tools: n8n. Human role: The original post does not say how a person stayed involved.; limitations: Requires local Docker installation, n8n setup, and valid API keys for Google AI Studio and Gmail App Passwords. The source does not specify costs for API usage or email sending limits. Human approval is critical before sending real emails to avoid reputational damage. The workflow relies on a manually created data table, which may not integrate with existing ERP systems without further development..

Tools

n8n

Published on Agent Work Atlas:

Overview

Posted on Mar 23 • Originally published at Medium

Workflow

Posted on Mar 23 • Originally published at Medium In this article, I will walk you step by step through how to build your own AI agent using the open-source automation platform n8n. This agent will track overdue invoices and automatically send reminder emails to customers. The final system will look like this: If you want to use n8n for free, you can install and run it locally. For this, you need to install Docker on your computer. If you want to use n8n for free, you can install and run it locally. For this, you need to install Docker on your computer. First, go to the Docker Desktop website and download the version suitable for your operating system, then install it. Docker allows n8n to run on your computer in an isolated environment. First, go to the Docker Desktop website and download the version suitable for your operating system, then install it. Docker allows n8n to run on your computer in an isolated environment. To make sure your workflows and connections in n8n are not lost when you shut down your computer, we need to create a “storage space.” Open your terminal (CMD or PowerShell) and run the following command: To make sure your workflows and connections in n8n are not lost when you shut down your computer, we need to create a “storage space.” Open your terminal (CMD or PowerShell) and run the following command: Now, let’s start n8n. Paste the following command into your terminal: Once the installation is complete, open your browser and go to: http://localhost:5678 In this project, our scenario is as follows: we have a table that stores customers’ payment statuses. Normally, checking this table every day and manually sending reminder emails to overdue customers is time-consuming. The AI Agent we build will handle this process automatically in three steps: Data Retrieval: It checks the table and identifies which customers have outstanding debts and how many days they are overdue. Data Retrieval: It checks the table and identifies which customers have outstanding debts and how many days they are overdue. Analysis: Based on the amount and delay duration, it decides the tone of the email (a gentle reminder or a more urgent warning). Analysis: Based on the amount and delay duration, it decides the tone of the email (a gentle reminder or a more urgent warning). Action: It sends personalized emails automatically to customers. Action: It sends personalized emails automatically to customers. We will build this system in n8n using the following components: Trigger (When Chat Message Received): Listens for commands in the chat and starts the workflow. Trigger (When Chat Message Received): Listens for commands in the chat and starts the workflow. AI Agent: The main node that manages the process. AI Agent: The main node that manages the process. Gemini Chat Model: The “brain” that enables decision-making. Gemini Chat Model: The “brain” that enables decision-making. Memory: Short-term memory so the agent doesn’t forget what it’s doing. Memory: Short-term memory so the agent doesn’t forget what it’s doing. Tools: Used to read the table and send emails. Tools: Used to read the table and send emails. After completing the setup, let’s create a project in n8n. Click the + icon on the right side and select “On Chat Message”. This adds the required trigger. Click the + icon on the right side and select “On Chat Message”. This adds the required trigger. Then click the + button again and type “AI Agent” in the search bar. Add it and double-click on it to configure the settings. Then click the + button again and type “AI Agent” in the search bar. Add it and double-click on it to configure the settings. After this, you can close the window. The AI Agent has three outputs: Chat Model, Memory, and Tool. Click on the Chat Model input and select Gemini. Then, double-click on it to configure the settings. Create a new credential, obtain your API key from Google AI Studio, and paste it into the required field. Finally, choose the gemini-2.0-flash-lite model, as it provides a higher usage limit. Click on the Chat Model input and select Gemini. Then, double-click on it to configure the settings. Create a new credential, obtain your API key from Google AI Studio, and paste it into the required field. Finally, choose the gemini-2.0-flash-lite model, as it provides a higher usage limit.

Reported result

The source describes the setup process but does not report measured business outcomes, error rates, or time savings. It claims the system can access data, analyze debts, and send emails with a single command, but actual performance metrics are unknown. A measurable acceptance check would be verifying that the agent correctly filters 'Pending' status invoices and applies the specified tone rules in a test environment.

Human role

The original post does not say how a person stayed involved.

Limitations

Requires local Docker installation, n8n setup, and valid API keys for Google AI Studio and Gmail App Passwords. The source does not specify costs for API usage or email sending limits. Human approval is critical before sending real emails to avoid reputational damage. The workflow relies on a manually created data table, which may not integrate with existing ERP systems without further development.

Try it

Act as an automation engineer. I need to set up an n8n AI agent to send overdue invoice reminders. Inputs: - Source: [replaceable: URL to n8n tutorial or internal docs] - Data: [replaceable: CSV or table structure with columns: CustomerName, Email, Balance, DueDate, Status] - Credentials: [replaceable: Gmail App Password, Google AI Studio API Key] Steps: 1. Install n8n via Docker and create a persistent volume. 2. Create a workflow with an 'On Chat Message' trigger. 3. Add an AI Agent node configured with Gemini Chat Model and Simple Memory. 4. Configure two tools: 'getInvoices' (reads the data table) and 'sendPaymentReminder' (sends email via Gmail). 5. Set the AI prompt to filter for 'Pending' status, calculate days overdue, and adjust tone (polite <7 days, firm >14 days). 6. Run a dry run with 3 sample records. Output a JSON summary of intended emails. 7. STOP and wait for my confirmation before enabling the email sending tool for live data. Deliverables: A working n8n workflow JSON and a test log showing the dry run results. Do not send real emails without explicit approval.

Original source

Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.

More cases · Office & operations