Skip to content

Commit c736a45

Browse files
committed
update README.md
1 parent e99e119 commit c736a45

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,48 @@
1-
# n8n - docker image with Python 3.10
1+
# n8n - docker image with Python 3.10 and custom node PythonFunction
22

33
![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png)
44

5+
This [image](https://hub.docker.com/r/naskio/n8n-python) includes Python 3.10 by default. it can be used to run python
6+
scripts inside n8n using the [Execute Command](https://docs.n8n.io/nodes/n8n-nodes-base.executeCommand/) node or code
7+
snippets using the custom node [Python Function](https://www.github.com/naskio/n8n-nodes-python).
8+
59
> Run python 3.10 code on n8n.
610
711
[Docker Hub](https://hub.docker.com/r/naskio/n8n-python)
812

913
[GitHub repository](https://www.github.com/naskio/docker-n8n-python)
1014

11-
n8n is an extendable workflow automation tool. With a [fair-code](http://faircode.io) distribution model, n8n will
12-
always have visible source code, be available to self-host, and allow you to add your own custom functions, logic and
13-
apps. n8n's node-based approach makes it highly versatile, enabling you to connect anything to everything.
14-
15-
This [image](https://hub.docker.com/r/naskio/n8n-python) includes Python 3.10 by default. it can be used to run python
16-
code using the [Execute Command](https://docs.n8n.io/nodes/n8n-nodes-base.executeCommand/) node.
17-
18-
## Example
15+
## Image Setup
1916

2017
Using docker compose
2118
[docker-compose.yml](./demo/docker-compose-local.yml)
2219

20+
## Usage
21+
22+
### Run Python Code
23+
24+
The image includes the custom module [n8n-nodes-python](https://www.github.com/naskio/n8n-nodes-python) by default.
25+
26+
We can use this custom node [Python Function](https://www.github.com/naskio/n8n-nodes-python) to run a python code over
27+
the `items` (works the same way as [Function](https://docs.n8n.io/nodes/n8n-nodes-base.function) node)
28+
29+
[Python Function node docs](https://www.github.com/naskio/n8n-nodes-python)
30+
31+
### Run mounted Python scripts using the ExecuteCommand node
32+
33+
You can run `*.py`files that has been mounted to the container using
34+
the [ExecuteCommand](https://docs.n8n.io/nodes/n8n-nodes-base.executeCommand/) node.
35+
36+
### Installing external packages
37+
38+
The [ExecuteCommand](https://docs.n8n.io/nodes/n8n-nodes-base.executeCommand/) node can be used to install python
39+
packages or install dependencies from a mounted `requirements.txt` file to the container.
40+
41+
It can be combined with [n8nTrigger](https://docs.n8n.io/nodes/n8n-nodes-base.n8nTrigger) to install packages directly
42+
after starting the container.
43+
44+
> Once the packages are installed, it can be used in the Python Function node. `import <package>`
45+
2346
## Documentation
2447

2548
The official n8n documentation can be found under: [https://docs.n8n.io](https://docs.n8n.io)

default-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
fire
2-
Faker
1+
fire

0 commit comments

Comments
 (0)