🧾 Automate timesheet to invoice conversion with OpenAI, Gmail & Google Workspace

74 views · 🧾 Invoice Processing

Description

This workflow converts emailed timesheets into structured invoice rows in Google Sheets and stores them in the correct Google Drive folder structure.

It:


Quick Implementation Steps

  1. Import the workflow JSON into your n8n instance.
  2. Set up credentials for:
    • Gmail
    • Google Drive
    • Google Sheets
    • OpenAI
  3. Check the OCR HTTP node:
    • Default URL: https://universal-file-to-text-extractor.vercel.app/extract
  4. Configure “Get Customer Info From PO Sheet” with:
    • Spreadsheet ID
    • Correct sheet and column names
  5. Confirm Gmail Trigger filter:
    • has:attachment (filename:timesheet OR subject:timesheet) and unread only
  6. Ensure your Client Invoices root folder exists in Google Drive.
  7. Test once with a sample timesheet email.
  8. Activate the workflow.

What It Does


Who Is It For


Requirements


How It Works

1. Email Intake and Loop

2. OCR and AI Parsing

3. Customer and PO Lookup

4. Drive Folder Discovery

6. Reuse vs Create Sheet

New Sheet Path

Existing Sheet Path


How To Set Up

1. Import and Credentials

2. Customer POs Sheet

3. Drive and Gmail

4. Test

5. Activate


How To Customize


Use Case Examples


Troubleshooting Guide

IssuePossible Solution
No rows are createdCheck Gmail Trigger is active and the filter matches the email. Confirm email is unread and has attachments.
OCR returns empty or errorCheck OCR URL, status code, and supported file types. Log the response body.
Wrong or missing dates or hoursReview OpenAI prompt and a sample output. Ensure JSON keys in Set Timesheet JSON Fields match the AI output.
Folders not found or createdConfirm the Client Invoices root exists and that Client Name and Folder Name text matches what the workflow expects.
Files in wrong year folderCheck Current Year extraction and Year Folder search logic.
Duplicate sheets for same periodCheck file naming code and Drive search nodes for exact match on names.
Due Date incorrectConfirm Due Date Calculation in PO sheet and date math formats in Set and append nodes.

Need Help or More Workflows?

Want to customize this workflow for your business or integrate it with your existing tools?
Our team at Digital Biz Tech can tailor it precisely to your use case from automation logic to AI-powered enhancements.

We can help you set it up for free — from connecting credentials to deploying it live.

Contact: rajeet.nair@digitalbiz.tech
Website: https://www.digitalbiz.tech
LinkedIn: https://www.linkedin.com/company/digital-biz-tech/
You can also DM us on LinkedIn for any help.


🔗 Nodes Used

Google Sheets, HTTP Request, Google Drive, Gmail Trigger, OpenAI

📥 Import

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

📖 Importing guide · 🔑 Credential setup