← All N8N workflows
AI & researchChain LLMExecute CommandIfLM Chat Mistral CloudLocal File Trigger

🚨 Warning! Potential destructive operations ahead!

Configured with Chain LLM, Execute Command, LM Chat Mistral Cloud, Local File Trigger, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerLocal File TriggerLocal File TriggerCodeGet Files and FoldersExecute CommandTransformFiles and Folders toArrayEdit FieldsAI & modelsMistral Cloud ChatModelLM Chat Mistral CloudTransformStructured OutputParserOutput Parser StructuredTransformSet VariablesEdit FieldsCodeMove Files into FoldersExecute CommandRoutingIf Has Target Files...IfTransformGet Suggestions to ListSplit OutAI & modelsAI File ManagerChain LLM

Node categories in this workflow

  • Trigger
  • Code
  • Transform
  • AI & models
  • Routing

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and βˆ’ to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Local File TriggerTriggerLocal File TriggerSee node parameters
Get Files and FoldersCodeExecute CommandSee node parameters
Files and Folders to ArrayTransformEdit FieldsSee node parameters
Mistral Cloud Chat ModelAI & modelsLM Chat Mistral CloudSee node parameters
Structured Output ParserTransformOutput Parser StructuredSee node parameters
Set VariablesTransformEdit FieldsSee node parameters
Move Files into FoldersCodeExecute CommandSee node parameters
If Has Target Files...RoutingIfSee node parameters
Get Suggestions to ListTransformSplit OutSee node parameters
AI File ManagerAI & modelsChain LLMSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • mistralCloudApi

Workflow notes

Step 1. Select the target folder

Step 1. Select the target folder

Read more about local file trigger

In this workflow, we'll monitor a specific folder on disk that n8n has access to. Since we're using docker, we can either use the n8n volume or mount a folder from the host machine.

The local file trigger is useful to execute the workflow whenever changes are made to our target folder.

Step 2. Identify files that need to be organised

Step 2. Identify files that need to be organised

Read more about Execute Command node

For all Files in the root level of our selected target folder, we want them to be sorted and moved into categorised subdirectories. In this step, we'll use linux commands to get a list of files and folders currently present in the target folder.

Step 3. Using Mistral AI to organise our target folder

Step 3. Using Mistral AI to organise our target folder

Read more about Mistral AI

Using Mistral AI as our AI file manager, it can help us suggest which files go into which categorised subdirectory. If the subdirectory doesn't exist, Mistral can also suggest one to be created.

Step 4. Move the files into subdirectories

Step 4. Move the files into subdirectories

Read more about Execute Command node

For this step, we'll use the execute command node to execute a shellscript to move the files into their respective subdirectories.

Try It Out!

Try It Out!

This workflow does the following:

  • Monitors a target folder for changes using the local file trigger
  • identifies all files and subdirectories in the target folder and passes this to Mistral AI
  • Mistral AI suggests where to move top level files into which subdirectories. It can also suggest subdirectories tp create if none are suitable.
  • Finally, we take the AI's suggestions are perform the move operations using the execute command node.

Need Help?

Join the Discord or ask in the Forum!

Happy Hacking!

🚨 Warning! Potential destructive operations ahead!

🚨 Warning! Potential destructive operations ahead!

This workflow manipulates the filesystem. Always make backups of your files before running local workflows.

🚨 Warning! Potential destructive operations ahead!

🚨 Warning! Potential destructive operations ahead!

Purpose and structure

This folder contains the 🚨 Warning! Potential destructive operations ahead! workflow. Its executable nodes use chainLlm, executeCommand, if, lmChatMistralCloud, localFileTrigger, outputParserStructured, set, splitOut. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Local File Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Executecommand/0534_Executecommand_Localfile_Process_Triggered.json MIT; preserve source notices.

More in AI & research