npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-python-runtime

v0.1.0

Published

n8n node to execute Python scripts using system Python runtime

Downloads

74

Readme

n8n-nodes-python-runtime

This is an n8n community node that enables direct execution of Python scripts using the system's Python runtime within n8n workflows. This node was created for personal use to allow direct access to locally installed Python libraries and environments.

⚠️ Security Warning: This node executes Python code directly on the system. Use with extreme caution and only in trusted environments. Not recommended for production use without proper security measures.

n8n is a fair-code licensed workflow automation platform.

Installation
Operations
Compatibility
Usage
Docker Setup
Resources

Installation

  1. Install n8n (if you haven't already):
npm install n8n -g
  1. Install this node:
npm install n8n-nodes-python-runtime
  1. Configure your n8n installation to use custom nodes by adding to your n8n-config.json:
{
  "nodes.include": ["n8n-nodes-python-runtime"]
}

Operations

This node supports two main operations:

  • Execute Script: Run Python code directly from the n8n workflow
  • Run File: Execute a Python script file from the filesystem

Additional configuration options:

  • Python Path: Specify the Python executable to use
  • Command Arguments: Pass additional arguments to the Python script

Compatibility

  • Requires n8n version 1.0.0 or later
  • Requires Python to be installed on the system
  • Tested with Python 3.x

Usage

Execute Script Example

  1. Add the Python Runtime node to your workflow
  2. Select "Execute Script" operation
  3. Enter your Python code in the "Python Code" field:
import pandas as pd
df = pd.DataFrame({'A': [1, 2, 3]})
print(df.to_json())

Run File Example

  1. Add the Python Runtime node to your workflow
  2. Select "Run File" operation
  3. Specify the path to your Python script
  4. Optionally add command line arguments

Docker Setup

To use this node in a Docker environment, you'll need to create a custom n8n image that includes Python and any required Python packages. Here's an example Dockerfile:

# Use the official n8n image as the base
FROM n8nio/n8n:latest

# Switch to root to install dependencies
USER root

# Install Python and pip using Alpine's package manager
RUN apk add --no-cache python3 py3-pip

# Create a virtual environment
RUN python3 -m venv /opt/venv

# Activate the virtual environment and install dependencies
COPY requirements.txt /tmp/requirements.txt
RUN . /opt/venv/bin/activate && pip install --no-cache-dir -r /tmp/requirements.txt

# Make the virtual environment the default for Python
ENV PATH="/opt/venv/bin:$PATH"

# Switch back to the default non-root user
USER node

Security Considerations

This node executes Python code directly on the system, which can be dangerous if misused. Consider these security implications:

  • The node has access to the system's filesystem
  • It can execute any Python code, including system commands
  • It has access to any installed Python packages
  • It runs with the same permissions as the n8n process

For these reasons, it's recommended to:

  1. Use only in trusted environments
  2. Run n8n in a container with appropriate restrictions
  3. Limit filesystem access when using Docker
  4. Be cautious with input validation if accepting external inputs