Skip to content

Latest commit

 

History

History
84 lines (53 loc) · 2.13 KB

File metadata and controls

84 lines (53 loc) · 2.13 KB

Warning

Importing pandas in the Python Code node fails with a security violation in n8n 2.25.x - 2.27.x.

Stay in 2.23.4 or update directly to 2.28.4+ which introduced N8N_RUNNERS_ALLOW_TRANSITIVE_IMPORTS.

Click here to check for the issue

n8n v2 with numpy and pandas

n8n v2 queue mode with separated task runner and worker. Integrated with PostgreSQL and Redis.

Rebuild task runner with numpy and pandas using Dockerfile and also enabled blocked nodes with NODES_EXCLUDE="[]"

Start

Clone this repo

git clone https://github.com/tobing/n8n-v2-with-numpy-pandas.git
cd n8n-v2-with-numpy-pandas

To start n8n simply start docker-compose by executing the following command in the current folder.

IMPORTANT: Change the default users and passwords in the .env file!

docker compose up -d --build

To stop it execute:

docker-compose stop

Verify if n8n, worker and task runner images are the same version:

docker inspect n8n-main n8n-worker n8n-custom-runner | grep image.version

To access it, open with web browser:

http://localhost:5678

For custom domain modify these lines in docker-compose.yaml

- VUE_APP_URL_BASE_API=http://localhost:5678/
- N8N_EDITOR_BASE_URL=http://localhost:5678/ 
- WEBHOOK_URL=http://localhost:5678/ 

Configuration

The default name of the database, user and password for PostgreSQL and also n8n version can be changed in the .env file in the current directory.

External packages for task runner can be modified with Dockerfile and n8n-task-runners.json inside n8n-custom-runner

Task runner included these external packages:

NODE: moment,uuid,axios,cheerio,form-data,node-fetch,csv-parse

PYTHON: numpy,pandas


To verify the external packages working properly, import n8n-workflow.json from verify-external-modules to n8n then execute workflow.

The workflow has 3 nodes. Manual trigger, Node Modules Test and Python Modules Test.