We’re planning to improve the Code node and would love to get your insights to make it even better.
Have you encountered any challenges or pain points with the current Code node? Are there tasks you frequently try to accomplish but find difficult or impossible? We’d also love to know what you think is missing.
When providing feedback, please include some context or examples from your workflows. This will help us understand how you’re using the node and what improvements would be most beneficial.
Python base distro is very restrictive, you should enable a requirements.txt file to import more modules
Importing node modules are also difficult (especially in the docker version) to import them must be globally installed and a pass with a N8N enviroment variable, listing all the specifique modules imported (also annoying(
Hi,
there are 2 things that comes to mind as a beginner:
I would like a clearer description on how to access values from previous nodes within the code node.
I would like that there is an easy way to install extensions in the docker version e.g. install pupeteer.
Modules. Let us load modules and manage them for both js and python from within n8n without the need to do it manually from within the server terminal.
Same opinion here.
I get data from the last node with input.all() but can’t debug with print(), I get an error: Please return an array of dictionaries, one for each item you would like to output.
Here’s an idea to enhance the code node: Local Library for Reusable Functions
Sometimes, we have a list of utility functions we need to use across multiple workflows. We have to copy-paste these functions into every workflow, which is inefficient and prone to errors. While this can be managed by creating a plugin (npm module), it adds extra complexity to the process.
Instead, it would be great if the code node could manage a local library of functions that can be reused in any workflow. This would streamline the workflow creation, reduce redundancy, and make maintenance easier. Users can import the needed functions into their workflows by having a central repository of functions within n8n, ensuring consistency and saving time.
I’m fearful of using the Code node, because of possible memory consumption issues. Can you provide a way to measure impact of memory usage during workflow executions? That would help a ton.
Also, there should be a “best practices” analysis of code inside the Code node – meaning something like:
Analyze current code
Provide feedback on alternatives that are more efficient
“It looks like you’re trying to do X, Y, and Z - consider using native nodes A, B, and C instead.”
As a python code node user, i come into the trouble that when i code on my local IDE and copy it into the n8n node, the tab size is not correct, as i use 4 spaces and in n8n it only uses 2. Maybe this can be configurated in some way, but i have not found it yet.
Second, i would love to have a time measure for the code node especially. As mine are often big i would love to see how much time the node, especially the code node, needed.
Third, maybe it would be an idea, to drag a value from a previous node in a variable above the code section, like in the set node or so, and this can then be more or less directly be accessable via the code node. But that is just a idea i had now while writing this and reading through the other comments, haven’t thought much about this.