Automated Invoice Processor: Nextcloud, Email & Telegram
Integrates with:
Overview
Unlock Effortless Invoice Management with this Automated Workflow
This n8n workflow automates the entire lifecycle of your PDF invoices, from retrieval to notification and archival. It connects to your Nextcloud instance to fetch new invoices from a designated /Invoice/Incoming
folder. Once retrieved, the invoice is sent via email to a specified address (e.g., invoice@example.com
), a confirmation message with the filename is dispatched to your Telegram, and finally, the processed invoice is moved to an archive folder like /Invoice/2025/archive
. This automation is ideal for solopreneurs, freelancers, and small businesses aiming to significantly reduce manual effort and ensure timely invoice processing.
Key Features & Benefits
- Automated Daily Runs: Triggers daily at 8 AM (customizable) to process new invoices consistently.
- Nextcloud Integration: Fetches PDF invoices directly from
/Invoice/Incoming
and archives them to/Invoice/YYYY/archive
(e.g.,/Invoice/2025/archive
) in your Nextcloud. - Email Dispatch: Automatically emails invoices using your configured SMTP server to a predefined recipient.
- Real-time Telegram Alerts: Sends instant notifications to a Telegram chat with the processed invoice's filename, keeping you informed.
- Organized Archiving: Moves processed files to a structured archive folder, keeping your primary invoice folder clean and organized.
- Increased Efficiency: Frees up valuable time by automating repetitive invoice management tasks, allowing you to focus on core business activities.
- Customizable: Easily adapt folder paths, email recipients, notification messages, and scheduling to fit your specific operational needs.
Use Cases
- B2C E-commerce: Automate sending supplier invoices from a shared Nextcloud drive to your finance team and get notified on Telegram.
- B2B SaaS: Streamline internal invoice processing by centralizing PDF invoices in Nextcloud and automatically emailing them to accounts payable, with Telegram updates for the finance head.
- Solopreneurs/Freelancers: Effortlessly manage and dispatch client or vendor invoices stored in Nextcloud to an accountant or for record-keeping, receiving personal Telegram confirmations for each.
- Small Businesses: Ensure timely processing and archival of incoming vendor invoices, reducing manual data entry, minimizing errors, and improving financial record-keeping.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- Nextcloud account and credentials with read/write access to the specified invoice and archive folders.
- SMTP server credentials (e.g., from your email provider) for sending emails.
- Telegram Bot API Token and a Chat ID for receiving notifications.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Configure the 'Schedule' trigger node (labeled 'Daily at 8 AM' in the original) to your desired frequency and time.
- In the first 'Nextcloud' node (List Files operation for
/Invoice/Incoming
): a. Select or create your Nextcloud credentials. b. Verify the 'Path' is set to your incoming invoices folder (e.g.,/Invoice/Incoming
). - The 'IF' node filters for existing entries, usually no configuration needed initially.
- In the second 'Nextcloud' node (Download File operation):
a. Ensure it uses the same Nextcloud credentials.
b. Verify 'Path' is correctly referencing files from the 'List Files' node (e.g.,
{{ $json.path }}
). - Configure the 'Send Email' node:
a. Select or create your SMTP credentials.
b. Set the 'To Email' to the desired recipient (e.g.,
invoice@example.com
). c. Customize the 'Subject' and 'HTML' / 'Text' body as needed. d. Ensure the 'Attachments' field is correctly configured to send the downloaded file (usually{{ $node["Nextcloud1"].binary.data }}
or similar, referencing the output of the download node with the binary data). - Configure the 'Telegram' node:
a. Select or create your Telegram Bot credentials (using API Token).
b. Set the 'Chat ID' for notifications.
c. Customize the 'Text' message (e.g.,
Invoice processed: {{ $json.fileName }}
). - In the third 'Nextcloud' node (Move File operation for archiving):
a. Ensure it uses the same Nextcloud credentials.
b. Set 'Path' to reference the original file path (e.g.,
{{ $json.path }}
). c. Set 'New Path' to your desired archive location, including the dynamic year and filename if needed (e.g.,/Invoice/2025/archive/{{ $json.fileName }}
or/Invoice/{{ new Date().getFullYear() }}/archive/{{ $json.fileName }}
). - Test each node, especially credentialed ones, to confirm correct setup.
- Activate the workflow.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Request a Consultation