Save email attachments to Nextcloud

Go to Workflow
8,384 views
Built by Manu Manu
Created on June 07, 2026

Description

This workflow will take all emails you put into a certain folder, upload any attachements to Nextcloud, and mark the emails as read (configurable).

Attachements will be saved with automatically generated filenames:
2021-01-01_From-Sender-Name_Filename-of-attachement.pdf

Instructions:
Allow lodash to be used in n8n (or rewrite the code...)
NODE_FUNCTION_ALLOW_EXTERNAL=lodash (environment variable)
Import workflow
Set credentials for Email & Nextcloud nodes
Configure to use correct folder / custom filters
Activate

Custom filter examples:
Only unread emails:
Custom Email Config = ["UNSEEN"]
Filter emails by 'to' address:
Custom Email Config = [["TO", "[email protected]"]]

Nodes Used (1)

Nextcloud
n8n-nodes-base.nextCloud