czlonkowski avatar

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-code

Installs 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

More from czlonkowski/n8n-skills

All 7
1trailofbits avatarlet-fate-decidetrailofbits/skillsDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread t5Kskills.sh installs
2giuseppe-trisciuoglio avatarunit-test-bean-validationgiuseppe-trisciuoglio/developer-kitProvides patterns for unit testing Jakarta Bean Validation (JSR-380), including @Valid, @NotNull, @Min, @Max, @Email constraints with Hibernate Validator. Gener5Kskills.sh installs
3manaflow-ai avatarcmux-architecturemanaflow-ai/cmuxcmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design discipline, testability, and Swift 6 c5Kskills.sh installs
4github avatarpremium-frontend-uigithub/awesome-copilotA comprehensive guide for GitHub Copilot to craft immersive, high-performance web experiences with advanced motion, typography, and architectural craftsmanship.5Kskills.sh installs
5anthropics avatarux-copyanthropics/knowledge-work-pluginsWrite or review UX copy — microcopy, error messages, empty states, CTAs. Trigger with "write copy for", "what should this button say?", "review this error messa5Kskills.sh installs
6trkbt10 avatarindexion-refactortrkbt10/indexion-skillsAfter writing code, detect and clean up duplication at three levels — copy-paste blocks, cross-package shared code, unnecessary wrappers, and concept-level SoT 5Kskills.sh installs