I was wondering if it could be a nice thing to export / import a workflow in JavaScript instead of JSON.
In our team, we are making several workflows, but we are committing in a git repository.
We are trying to review the evolutions of workflows, by reading the code, but we are using several Function nodes, and the code inside these nodes are inlined.
It’s hard to review it, so I was thinking than in a JavaScript export, with a template string for the Function code (or FunctionItem), it could be nice.
I think I can manage to export the workflow by the API too, and transform the JSON file in a JS file, but, well, if my need talks to others, maybe it would be better to integrate it in n8n ?
I think this would be super cool.
It presents an opportunity for n8n users to use n8n’s editor without being forced to use the n8n runtime/execution environment.
Users would be able to distribute their exported JS files through CDNs and have the executions take place on the client (where feasible). @jan I’d love to know if this is something n8n is open to - I’m happy to help implement this feature
We are theoretically open for most things if they provide an improved user experience. But it sounds like you and @mdartic are talking about two very different things. @mdartic talks specifically about how he code in Code/Function Nodes get exported to understand better what is going on and potentially make some smaller changes.
What you are proposing sounds more like it would export workflows as actual JavaScript files that can be executed with vanilla Node.js. That would be for sure very cool but also like something that would be incredibly hard to achieve.
@jan is right, my purpose was only for reviewing code in specific code nodes.
Not execute the workflow directly but the idea is really great !
And, we can say that nearly 2 years later, I’m (and my team) the only one wishing this feature…
Time to close the feature request ?
Ah no, leave it open. We prioritize depending on the interest in a feature. Maybe it now being again higher up will bring more eyes to it, and more people will upvote.
I definitely feel the need to. Because n8n helps build logic faster, and I have a huge codebase and i have to integrate what I built on n8n. And everytime it is a manual process. It would be an awesome feature for sure. Devs would be head over heels haha