π¨ 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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Local File Trigger | Trigger | Local File Trigger | See node parameters |
| Get Files and Folders | Code | Execute Command | See node parameters |
| Files and Folders to Array | Transform | Edit Fields | See node parameters |
| Mistral Cloud Chat Model | AI & models | LM Chat Mistral Cloud | See node parameters |
| Structured Output Parser | Transform | Output Parser Structured | See node parameters |
| Set Variables | Transform | Edit Fields | See node parameters |
| Move Files into Folders | Code | Execute Command | See node parameters |
| If Has Target Files... | Routing | If | See node parameters |
| Get Suggestions to List | Transform | Split Out | See node parameters |
| AI File Manager | AI & models | Chain LLM | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8nβs credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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
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.