Templates / Automatically create invoices from Gmail labels with GPT-4O + QuickBooks

Automatically create invoices from Gmail labels with GPT-4O + QuickBooks

Needs changes

by Rosh Ragel ✓ · 936 views · created 2025-07-27 · Invoice Processing, AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 12 nodes and runs on a schedule (every hour). Along the way it connects QuickBooks Online, Gmail and OpenAI Chat Model.

How it runs

Trigger: On a schedule (every hour).

  1. Get Messages w/ Invoice Needed Label (Gmail): get many
  2. Combine all Messages in a Thread (Code): runs custom JavaScript code
  3. AI Agent: runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  4. Add Client to QBO (QuickBooks Online): create
  5. Find Existing Customer (QuickBooks Online): get many
  6. Create A New Invoice (QuickBooks Online): create (invoice)
  7. Download Invoice (QuickBooks Online): work with invoice
  8. Write Draft Reply to Client (Gmail): work with draft
  9. Remove Invoice Needed Label (Gmail): remove labels (thread)

Services it uses

QuickBooks OnlineGmailOpenAI Chat Model

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Agent: Extract Customer & Invoice Details (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Agent: Extract Customer & Invoice Details (v1.9)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (7)

From the author

What It Does This workflow reads Gmail threads labeled Invoice Needed, extracts invoice and client details using an AI agent, and creates a draft invoice in QuickBooks Online. It then downloads the invoice as a PDF and drafts a reply email with the invoice…

Excerpt from Rosh Ragel's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.