I want to automatically create a new expense in Invoice Ninja (v5) and upload a PDF attachment from a Gmail email as the document, using n8n. I want this to work no matter what the PDF is called.
Can someone please show (step-by-step or with screenshots) how to set up the n8n nodes, so the PDF from Gmail is attached as the expense document in Invoice Ninja?
Thank you!
I don’t have any experience with n8n but maybe this answer from ChatGPT will help:
Here’s a step-by-step guide to automatically create an expense in Invoice Ninja v5 and upload a PDF attachment from Gmail as a document using n8n, regardless of the file name.
Prerequisites
n8n instance running (cloud or self-hosted)
Invoice Ninja v5 API key (Settings > API Tokens)
Google/Gmail account connected in n8n
Goal Flow Summary
Gmail Trigger → Filter for PDF → Invoice Ninja HTTP Request (Create Expense) → Invoice Ninja HTTP Request (Upload PDF)
Step-by-Step Instructions
1. Gmail Trigger
Node: Gmail → Trigger
Operation:Watch emails
Search Criteria: Label or custom filter for relevant emails (e.g., Label = “Expenses”)
Example Filter: has:attachment filename:pdf
Authentication: Connect to Gmail via OAuth2 in n8n
2. Filter PDF Attachments
Node:IF (or Function)
Condition:
Check that the attachment is a .pdf
Ensure there is at least one attachment
You can skip this node if you already filtered via Gmail query.