n8n

How to Automate Gmail Drive Invoice Management?

Get invoice emails out of your inbox and into the right Google Drive folder, then notify your team on Slack. Ideal for finance teams that receive bills by email and need a clean year and month folder structure.

Each day at 23:45, a schedule checks Gmail for unread messages from a chosen sender that include attachments. A small date step builds the current year and a zero padded month, which are used to find matching folders in Google Drive. The flow pairs each email with the correct month folder, uploads the first attachment, and then marks the email as read so it will not be processed again. A Slack message confirms the upload and shows the stored path. You can also run it by hand for quick tests.

Set up requires Gmail, Google Drive, and Slack accounts, plus year and month folders already created in Drive. Expect to cut daily filing time from minutes to seconds and keep documents organized the same way every time. Best for vendor invoices, fuel receipts, and recurring bills that arrive by email.

What are the key features?

  • Daily schedule at 23:45 plus a manual run option for testing
  • Date function builds current year and zero padded month for folder matching
  • Google Drive search finds the year folder by name and the month folder under it
  • Gmail filter pulls unread messages with attachments from a chosen sender
  • Merge step pairs each email with the correct month folder before upload
  • Uploads the first attachment to the month folder with resolved file data
  • Marks the source email as read by removing the UNREAD label
  • Sends a Slack message to confirm the file and its storage path

What are the benefits?

  • Reduce manual filing from 15 minutes to under 1 minute per day
  • Eliminate 2 daily tasks saving attachments and moving files
  • Reduce filing errors by 90% using year and month folders
  • Connect Gmail Google Drive and Slack in one simple flow
  • Prevent duplicate uploads by marking emails as read
  • Handle many invoices overnight without extra work

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Google Drive and Slack. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create a Gmail OAuth2 credential. Open the Gmail node and pick this credential so n8n can read emails and edit labels.
  4. Create a Google Drive OAuth2 credential. Assign it to the Get Year folder, Get Month folder, and Upload to Google Drive nodes.
  5. Create a Slack OAuth2 credential. Select it on the Slack node and choose the target channel.
  6. Open the Gmail node and adjust the search query to match your sender. Example: from:vendor@example.com has:attachment is:unread.
  7. Ensure your Google Drive has a folder named with the current year and a child folder named with the current month in two digits, such as 2025 and 03.
  8. Run a manual test. Click Execute, watch the run, and confirm the month folder id is found and one attachment is present.
  9. Send a test email from the allowed sender with a sample invoice file. Confirm the file appears in the correct month folder and the Gmail email is no longer unread.
  10. Check Slack for the confirmation message. If nothing appears, verify the Slack credential and the channel setting.
  11. Enable the schedule by keeping the Cron node active. Save and activate the workflow so it runs nightly at 23:45.
  12. Troubleshooting: If no upload occurs, make sure the month folder exists and the Gmail query matches. Note that only the first attachment is uploaded. Verify the Gmail credential has permission to modify labels.
  13. Optional: Adjust the Cron time to fit your time zone and processing window.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Slack

Sign up

Free plan: $0 / mo; limited to 10 apps (third-party or custom) and usable via Slack API

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.