n8n Tutorial for Beginners - Build Your First Free AI Agent

Quick Overview

This n8n tutorial demonstrates how to build a free AI agent that automates sending payment reminders via email, integrating with QuickBooks Online and using Google Gemini for AI processing.

Key Points: The tutorial successfully builds an AI agent using n8n that identifies overdue invoices in QuickBooks Online and sends payment reminders via email. Key components of the agent include the "When chat message received" trigger, "Agent" node, "Google Gemini Chat Simple Model" for AI, "Simple Memory" for context, "getInvoices" tool for QuickBooks data, and "sendPaymentReminder" tool for email. The agent's prompt is carefully structured with "Role", "Task", "Tools", and "Outputs" to guide its behavior, including escalating tone for overdue invoices. The workflow utilizes JavaScript expressions within n8n to dynamically fetch the current date for invoice filtering. The tutorial demonstrates the use of "Split Out" and "Loop Over Items" nodes to process multiple invoices and send individual emails. A "Create a channel" node for Discord is added to receive approval for sending emails, showcasing conditional logic. The final workflow successfully sends payment reminders and provides a JSON summary of the actions taken.

Context: The video is a tutorial demonstrating how to build an AI agent using the n8n workflow automation platform. The presenter, David, explains the core components of an AI agent and guides viewers through setting up a practical workflow that automates sending payment reminders to customers with overdue invoices.

Detailed Analysis

The tutorial guides viewers through building an AI agent using n8n, a workflow automation tool. The agent's purpose is to identify customers with overdue invoices in QuickBooks Online and send them payment reminders. The workflow begins with a "When chat message received" trigger, feeding into an "Agent" node. This agent node connects to a "Google Gemini Chat Simple Model" for AI processing, a "Simple Memory" node to store context, a "getInvoices" tool to retrieve overdue invoices from QuickBooks Online, and a "sendPaymentReminder" tool to send emails via Gmail. The prompt for the agent is carefully crafted to define its role, task, tools, and desired output format, ensuring it acts as a collections assistant that escalates its tone as invoices become more overdue. The tutorial also covers setting up necessary credentials, like API keys for Google Gemini and SMTP credentials for Gmail, and configuring the different nodes, including the "getInvoices" query to filter for overdue invoices and the "sendPaymentReminder" tool to customize email content. Finally, it shows how to execute the workflow, troubleshoot errors, and use the "Split Out" and "Loop Over Items" nodes to process multiple invoices and send individual emails, culminating in a successful test run that sends emails and provides a JSON summary of the action.

Raw markdown version of this recap