How to add new node in a production setup

Had now some time to look into it shortly. The problem is that it imports n8n-workflow relative and in the .n8n/custom folder that module does not exist. Before that was not a problem as it only used the interfaces but in your code, it uses let’s say “actual code” because of the NodeApiError and does so not work anymore.

So without doing a deep dive and thinking about it a lot, I guess the following things would be the easiest:

  • use the absolute path when importing the n8n-workflow module
  • instead of using NodeApiError use a regular Error. So in your case, you can remove the whole try … catch block. Does then not display the super pretty errors in the frontend but will generally still work totally fine