💼

AI Payment Reminder Workflow

Aug 22, 2025

Summary

  • David from David's Donut Den demonstrated how to build a no-code AI agent using n8n for automating payment reminders for overdue invoices.
  • The video covered key agent characteristics, a free self-hosted setup with Docker, and integrating third-party tools like QuickBooks and Gmail.
  • The workflow included model and memory setup, structured prompting, human-in-the-loop approval via Discord, and a full automation pipeline.
  • The process ends with conditional email sending based on human approval, improving both efficiency and business professionalism.

Action Items

  • No due date – David: Proofread agent prompt generated by ChatGPT before use.
  • No due date – David: Set up required credentials for Gemini, QuickBooks Online, Gmail, and Discord bot in n8n.
  • No due date – David: Update tool and node names in n8n for clarity (e.g., "Get Invoices", "Send Payment Reminder").
  • No due date – David: Adjust tool descriptions and prompts if the agent sends incorrect or incomplete data.
  • No due date – David: Test the workflow end-to-end, ensure emails are only sent after human approval in Discord.

Agent Capabilities and Setup Overview

  • Defined an AI agent as an autonomous, reasoning-driven digital teammate with memory and tool access.
  • Chose n8n for free workflow automation, with a walkthrough on setting up n8n locally using Docker Desktop.
  • Demonstrated connecting n8n to Google Gemini LLM via API key for reasoning capabilities.
  • Explained adding memory to the agent for context retention using simple memory nodes.
  • Showed integrating QuickBooks Online for retrieving overdue invoices and Gmail for sending email reminders.
  • Highlighted teaching the agent tool names and functions for reliable operation.

Building the Payment Reminder Agent Workflow

  • Started with a chat-based workflow, then transitioned to a scheduled weekly trigger.
  • Used AI to define filters for retrieving only overdue invoices.
  • Let the AI model generate dynamic email content, including subject and body, relying on model-based parameter filling.
  • Disabled unwanted attributions for a professional email appearance.
  • Walked through creating and refining the agent prompt using a template and ChatGPT, incorporating goal, context, tool access, and output requirements.
  • Used JavaScript within n8n for dynamic date handling so the agent knows "today's" date.

Human-in-the-Loop Approval Integration

  • Added a Discord node for human approval before sending emails, ensuring one email per customer regardless of number of overdue invoices.
  • Required output formatting for the agent so each email’s subject, body, and recipient are available for approval.
  • Implemented a "split out" node to process multiple emails as separate approval requests.
  • Used a loop to handle each pending email sequentially, integrating Discord for approve/disapprove decisions.

Testing and Final Workflow Adjustments

  • Reviewed and debugged common issues, such as missing information and model output errors.
  • Updated prompt and tool descriptions to better instruct the agent and avoid mishandled queries (e.g., not inventing SQL statements).
  • Configured conditional logic—emails are only sent if approved in Discord, ensuring manual control and oversight.
  • Provided paths for rejections and approvals to properly return to the loop for all pending items.

Decisions

  • Use a structured, human-in-the-loop approval process — To ensure all automated payment reminder emails are reviewed before sending, improving reliability and business professionalism.

Open Questions / Follow-Ups

  • Will this workflow be adapted for other customer communications or kept solely for payment reminders?
  • Are there data privacy or compliance considerations when integrating with QuickBooks and Gmail not yet addressed?
  • Is there a plan for monitoring or logging agent errors or failures over time?