Skip to content

A self-hosted n8n automation that reads work hour logs from Gmail, formats them with OpenAI, generates an invoice in Google Sheets, and replies with a PDF report.

Notifications You must be signed in to change notification settings

jhonatanparada499/n8n-invoice-updater-and-responder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Invoice Updater and Auto-Responder (n8n)

The purpose of this self-hosted n8n workflow is to automate the process of invoice creation and PDF formatting. In simple terms, this workflow use the Gmail API to check for new emails, the OpenAI API to extract and process hand-written work log entries, Google Sheets API to update an invoice template with formatted invoice data, Google Drive to create and download a PDF report, and lastly, it sends the final invoice PDF to the a specific recipient.

Services Employed

How It Operates

  1. When a new email that meets your criteria arrives, the Gmail Trigger is activated.
  2. OpenAI Node: Transforms email content into structured JSON invoice entries by sending it to GPT-4.1-NANO with a predefined configuration prompt.

  1. Code Node: Parses text string from the ChatGPT node to JSON format.
  2. Clear + Update in Google Sheets: Clears out an invoice template in Google Drive before updating it with new parsed data entries.
  3. Google Drive (Download): Gets a Google Sheet formatted to PDF sent to the the recipient that meeets your criteria.

Set up Required Credentials

  • OpenAI API Key
  • Google Sheets, Drive, and Gmail (OAuth2 or App Passwords)

Replace the following in the workflow:

  • Google Sheet ID (in Sheets node)
  • Gmail “To” and “From” fields (in Send and trigger nodes)

Notes

About

A self-hosted n8n automation that reads work hour logs from Gmail, formats them with OpenAI, generates an invoice in Google Sheets, and replies with a PDF report.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published