Help us improve the Code node đź’ˇ Share your ideas and feedback

Hello n8n community :wave:

image

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.

Thanks everyone :pray:

4 Likes

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(

11 Likes

I also find Python restrictive and did not figure out how to import libraries yet

2 Likes

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.

Kind regards
Patrick

13 Likes

I have found accessing variables to be very confusing with the JS node.

Having the ability to inspect the variables the node has access to without having to run the whole flow would make the process so much easier.

This functionality is already present when creating an expression in other nodes but is currently not in the code node.

5 Likes

You can not drag and drop an input parameter in js or python window.

And an AI copilot should be very efficient

11 Likes

I second this request!

5 Likes

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.

9 Likes

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.

I’m with tux, the lack of dynamic library loading makes the development slow as hell.

This is a must-have!!!

1 Like

I third this. Drag and drop would hugely help us non pro coders.

1 Like

The ability to import modules and perform API calls right in the code node via Fetch for JS or Requests for Python would be amazing!

1 Like

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.

5 Likes
  1. Enable Mount Filesystem from Code Node (docs)
    • Allows for real persistence from code node rather than saving in the virtual filesystem in memory.
    • Ability for code node to read from Docker host volume mounts which could be very cool. Example usecase is reading from “sqlite” database.
  2. Change the image of the node depending on language
    • Currently hard to tell which code nodes are using JS and which are using Python.
    • Perhaps just a small badge on top of the original image is fine.
  3. Cookbook for code examples.
    • Quick access code boilerplate examples for popular scenarios
    • Dropdown in the code node options that prefills the textarea
  4. Add a “Beautify” button.
    • Would love to reformat my code ala “pretty print”
    • Useful when copying and pasting from external sources
12 Likes

I way to handle secrets in code node.

1 Like

Intellisense in the Code Editor (like it used to be when Monaco editor was in use)

3 Likes

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.”
2 Likes

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.

I’d love the ability to execute builtin nodes as functions within the code node.

1 Like