n8n No-Code Tutorial: Step-by-Step from Docker Install to AI Agent Drafting Personalized QuickBooks Invoice Reminder Emails with Gemini



Key Takeaways * Automate the tedious task of chasing overdue invoices by building an AI assistant. * This guide uses the open-source tool n8n (self-hosted with Docker) to connect QuickBooks, Google Gemini AI, and your email. * The AI agent automatically finds overdue invoices, drafts a unique, human-sounding reminder for each client, and sends it on a daily schedule.

Did you know that the average small business has over $80,000 tied up in unpaid invoices at any given time? That’s not just a number on a spreadsheet; it’s rent, payroll, and your own salary trapped in someone else’s inbox.

I’ve been there—the endless, awkward dance of "friendly reminders" that feel anything but. It’s a soul-crushing time sink that kills both your cash flow and your creativity.

But what if you could fire yourself from the role of "Chief Invoice Chaser" and hire an AI assistant to do it for you? An assistant that’s not only persistent but also crafts perfectly personalized, human-sounding emails for every single client.

That’s exactly what we’re building today. Forget generic, robotic templates.

We're going to use the open-source powerhouse n8n, running on your own machine with Docker, to build an AI agent powered by Google's Gemini. This agent will automatically find overdue invoices in QuickBooks, draft a unique reminder for each one, and send it out. All while you sleep.

Let's dive in.

Introduction: Why Your Business Needs an AI Invoicing Assistant

The hidden costs of chasing payments

It’s not just about the money. It’s about the time. Every hour you spend digging through QuickBooks and typing out the same polite-but-firm email is an hour you’re not spending on growing your business. It’s a low-value, high-stress task that’s ripe for automation.

From generic templates to personalized outreach

The problem with most automated reminders is they feel automated. An AI, however, can be prompted to change its tone. This personalization cuts through the noise and gets you paid faster.

What we'll build today: The complete workflow

Here’s the game plan: 1. Trigger: A schedule will kick off our workflow every single morning. 2. Fetch: n8n will connect to QuickBooks and pull a list of all invoices that are currently overdue. 3. Think: For each invoice, it will pass the client's name, invoice amount, and due date to Google's Gemini AI. 4. Draft: Gemini will act as our copywriter, drafting a personalized and polite reminder email. 5. Act: n8n will send that AI-generated email directly to the client.

Prerequisites: Gathering Your Tools

Before we start, you’ll need a few things. Don’t worry, it’s all straightforward.

Docker Desktop for a self-hosted n8n

We're self-hosting n8n because it gives us ultimate control and privacy. Docker is the cleanest, easiest way to do this. Go to the official Docker website and grab the version for your OS.

QuickBooks Online account access

This is where our invoice data lives. You'll need an active QuickBooks Online account that you have admin access to.

Google AI Studio account for a Gemini API Key

This is the "brain" of our operation. Head over to Google AI Studio, sign in, and create an API key. It’s free to get started and usage for this project is incredibly cheap.

Step 1: The Foundation - Installing n8n with Docker

Okay, let's get our hands dirty. Installing n8n with Docker is fast, isolated, and your data stays with you.

Creating your docker-compose.yml file

Open a plain text editor and create a new file named docker-compose.yml. Paste this exact code inside:

version: '3.1'
services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your_super_secret_password
      - TZ=America/New_York # Change this to your timezone!
    volumes:
      - ./n8n_data:/home/node/.n8n

Quick Breakdown: * ports: This makes n8n accessible in your browser at localhost:5678. * environment: I’ve set up basic username/password protection. Change your_super_secret_password to something secure! * volumes: This is crucial. It creates a folder that stores all your workflows and credentials, so your work isn't lost if you restart.

Running the docker compose up -d command

Save the file. Now, open your terminal, navigate to the folder where you saved your file, and run this command:

docker compose up -d

Docker will now download the n8n image and start it in the background. You can check that it's running with docker ps.

First login and setup of your n8n instance

Open your web browser and go to http://localhost:5678. Log in with the username (admin) and the password you set in the .yml file.

Step 2: The Trigger - Finding Overdue Invoices

Now for the fun part. Let's build the workflow.

Creating a new n8n workflow

In the n8n dashboard, click the "Add workflow" button. You’ll be presented with a blank canvas with a single "Start" node.

Setting up the Schedule Trigger to run daily

  1. Click the Start node.
  2. In the right-hand panel, change the "Trigger" to "Schedule".
  3. Set the "Mode" to "Every Day" and pick a time you want it to run, like 9 AM.

Connecting your QuickBooks account (OAuth2)

  1. Click the + icon to add a new node. Search for "QuickBooks Online" and select it.
  2. In the QuickBooks node settings, click "Credential" -> "Create New".
  3. A pop-up window will ask you to log in to your QuickBooks account and grant n8n permission.

Using the QuickBooks node to 'Find Invoices' with overdue status

  1. Once authenticated, set the "Resource" to "Invoice" and the "Operation" to "Find".
  2. Click "Add Filter" to specify which invoices we want.
  3. Set the "Field" to Status, the "Operation" to Equals, and the "Value" to Overdue.

Step 3: The Brain - Drafting Reminders with Gemini AI

This is where the magic happens. We'll feed the invoice data to our AI. This is a core concept for building modern AI agents, and it's surprisingly easy.

In fact, if you want to see another take on this, I built a similar agent using a front-end from Lovable, which I detailed in my guide to creating your first AI agent with Lovable & n8n.

Adding the Google Gemini (Generative AI) node

  1. Click the + after the QuickBooks node.
  2. Search for "Google Gemini" and add it.
  3. Create a new credential and paste in the API Key you got from Google AI Studio.

Crafting the perfect prompt to draft a friendly, firm reminder

This is the most important step. In the "Prompt" field of the Gemini node, we're going to write our instructions for the AI. This is where you can inject your company's personality.

Here’s a great starting prompt:

You are a friendly and professional accounts receivable assistant for 'Yemdi's Awesome Co'. Your goal is to get our invoices paid without damaging client relationships.

Draft a short, friendly, and firm reminder email for the following overdue invoice.

Client Name: Invoice Amount: Due Date:

Keep the tone polite but clear. Start with a friendly greeting using the client's name. Mention the invoice amount and the original due date. Ask them to let us know if they have any questions. Do not add a subject line.

Dynamically inserting customer and invoice data into the prompt

Notice the placeholders? We need to fill those with real data from QuickBooks.

  1. After "Client Name:", click the "Add Expression" icon (</>).
  2. Navigate the data tree: Nodes -> QuickBooks Online -> Output Data -> JSON.
  3. Drag the CustomerRef.name field into the expression editor. It will look like: {{ $('QuickBooks Online').item.json.CustomerRef.name }}.
  4. Do the same for the invoice amount (TotalAmt) and due date (DueDate).

Now, n8n will automatically run this for every single invoice it found, creating a custom prompt for each one.

Step 4: The Action - Sending the Personalized Email

The AI has drafted the email; now we just need to send it.

Setting up your preferred email node (e.g., Gmail, Outlook, or SMTP)

  1. Click the + after the Gemini node and add your email provider (e.g., "Gmail").
  2. Authenticate your account, likely using OAuth2 for security.

Mapping the Gemini AI output to the email body

In the "Text" or "Body" field of the email node, we'll use another expression. This time, we'll grab the output from our AI. The expression will look like {{ $('Google Gemini').item.json.text }}.

Mapping the customer's email address and a dynamic subject line

  • To: Use an expression to grab the customer's email from the QuickBooks node: {{ $('QuickBooks Online').item.json.BillEmail.Address }}.
  • Subject: Create something dynamic like: Friendly Reminder: Invoice from Yemdi's Awesome Co - {{ $('QuickBooks Online').item.json.DocNumber }}.

Optional: Adding an IF node to prevent sending to certain clients

What if you have a VIP client you always handle manually? Before the Gemini node, add an "IF" node. Set it to check if the CustomerRef.name from QuickBooks is not equal to "MegaCorp Inc.".

Step 5: Test, Activate, and Get Paid!

We're at the finish line. Don't skip this part!

Running a test execution to see the workflow in action

At the bottom of the editor, click "Execute Workflow". n8n will run through the steps, and you'll see green checkmarks on each node as it succeeds.

Reviewing the AI-generated email draft

Click on the Gemini node, then go to the "Output" tab. You can see the exact email text it generated. Is the tone right? Is the data correct?

If not, go back and tweak your prompt. The principles of crafting instructions for an AI are universal across platforms, something I also explored when building a customer service agent in Make.com.

Activating your workflow for automated daily runs

Once you're happy with the test run, save your workflow. In the top right corner, toggle the switch from "Inactive" to "Active". That's it. Your AI invoicing assistant is now officially on the clock, 24/7.

Conclusion: Beyond Reminders - What Else Can You Automate?

You just built an incredibly powerful system that saves you time, reduces stress, and improves your cash flow. You took three separate platforms—QuickBooks, Google AI, and Gmail—and stitched them together into a single, intelligent agent. No code required.

This is just the beginning. You could extend this workflow to: * Send an AI-generated "Thank You" email when an invoice is marked as paid. * If an invoice is 30 days overdue, create a task in your project management tool for a manual phone call. * Add a summary of all reminders sent to a daily report in a Google Sheet.

You've turned a manual, dreaded task into a smart, automated process. Now go take that time you've saved and use it to build something amazing.



Recommended Watch

📺 Generate Invoices, Smart Reminders and Send AI-Summarized Reminders with N8N, Jotform and QuickBooks
📺 Build an AI Agent that processes your Invoices (N8N)

💬 Thoughts? Share in the comments below!

Comments