Templates / Track job costs and margins with Gmail, Google Sheets and OpenAI

Track job costs and margins with Gmail, Google Sheets and OpenAI

Ready for 3.0

by Michael Matthews ✓ · 0 views · created 2026-10-28 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 51 nodes and runs on Gmail events (plus 5 other triggers). Along the way it connects Gmail, Google Sheets, OpenAI and OpenAI Chat Model.

How it runs

Trigger: On Gmail events (plus 5 other triggers).

  1. Your settings (Edit Fields (Set)): sets or maps fields
  2. Read settings for the form (Code): runs custom JavaScript code
  3. Read your settings (Code): runs custom JavaScript code
  4. Find the job (Google Sheets): uses Google Sheets
  5. What started this? (Switch): routes items into branches
  6. Check the hours (Code): runs custom JavaScript code
  7. Read the jobs (Google Sheets): uses Google Sheets
  8. Create the spreadsheet (Google Sheets): uses Google Sheets
  9. Hours row (Edit Fields (Set)): sets or maps fields
  10. Read the costs (Google Sheets): uses Google Sheets

…plus 34 more steps. See the full node list below.

Services it uses

GmailGoogle SheetsOpenAIOpenAI Chat Model

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Receipt email).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (18)

From the author

Quick overview This workflow tracks job costs by extracting totals and details from receipt emails in Gmail using OpenAI, logging crew hours via an n8n form, and updating a Google Sheets job-cost spreadsheet with daily budget and margin checks plus email…

Excerpt from Michael Matthews'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.