How It Works
This workflow automatically detects duplicate invoices from Gmail. Incoming PDF attachments are scanned by the easybits AI Extractor, then checked against the Master Finance File in Google Sheets. Duplicates trigger a Slack alert – new invoices get added to the sheet.
Flow overview:
- Gmail picks up new emails labeled as invoices (polls every minute)
- The PDF attachment is extracted and converted to base64
- easybits Extractor reads the document and returns structured data
- The invoice number is compared against all existing entries in Google Sheets
- If duplicate → Slack DM alert to felix.sattler
- If new → Invoice is appended to the Master Finance File
Step-by-Step Setup Guide
1. Set Up Your easybits Extractor Pipeline
Before connecting this workflow, you need a configured extraction pipeline on easybits.
- Go to extractor.easybits.tech and click "Create a Pipeline".
- Fill in the Pipeline Name and Description – describe the type of document you're processing (e.g. "Invoice / Receipt").
- Upload a sample receipt or invoice as your reference document.
- Click "Map Fields" and define the following fields to extract:
invoice_number (String) – Unique identifier of the invoice, e.g. IN-2026-0022514
total_amount (Number) – Total amount due on the invoice, e.g. 149.99
- Click "Save & Test Pipeline" in the Test tab to verify the extraction works correctly.
- Go to Pipeline Details → View Pipeline and copy your Pipeline ID and API Key.
2. Connect the easybits Node in n8n
- Open the HTTP Request node in the workflow.
- Replace the Pipeline ID in the URL with your own.
- Set up a Bearer Auth credential with your API Key.
The node sends the PDF to your pipeline and receives the extracted fields back under json.data.
3. Connect Gmail
- Open the Gmail Trigger node.
- Connect your Gmail account via OAuth2.
- Create a label called invoice in Gmail (or use your preferred label).
- Update the label filter in the node to match your label.
- Make sure Download Attachments is enabled under Options.
The trigger polls every minute for new emails matching the label.
4. Connect Google Sheets
- Open the Check Google Sheets and Add to Master List nodes.
- Connect your Google Sheets account via OAuth2.
- Select your target spreadsheet (Master Finance File) and sheet.
- Make sure your sheet has at least these columns: Invoice Number and Final Amount (EUR).
5. Connect Slack
- Go to api.slack.com/apps and create a new Slack App.
- Under OAuth & Permissions, add these Bot Token Scopes:
chat:write, chat:write.public, channels:read, groups:read, users:read, users.profile:read.
- Install the app to your workspace via Settings → Install App.
- Copy the Bot User OAuth Token and add it as a Slack API credential in n8n.
- Open the Slack: Alert Finance node and select the user or channel to receive duplicate alerts.
6. Activate the Workflow
- Click the "Active" toggle in the top-right corner of n8n to enable the workflow.
- Label an email with an invoice attachment as invoice in Gmail to test it end to end.
- Check your Google Sheet – a new row with the invoice number and amount should appear.
- Send the same invoice again – you should receive a Slack DM alerting you to the duplicate.