Automation · 2 min read
Automate Your First n8n Workflow in 15 Minutes
If you're still copying files between folders by hand, this is the tutorial that stops that. We'll build a workflow that watches a directory and archives new files automatically — no code required to start, then we'll add a script node for the parts n8n can't do alone.
Before you start
You'll need a running n8n instance (local, or self-hosted on a cheap VPS) and about fifteen minutes. This walkthrough uses the desktop app, but the steps are identical in n8n Cloud — the fastest way to get one running if you don't already have an instance is a free n8n Cloud trial.
Disclosure: the n8n Cloud link above is an affiliate link — if you sign up through it, we may earn a commission at no extra cost to you. See our affiliate disclosure for details.
Step 1: Add a folder trigger
Create a new workflow and add a Local File Trigger node. Point it at the folder you want to watch, and set the trigger event to "file added." This node polls the folder on an interval and fires the workflow whenever something new shows up.
Step 2: Move the file
Add a Move Binary Data node after the trigger, pointed at an archive/ subfolder. At this point you already have a working automation — no script required.
Step 3: Add the parts n8n can't do alone
Sometimes you need logic that's easier to write than to wire together visually — renaming files based on content, computing a checksum, whatever your case needs. Drop in an Execute Command node and call a small script:
# watch-folder.py
import shutil, pathlib
def archive(path: str) -> None:
shutil.move(path, "./archive/")Tip: Run this as a scheduled n8n workflow rather than a cron job — you get retry logic and a visual run history for free, and it's one less thing running outside of something you can see.
Step 4: Test it
Drop a file into the watched folder and confirm it lands in archive/ within a few seconds. Check the n8n execution log — every run is recorded, with the exact input and output of each node, which makes debugging a lot faster than a bare cron job with no output.
What's next
From here, the natural extensions are a Slack or email notification when a file lands in the archive, and swapping the local trigger for an S3 or Google Drive trigger if your files don't live on the same machine as n8n. Both are covered in upcoming posts.