N8n compiler, transforming workflows into reusable scripts

The idea is:

Provide a feature that transforms an n8n workflows into a fully (or partially) functionnal script.

My use case:

For example, I’ve created a set of workflows that let me handle my professional training sessions. When they are mature, I want to transform a few of them into scripts that I will integrate into a custom application, that I implement using AI and that is tailored for my specific use case. I would keep using n8n as a super efficient tool to craft new automation workflows, handle edge cases and so on.

I think it would be beneficial to add this because:

I’ve met a few companies and developers that use n8n for a while in order to get a grip of automation and agentic AI, but then drop the solution altogether as they become more mature.

There are many legitimate reasons to do so, but I regret the fact that they often totally leave n8n, while they could definitely have an hybrid system where simple or new workflows are automated via n8n, and more mature and complex workflows transitions progressively towards full-code solutions.

Therefore, I think that a “compile” or “eject” feature would provide a better experience for developers who favours n8n as a powerful prototyping/quick automation tool and still want to have the freedom to turn their workflow into a full-fledged application.

It would not necessarily be adversarial towards n8n itself, on the contrary I feel like no-code and code boundary would become softer, and that this could convince more people to use n8n in the long run.

Any resources to support this?

Are you willing to work on this?

Yes.
From a technical standpoint, no-code platforms belong to the field of “model-oriented declarative WYSYWIG programming”, the n8n runtime doing the heavy lifting based on the workflow JSON config. So creating a compiler would mean extracting the code ran by the n8n runtime for a given node, and turn it into a full-fledged declarative script.
This is NOT easy, but I believe is doable a the era of LLM-bases static analysis and agentic AI factory. At least it would be a lot of fun to explore.

Sounds like a useful thing, but personally I think it is a bit far from the core product of n8n and would think it is a waste of resource of the small n8n team to build this.
Not trying to be negative just want to fuel a discussion. :slight_smile:

Yeah that’s definitely a moonshot, and it would probably belong to a community project, but I’d still be eager to get more insights on whether this would feel useful to the community, and have a sense of how it could actually be done.
Note that these days, I am pretty sure that a set of Claude Code skils + the JSON of a workflow could be enough to actually produce working code based on a workflow description, but that would be quite expensive for the environment and not super reliable.