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

⚡ 856 views · 🧾 Invoice Processing

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

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 attached — all automatically.

Perfect for freelancers, agencies, or small businesses looking to streamline client billing from email.

Prerequisites

To use this workflow, you’ll need:

How to Label Threads

How It Works

  1. Trigger: The workflow runs on a schedule (e.g., every hour)
  2. Fetch Emails: Gmail node pulls all threads with the Invoice Needed label
  3. Group Messages: Emails in each thread are grouped together
  4. AI Extraction: An OpenAI-powered agent extracts client info, billing address, invoice amount, and description
  5. Add a New Client: This node will attempt to create a new client in QuickBooks
  6. Find Existing Client If the client already exists, this node will find the client’s id
  7. Create Invoice: An invoice is created based on the extracted details
  8. Download PDF: The invoice is saved as a PDF
  9. Draft Reply: A Gmail draft is created with a template message and the invoice attached
  10. Remove Label: The processed thread is untagged to avoid duplicates

Example Use Cases

How to Use

Optimization Instructions:

Customization Options

Why It’s Useful

This workflow eliminates the manual labor of crafting invoices from scratch by automating the entire process—from email to invoice. It reduces the need to switch between multiple apps, since you no longer have to open QuickBooks Online to create an invoice. By streamlining your billing workflow, it saves time, minimizes errors, and lets you stay focused on your actual work while still keeping full control over outgoing communications.

🔗 Nodes Used

Gmail, QuickBooks Online, Schedule Trigger, AI Agent, OpenAI Chat Model, Structured Output Parser

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup