๐Ÿ”ฌ Automated invoice generator from Google Sheets to Google Docs

โšก 1,286 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

This workflow automates invoice creation using Google Sheets for structured input and Google Docs for templated output โ€” all built inside n8n.


๐Ÿ› ๏ธ Step-by-Step Instructions

### Step 1: Manual Trigger

Start the workflow manually for testing or development purposes.


### Step 2: Google Sheets โ€” Load Invoice Data

Pulls invoice data from a Google Sheet.

> ๐Ÿ”‘ Credentials Required:
> Connect to Google Sheets OAuth2 API in n8n.
> Be sure your sheet is shared with the connected Google account.


### Step 3: Get Invoice Template โ€” Load Google Doc

Loads a static Google Docs template containing placeholder values.

> ๐Ÿ”‘ Credentials Required:
> Connect to Google Docs OAuth2 API in n8n.


### Step 4: Create New Doc โ€” Make Invoice File

Creates a new Google Doc by duplicating the invoice template.

> ๐Ÿ” Make sure your Google Docs credential has write access to this folder.


### Step 5: Merge โ€” Combine Data

Merges the loaded document and spreadsheet row together for downstream updates.


### Step 6: Insert Content into Doc (Optional)

You can insert additional content here if needed.
For example, a note, header, or footer pulled from your database or a custom field.


### Step 7: Input Invoice Details โ€” Replace Fields

Uses Google Docs API to replace all placeholders from the original template with the actual values.

Replacements:

PlaceholderReplaced With
FromCompany#Company From from sheet
ToCompany#Company To from sheet
Terms#Terms from sheet
Invoice#Invoice number
Description#Description of service
Amount#Amount of invoice

๐Ÿ“ค Final Output

Each row from the Google Sheet results in a completed, branded Google Doc invoice stored in your Drive.


๐Ÿ™‹ Need Help?

Robert Breen
Automation Consultant
๐ŸŒ ynteractive.com
๐Ÿ“ง robert.j.breen@gmail.com
๐Ÿ”— LinkedIn


๐Ÿ”’ Required APIs

ServicePurpose
Google Sheets APIPull structured invoice data
Google Docs APILoad & modify invoice documents
n8n OAuth2Connect both services securely

Let me know if youโ€™d like a follow-up step to export invoices as PDFs or auto-email them to clients!

๐Ÿ”— Nodes Used

Google Sheets, Google Docs

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup