n8n-code-python – Coding skill for AI agents
Write Python code in n8n Code nodes. Use when writing Python in n8n, using _input/_json/_node syntax, working with standard library, or need to understand Python limitations in n8n Code nodes.
Install the n8n-code-python skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /n8n-code-python – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $n8n-code-python – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /n8n-code-python – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /n8n-code-python – then describe the task you want done.
SKILL.md content
Python Code Node (Native)
When to Use
Use for bounded Python transformations in an n8n Code node when native nodes or
expressions are insufficient. Check the installed n8n version and task runner first.
Runtime contract
n8n 2 removed the legacy Pyodide runtime. Native Python uses _items in all-items
mode and _item in per-item mode; legacy _input, _json, _node and _now
helpers are unavailable. Self-hosted imports depend on installed runner packages
and explicit allowlists. Cloud imports may be unavailable, including standard
modules. JavaScript imports are restricted too; switching languages does not
provide unrestricted filesystem, networking or package access.
Examples
All-items mode, with no imports:
return [
{"json": {"id": item["json"].get("id"), "processed": True},
"pairedItem": {"item": index}}
for index, item in enumerate(_items)
if item["json"].get("active")
]Per-item mode:
return {"json": {**_item["json"], "name_upper": (_item["json"].get("name") or "").upper()}}Validate actual input types before string operations. Use HTTP Request nodes with
managed credentials for remote calls and enforce allowed destinations. Do not log
payloads/tokens or execute code supplied by webhook users. Keep item count, input
size and runtime bounded; prepare changes in an inactive test workflow before
activating workflows that send messages, spend money or modify external systems.
Detailed Guide
Read [the guide](references/detailed-guide.md) for transformation patterns and
migration caveats. The referenced upstream auxiliary files are not bundled.
Limitations
No workflow or runner is included. Import availability and output normalization
must be checked in the deployed version; item linking, binary data and aggregation
require explicit handling. No runtime tests are established by these examples.
Primary runtime reference: [n8n Code node documentation source](https://github.com/n8n-io/n8n-docs/blob/main/docs/reusable-content/.gitbook/includes/integrations/builtin/core-nodes/code-node.md).
Related skills
- n8n-code-tool – Write and debug JavaScript or Python for the AI-callable n8n Custom Code Tool, including…
- n8n-node-configuration – Operation-aware node configuration guidance. Use when configuring nodes, understanding…
- neon-ai-gateway – One API and one credential for frontier and open-source LLMs, built into your Neon…
- neon-postgres – Guides and best practices for working with Neon Serverless Postgres. Covers setup…
- nestjs-expert – You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application…
- netapi – Check domains and IPs against a free compromised feed, find newly registered lookalike…
- network-101 – Configure and test common network services (HTTP, HTTPS, SNMP, SMB) for penetration…
- networkx – NetworkX is a Python package for creating, manipulating, and analyzing complex networks…