n8n recently got a major update after their seed funding with the first releases being folders on n8n. This has been a highly awaited feature for most n8n user as it adds in a n extra level of organization and planning when working with many workflows
I personally got relieved that folders were here, but with more than 300 workflows that needed migration and organization into the new folder structure could take me hours to complete. And manual work does not give me much joy considering how heavily I rely on automation systems to manage my day to day tasks
This prompted the idea for a migration workflow that would turn all the tags into folders and move then to the workflows respective folders. This has the advantage of being able to import multiple workflows in bulk and create new folders for the same without having to do that manually
The challenge with this is that for workflows with multiple tags, the tag that runs last is the one that gets assigned as a folder to the workflow.
How does it work?
For example in the workflow below, we have 4 tags. When run, this workflow loop across all 4 tags, get the workflows associated with each tag and assigned folder names based on the tag. So, this workflow will move across 4 folders until it finally settles on the last tag. The assigned Folder will depend on which tag was processed last. If the tag Emails gets processed last on the workflow, the workflow with be assigned the folder Emails by passing each of the other folders

In this case, the workflow was assigned to the folder Email Agents

In the case a workflow has only a single tag, the tag will be used as the primary folder
How to set this up
- Copy and paste this workflow into your n8n canvas. You must have existing workflows and tags before you can run this
- Set your n8n login details on the node
set Credentials
with the n8n url, username and password.

- Setup your n8n API credentials on the n8n node
get workflows
- Run the workflow
This will open up a form that you can select your tags and workflows and you can select as many tags as you need

Click on submit and the migration will begin

Happy productivity!!
You can find this template on the n8n template community or Download it here