
N8n Code Python
The n8n-code-python skill provides expert guidance for writing Python code in n8n Code nodes, helping workflow developers understand data access patterns, output formatting requirements, and Python's limitations in this environment. It addresses the problem that Python has restricted capabilities in n8n (no external libraries, standard library only) and recommends JavaScript as the preferred alternative for most use cases, while documenting when Python is genuinely necessary. The skill serves developers who are more comfortable with Python syntax and need specific standard library functions for data transformations within n8n workflows.
- skills.sh installs
- 5.1K
- GitHub stars
- 6.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add czlonkowski/n8n-skills --skill n8n-code-python --agent claude-codeInstalls into .claude/skills of the current project.
Files
Python Code Node (native)
Since n8n 2.0 the Code node's Python runs as native Python in a task runner (language: "pythonNative"). The old Pyodide "Python (Beta)" is gone, and with it every n8n helper it had:
_input, _json, _node, _now, _today and _jmespath all raise NameError now. Code copied
from old templates, forum posts or older docs usually breaks on this.
JavaScript first — stronger than before
Native Python gives you two variables and plain Python, and by default no imports: no
json, datetime or re. Everything n8n-specific ($('Node'), $jmespath, Luxon,
this.helpers.httpRequest, static data) exists only in JavaScript. Use Python only when the user
explicitly asks for it. Even then, first check whether an expression, Edit Fields, or a native
node (Crypto, Date & Time, HTML, XML) does the job. See n8n-code-javascript and the transform
gatekeeper in n8n-expression-syntax.
Quick start
# Run Once for All Items (default mode)
return [
{"json": {"name": it["json"]["name"], "revenue": it["json"]["revenue"]}}
for it in _items
if it["json"].get("active")
]
Sponsors
Details
- Repository
- github.com/czlonkowski/n8n-skills
- Categories
- Documentation, AI & Agent Building, Data Science & ML, Debugging, Automation & Workflows, Python