Patching n8n code

Hi,

I am from PHP world so my question may look silly in NodeJS world :wink:

Is there any way to patch a self-hosted n8n instance?
Lets say that I created a very specific Node which I don’t want to expose publicly or that I improved a Node and I want to use my improvement even if the PR is not merged yet.

Is there a standard way of doing that?

Thanks,

There are two possible ways to do that:

  1. You fork n8n and adjust the node code according to your needs
  2. You use the default n8n but you just copy the existing node, give it a slightly different name and then make sure that the build version of that node ends up in ~/.n8n/custom/

Option 2 is easiest to be done with the node-dev cli. You can find some information about it here.

Hope that is helpful!

Thanks for the quick reply. Forking is never a good idea as it would make future upgrades complex (to be honest I have not checked yet what is the path to upgrade given I am on local only).

I will have a look to the option 2, I was hoping for something as simple as a .patch file in a precise location which would be used automatically but I understand the code is compiled/built so patching requires to rebuild the code anyway.