Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

n8n-code-python

Skill by czlonkowski

Guides an AI assistant to write and debug Python in n8n Code nodes that run native Python on n8n 2.x. Aimed at users who need Python in a Code node or are migrating older Pyodide code.

  • Score 90
  • 6.7k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install n8n-code-python

Built from the published package, never by AI.

git clone --depth 1 https://github.com/czlonkowski/n8n-skills /tmp/n8n-skills && mkdir -p ~/.claude/skills && cp -r /tmp/n8n-skills/skills/n8n-code-python ~/.claude/skills/n8n-code-python

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install n8n-code-python in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This agent skill gives an AI assistant guidance for writing Python in n8n Code nodes that use native Python (language pythonNative) on n8n 2.x. It covers the two available variables, _items and _item, dict-only access, the default ban on imports, the sandbox's denied builtins, accepted return shapes, and how errors interact with onError. It also includes a migration table for legacy Pyodide helpers such as _input and _now, which now raise NameError.

The skill recommends JavaScript as the default for Code nodes and asks users to confirm that Python is really needed. It includes a checklist and a reference of import-free patterns, and it points to related skills for JavaScript, expressions, the AI-agent Custom Code Tool, error handling and self-hosting. It is aimed at developers who are writing or migrating Python code in n8n workflows.

Written from the project's SKILL.md and checked against it.

What it can do

  • Native Python variablesExplains the only two inputs: _items in all-items mode and _item in each-item mode.
  • Legacy migrationMaps old Pyodide helpers such as _input, _json and _now to native equivalents.
  • Import rulesExplains that imports are blocked by default and how the admin allowlist applies.
  • Sandbox limitsLists denied builtins and dunder access that cause failures.
  • Return shapesDocuments accepted return values for each mode and how they are converted.
  • Error handlingDescribes how runtime, static and return-shape errors interact with onError.
  • Failure messagesMaps messages such as NameError and Python runner unavailable to likely causes.
  • Import-free patternsProvides 12 import-free patterns that the source says were verified on a live n8n instance.

What you need

  • n8n 2.x
  • Python task runner (the stock self-hosted image ships none)
  • Admin access to the task-runner config to allowlist modules (self-hosted)

Try asking

  • Convert this old Pyodide Code node that uses _input to native Python
  • Write a Python Code node that keeps only items where active is true
  • Why does my Python Code node say Import of standard library module is disallowed?

Good to know

  • Undocumented return-shape behaviours could change in a later release, so re-test after upgrading n8n.
  • Imports are blocked by default, and requests, pandas and numpy are not available unless a custom runner image is built.
  • Each Python Code node costs roughly 0.4 s, or about 1 s when the runner is cold.
  • Binary data is not covered and should be handled in JavaScript.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/n8n-code-python/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • COMMON_PATTERNS.md8 KB
  • README.md3 KB
  • SKILL.md11 KB

Alternatives to n8n-code-python

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

n8n-code-python: common questions

Why does my Python Code node fail with NameError for _input or _now?

The old Pyodide Python (Beta) helpers were removed in n8n 2.0. Native Python only provides _items and _item.

Can I import json or datetime in n8n native Python?

Imports are blocked by default because the allowlist is empty. Self-hosted admins can allowlist modules in the task-runner config.

When should I use the n8n-code-tool skill instead?

Use it for Python in the AI-agent Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), where the input is _query and the return must be a string.

How do I install n8n-code-python?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is n8n-code-python free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is n8n-code-python safe to use?

It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to n8n-code-python?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

n8n-code-python Install

Add to stack

Loading.