Quick overview
This workflow reads Aruba “Hai ricevuto una nuova fattura elettronica” email notices via IMAP, extracts key invoice details into an n8n data table, and on a monthly schedule (or via webhook) generates an Excel report and uploads it to Dropbox, with email alerts for parsing failures or workflow errors.
How it works
- Polls an IMAP mailbox for Aruba e-invoice notice emails matching the subject filter and keeps track of the last processed message.
- Parses each email’s raw content to extract supplier, invoice number, document date, document type, totals, and the receipt timestamp (Europe/Rome), and derives a monthly key (yyyy.MM).
- Upserts successfully parsed invoices into an n8n data table using a unique key to prevent duplicates.
- Sends a Gmail email notification if a notice can’t be parsed so you can review and update the parsing logic.
- On the 1st of each month at 07:10 (or when called via an authenticated webhook with a target month), selects the month to consolidate and prepares the Dropbox destination path.
- Reads all stored invoices from the data table, filters them to the selected month, calculates totals (treating credit notes as negative), converts the rows to an Excel file, and uploads it to Dropbox.
- If the workflow execution errors, sends a Gmail email with the last executed step and a link to the failed n8n execution.
Setup
- Create an IMAP credential for the mailbox that receives Aruba notices and confirm the email filter (subject and SINCE date) matches your inbox history.
- Create an n8n data table with the expected columns (chiave, fornitore, numero, dataDocumento, tipo, totale, nettoAPagare, dataRicezione, meseRicezione) and select it in both data table steps.
- Add a Dropbox OAuth2 credential and set the base folder path used to store monthly Excel files.
- Add a Gmail credential and replace the recipient address ([email protected]) used for the parsing and error alert emails.
- If you use the on-demand rebuild endpoint, configure the webhook Header Auth credential and call the webhook URL with a JSON body like {"mese":"2026.10"}.
Requirements
- Aruba's e-invoicing service with email notices enabled (usually delivered to your PEC), an n8n version with data tables, and Dropbox and Gmail accounts.
Customization
- Swap Dropbox for Google Drive or OneDrive in the last two nodes, or change the SINCE date in the IMAP trigger options to import older notices.
Additional info
For an Aruba PEC mailbox use host imaps.pec.aruba.it, port 993, SSL; with two-step verification you need the app password for mail clients. The mailbox is never marked as read. Credit notes count as negative in the monthly total. Foreign invoices (TD17) don't go through Aruba and won't appear. Field names are in Italian on purpose: they mirror Aruba's notice and the columns an Italian accountant expects.