Python node [GOT CREATED]

Everybody knows the power of python and it would be great if it could be used in n8n.
I can think of 3 different nodes:

1.) general python script.
gets the json input and does something but does not produce a json output
ideally also with the ability to merge an arbitary number of streams.

2.) python json in → json out.
similar to the javascirpt function.

3.) pandas
similar to 2 but with everything setup for pandas input and output.
panda is very powerfull and can read and output json.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_json.html

Then it would also be great if there is an official docker container with python preinstalled and the ability to use pip install to install other packages in a persistent way.

This are some rough ideas to get the discussion going.
I know that you could use the execute command node, which is good to have, but a better integration of python would be great.

Hey @symn!

Welcome to the community :wave:

Thank you for opening this Feature Request. I have come across a couple of community members who are using Python inside n8n. You can check the topic here: Running Python with n8n

I also think that this is a good idea, I have very limited experience with Python, but you can still do all this in n8n without the need for Python. You can take a look at the Core nodes, which allows you to perform certain actions without writing code!

1 Like

Hi, Yes I saw the topic you mention, which talks about the execute command node but not dedicated python nodes. I think the great thing with n8n is that you can combine no-code blocks with code blocks. Also sometimes its just faster and easier to write some code. Together with the existing core nodes this would open a lot more possibilities.
This would also potentially attract more users form the huge python community.

5 Likes

@symn is hinting to using python inside a node such as the function node

1 Like

I think this is a great idea. Is there a feature like this in the works?

I was about to create the same feature request :slight_smile:

Using Python or JS code as you want, just like “code by zapier” :slight_smile:
If possible, I want to avoid learning JS :rofl:

2 Likes

If it helps I am almost finished with a new node for 1SaaS.co that provides the ability to run Python through an API call.

6 Likes

Hey @symn !
I recently built a Python Node (Similar to Function Node)
You can find it here: GitHub - naskio/n8n-nodes-python: Run Python code on n8n
You can use the Docker Image GitHub - naskio/docker-n8n-python: Docker image for running Python on n8n Which has Python 3.10 pre-installed and includes this node
Good luck

11 Likes

This would be so nice if I can directly use python code
Think it would be good to have in the end a return statement where you can output data that can be used in following notes

2 Likes

Is this python node working? @naskdev Would you be willing to meet up online and figure out how to get it running on Cloudron with me?

Hello @roofboard
Yes, It is working normally.
The setup is quite straightforward using the Docker image, did you read the README file ?

1 Like

Just adding my support here. I’ve finally managed to move away from Zapier (yay!) but this is a feature that I’m missing big time. I find Python easier than Javascript and I really hope to see native Python support added in a later release.

1 Like

That is great to hear! Happy to share that it is currently in development:

11 Likes

AWESOME! :rocket: :rocket: :rocket:

So cool, thank you :slight_smile:

1 Like

Hello,
sounds great.

Is there some forecast about a working release?

That will be a wonderful addition!

We are currently thinking about using a different library than the one I used in my above PoC. One that would be more secure. Sadly do not have an ETA yet. But I hope we can get it finished soon.

2 Likes

Hope to see it soon! :smile:

Welcome to the community @sackoh !

Actually good timing. Just finished around 2h ago upgrading the PoC to the new library. Looking good and is getting closer.

3 Likes