Skip to main content

Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack

Workflow preview

Workflow preview
100%
Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow polls Gmail every 15 minutes for unread invoice or receipt emails, uses Anthropic Claude (Sonnet) to extract key financial fields, logs new documents to Google Sheets, ...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmailtrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatanthropic, n8n-nodes-base.googlesheets, n8n-nodes-base.if, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Akshay Chug.

Original n8n.io source

1.1 Workflow description

Title
Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack
Workflow name
Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack

Quick overview

This workflow polls Gmail every 15 minutes for unread invoice or receipt emails, uses Anthropic Claude (Sonnet) to extract key financial fields, logs new documents to Google Sheets, sends optional Slack alerts for overdue or high-value invoices, and marks processed emails as read.

How it works

  1. Runs every 15 minutes and triggers on unread emails in Gmail.
  2. Prepares the email metadata and body text (and any available attachment text) and sets configuration values like the Google Sheets target and Slack threshold.
  3. Sends the combined email content to Anthropic Claude Sonnet to classify the document and extract structured invoice/receipt fields as JSON.
  4. Parses the AI response, normalizes amounts and dates, and flags items as overdue or high value based on your threshold.
  5. Checks Google Sheets for an existing entry with the same invoice number to avoid duplicates.
  6. Appends new invoice/receipt records to the Google Sheets log and posts a Slack message when an alert condition is met.
  7. Marks the Gmail email as read after logging (and after any Slack alert) to keep the inbox clean.

Setup

  1. Connect your Gmail account in both the Gmail trigger and the “Mark as read” action.
  2. Add an Anthropic (Claude) API credential and ensure the Claude Sonnet model is available in your account.
  3. Connect your Google Sheets account, set the target spreadsheet ID and sheet name, and create columns that match the fields being appended (for example: Timestamp, From, Subject, Invoice Type, Vendor Name, Invoice Number, Invoice Date, Due Date, Currency, Subtotal, Tax, Total Amount, Payment Status, Line Items, Confidence, Email ID).
  4. (Optional) Connect your Slack account and set the Slack channel ID, then set the high-value threshold amount used to trigger alerts.
  5. Review the Gmail polling interval and unread-only filter to match how you want invoices and receipts to be picked up.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Check Gmail for Invoices

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 7 - Configure Settings

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Extract Invoice Data with Claude

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 9 - Claude Sonnet

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 10 - Parse and Validate Extraction

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Check for Duplicate

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 12 - Is New Invoice

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 13 - Log Invoice to Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 14 - Needs Slack Alert

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 15 - Notify - High Value or Overdue

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 16 - Mark Email as Read

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

3. Summary Table

Workflow Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack
Complexity advanced
Nodes 16
Categories Invoice Processing, AI Summarization
Author Akshay Chug
Published 03 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16091/16091.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract and log Gmail invoices with Claude Sonnet, Google Sheets and Slack do?

Quick overview This workflow polls Gmail every 15 minutes for unread invoice or receipt emails, uses Anthropic Claude (Sonnet) to extract key financial fields, logs new documents to Google Sheets, ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.