Following on from this conversation on Linkedin, I wondered how we might start sharing workflows with one or more subworkflows? My first thought was to use a simple approach with zip files. Curiosity got the better of me and I went ahead and built a proof of concept.
The Template
This template contains 2 separate workflows: one for exporting templates into a template bundle and the other for importing template bundle into a n8n instance.
How it works
Export Workflow
- User selects a template and this workflow finds all associated subworkflow templates
- The n8n node is then used to get the template JSONs of all workflows
- The JSON files are then bundled them up into a zip file. A metadata.txt is also added to track hierarchy of the main and sub-workflows.
Import Workflow
- The user uploads the zip file exported by the export workflow above
- This workflow extracts the template JSONs and uses the metadata.txt to figure out which is the main template
- All templates are imported into the n8n instance using the n8n node
- A second loop is used to link the newly created subworkflows to the newly created main workflow template.
Conclusion
This template was actually pretty simple to put together and I think bundling templates using zip is a very practical way of solving this problem in n8n.
Let me know if you’d use something like this!
If you’ve enjoyed this template, follow me on:
- LinkedIn: Jim Le - Reason | LinkedIn
- Twitter/X.com: https://x.com/jimle_uk
Check out my other posts on the community forum here - https://community.n8n.io/u/jim_le/activity/topics