Automated file tagging
Nextcloud’s Automated file tagging app adds the Tag a file operation to
Nextcloud Flow. It assigns collaborative tags to files and folders based on
configured conditions. These tags can be used by Retention of files,
Files access control, and other workflow apps.
How it works
Each rule group contains one or more conditions combined with AND: all conditions must match for the group to match. Every matching group assigns its configured tag.
Rules are evaluated when eligible files or folders are inserted into or updated in Nextcloud’s file cache, not only when files are uploaded. For example, items created directly on external storage can be evaluated when Nextcloud discovers them.
Adding or changing a rule does not itself tag existing files. Assigning a tag to a folder does not trigger a recursive evaluation of its existing contents. Tags assigned by a rule are not automatically removed when the rule stops matching or is deleted.
Configuration
Install and enable the Automated file tagging app as described in
Apps management, then open
and select the Tag a file
operation.
Users can also create personal flows when user flows are enabled; see Flow configuration. Non-admin users can select only visible, user-assignable tags as the tags to assign. Administrators can also select restricted and invisible tags.
Example
To tag files inside a folder marked with Protected content:
As an administrator, create restricted tags named
Protected contentandProtected file, and assignProtected contentto the source folder.In Flow, add a
Tag a fileoperation with a collaborative-tag condition matchingProtected content.Select
Protected fileas the tag to assign and save the flow.
When an eligible item is evaluated, the collaborative-tag condition checks both
the item itself and its parent folders. Matching items receive
Protected file, including items in nested subfolders.
The source folder and subfolders can also match when they are evaluated. To
assign the output tag only to files, add a File MIME type condition with
operator is not and value httpd/unix-directory. This does not remove tags
already assigned to folders.
Available rules
See Available rules for the shared workflow conditions.
Keep the evaluation context in mind:
File size uses upload request headers, not the size stored in the file cache. Do not rely on it for background scans or other non-upload operations.
User group membership checks the currently authenticated user, not the file owner. Without an authenticated user,
isdoes not match andis notmatches.Request-based conditions describe the request that triggers evaluation, not necessarily the request that originally uploaded the file. Background processing may not have the same request context.
Note
Do not rely on automatic tagging to initialize the root folders of external storage mounts or group folders. Eligibility depends on the storage and mount path. Assign any required initial tags manually. Items inside these folders are evaluated on eligible file-cache insertions and updates.