Automated Invoice Processing and Archival with Nextcloud and Telegram Alerts - n8n Workflow

Use this robust n8n workflow to automate invoice management. It features a scheduled n8n trigger to scan Nextcloud folders, email documents via SMTP, and notify teams using Telegram.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Small Business Owners: Seeking to automate routine financial documentation sharing.
Accountants & Bookkeepers: Needing reliable, timestamped confirmation when invoices are sent.
IT Administrators: Looking for tested n8n templates for self-hosted cloud and notification systems.
n8n Users: Interested in advanced file operations using the Nextcloud n8n node.

Overview

Managing incoming invoices often requires repetitive tasks: checking a folder, downloading the file, attaching it to an email, and moving the original file to an archive. This high-efficiency n8n workflow eliminates these manual steps entirely. By employing a powerful combination of a scheduled n8n trigger and the Nextcloud n8n node, this solution ensures invoices are processed daily at a set time.

The logic includes strict conditional checks to prevent flow failure and uses global parameters to easily manage recipient emails and folder paths. This specific n8n workflow is ideal for organizations using Nextcloud as their primary document management system and needing instant communication (via Telegram) confirming successful file transfers. Deploying this n8n templates solution saves significant time and reduces errors associated with manual file handling and emailing.

How it Works

This n8n workflow is activated by a time-based n8n trigger, initiating the entire process daily at 8:00 AM.


  1. Initialization and Configuration: The automation first passes through the Set Parameters n8n node, which defines key operational variables, including the source Nextcloud income path (/Invoices/2025), the archive path, and the sender/recipient email addresses.

  2. File Listing: The List Incoming Invoices Nextcloud n8n node connects to the Nextcloud instance and retrieves a list of all files found in the defined income path.

  3. Conditional Check: The File Exists? n8n node acts as a core logic control, checking if the file path is non-empty. If no invoices are present, the workflow stops for that cycle; if files are found, the process continues.

  4. Invoice Handling: The Download Invoice Nextcloud n8n node fetches the binary file data for the invoice.

  5. Email Dispatch: The Send Email n8n node uses the fetched binary data and SMTP credentials to send the invoice as an attachment to the defined recipient ([email protected]).

  6. Archiving: Upon successful emailing, the Archive File Nextcloud n8n node performs a 'move' operation, relocating the original file from the income path to the designated archive folder, ensuring the primary folder remains clean for new incoming invoices.

  7. Notification: Finally, the Notify Telegram n8n node sends a confirmation message to a predefined chat ID, logging which invoice file was successfully processed and sent. This completes the fully automated n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided JSON data and paste it directly into your n8n instance via the 'New' menu and selecting 'Import from JSON'.

  2. Credential Setup: You must configure three sets of credentials:

NextCloud API: Connect your Nextcloud instance with the appropriate server URL, username, and password/app token.
SMTP: Configure your email sending credentials (host, port, username, password) for the Send Email n8n node.
* Telegram API: Set up a Telegram Bot and obtain the API key and the Chat ID (for the Notify Telegram n8n node).

  1. Customize Parameters: Open the Set Parameters n8n node and update the example values for fromemail, toemail, nextcloudincome, and nextcloudarchive to match your specific folder structure and contact details.

  2. Set Scheduler: Review the Start n8n trigger node to ensure the desired run time (currently set to run daily).

  3. Activate: Save the n8n workflow and enable it to begin automatic execution.

Node Details

This n8n workflow uses several critical nodes to manage the invoice process:

Start (n8n trigger):
Function: Schedules the automation.
Key Configuration: Configured as a scheduled n8n trigger to run once daily.

Set Parameters (Set n8n node):
Function: Stores necessary email addresses and Nextcloud folder paths as variables for easy modification.
Key Configuration: Defines fromemail, toemail ([email protected]), and Nextcloud paths.

List Incoming Invoices (Nextcloud n8n node):
Function: Lists files in the source directory specified by the nextcloud_income parameter.
Key Configuration: Resource set to 'folder', Operation set to 'list'.

File Exists? (If n8n node):
Function: Provides core logic flow control, ensuring the workflow only continues if a file path was successfully returned by the listing node.
Key Configuration: Condition checks if $json.path is not empty.

Download Invoice (Nextcloud n8n node):
Function: Downloads the binary data of the file identified in the previous step.
Key Configuration: Operation set to 'download', using the dynamically passed path.

Send Email (EmailSend n8n node):
Function: Dispatches the downloaded invoice (passed as binary data) via SMTP.
Key Configuration: To Email and From Email are dynamically referenced from the Set Parameters n8n node. Attachment is set to the incoming binary data (=data).

Archive File (Nextcloud n8n node):
Function: Moves the processed file to the archive path.
Key Configuration: Operation set to 'move', using dynamic path references for both source and destination.

Notify Telegram (Telegram n8n node):
Function: Sends a final notification confirming the invoice was successfully sent and archived.
Key Configuration: Sends a customized text message referencing the processed file name.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Automation consultant with 30+ years of IT experience. Specialized in building efficient workflows with n8n for freelancers and small to medium-sized businesses.

Featured*