Dev & Engineering

n8n Python Code Node Guide

Write dependable Python for n8n Code nodes within their real runtime limits.

49/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code · Claude.ai
Stars
★ 6.4k
Last updated
19d ago
License
MIT
n8npythoncode-nodesworkflow-automation
+2standard-librarydata-transformation

What does this skill do, and when should you use it?

This is one standalone skill from the n8n-skills repository, focused on writing Python in n8n Code nodes. It covers Python Beta and Native modes, input access, webhook data nesting, return formats, standard-library limits, and common failure patterns. It explicitly recommends JavaScript for most cases, reserving Python for Python-specific standard-library needs or an explicit user preference. It fits users building n8n transformations, filters, validations, regex processing, or basic statistical operations.

It explains how to read n8n data with _input.all(), _input.first(), _input.item, _json, and _node; distinguishes variables available in Python Beta and Native modes; produces Code node examples using the required [{"json": {...}}] structure; documents webhook payloads under _json["body"]; restricts imports to the standard library and suggests alternatives using json, datetime, re, base64, hashlib, and statistics; and diagnoses external-library imports, missing returns, malformed output, KeyError, and SplitInBatches issues.

Good fit
  • An n8n developer needs to transform, filter, aggregate, or sort multiple input items in a Code node.
  • A workflow author needs Python standard-library features such as re, hashlib, or statistics.
  • A user is processing webhook requests and needs to read fields nested under body correctly.
  • A workflow maintainer is debugging ModuleNotFoundError, KeyError, or invalid Code node output.
  • A user needs to choose between Python Beta and Native modes and understand _input versus _items.

How do you install this skill?

Before you use it
  • Before deployment, verify Python Beta and Native modes, _node references, empty inputs, and webhook structure on the target n8n version.
  • Do not copy examples containing passwords, API keys, or user data directly; add redaction, credential-management, and least-privilege guidance.
  • Resolve the conflicting _node syntax and add evidence for version compatibility, maintenance ownership, and change history.
Before you start
Your agent needs
  • MCP Server
Install first
  • n8n-mcp MCP server

Install the skill with the n8n-skills repository. For manual installation, run: git clone https://github.com/czlonkowski/n8n-skills.git, then cp -r n8n-skills/skills/* ~/.claude/skills/. The repository also supports Claude Code plugin installation with /plugin install czlonkowski/n8n-skills. The source does not provide a separate command for installing only skills/n8n-code-python.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/czlonkowski/n8n-skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/skills/n8n-code-python" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Can I use pandas in Python Code node?
  • Write Python for an n8n Code node to filter the input using the standard library.

After installation, make the request explicitly about Python in an n8n Code node, for example: “Can I use pandas in Python Code node?” or “Write Python for an n8n Code node to filter the input using the standard library.” For the AI-agent-callable Custom Code Tool, use n8n-code-tool instead; that node has a different _query input and string-return contract.

What are this skill's strengths and limitations?

Pros
  • Clearly distinguishes Python Beta and Native modes, including their data-access variables.
  • Covers critical n8n rules for output structure, webhook body nesting, and safe dictionary access.
  • Explains the no-external-library limitation and gives practical HTTP, analytics, and scraping workarounds.
  • Includes patterns for transformation, filtering, aggregation, regex, validation, and statistics.
Limitations
  • Default environments do not support external packages such as requests, pandas, numpy, scipy, BeautifulSoup, or lxml.
  • The skill recommends JavaScript for 95% of use cases, so it is not a general-purpose Python guide.
  • Python execution is labeled Beta, and cross-iteration state accumulation may not be available in Python Beta.
  • The source provides no independent test results and does not document platform coverage beyond the n8n-related environment.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
n8n Python Code Node Guide this page 49 · Use with care ★ 6.4k 19d ago MIT
n8n JavaScript Code Node Guide 47 · Use with care ★ 6.4k 19d ago MIT
n8n AI Code Tool Guide 54 · Use with care ★ 6.4k 19d ago MIT
n8n Expression Syntax Guide 47 · Use with care ★ 6.4k 19d ago MIT
Harness — The Team-Architecture Factory 50 · Use with care ★ 9.2k 1mo ago Apache-2.0

Compared with JavaScript Code nodes, this skill is better suited to Python syntax or specific standard-library operations; JavaScript offers fuller n8n helpers, Luxon, and fewer external-library constraints. Compared with HTTP Request, Set, Filter, IF, or Switch nodes, it targets programmable logic rather than simple field mapping, basic filtering, or conditional branching.

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
49/ 100 5-point scale 2.5 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust14 / 25 · 2.8/5

The materials show no malware, credential theft, or destructive defaults, and they recommend standard-library usage and other n8n nodes; however, they do not systematically address least privilege, user confirmation, sensitive-data handling, external-request risks, rollback, or data-flow auditing, so points are deducted. The publisher is unverified and treated as unknown, not as positive evidence.

2Reliability7 / 20 · 1.8/5

The documentation covers input modes, return formats, common errors, and empty-input handling, making the happy path reasonably clear. However, key examples conflict on _node access, alternately showing direct access and calling first(), and a quick-start example uses datetime without showing its import. There is no executable test or reproduced failure evidence; under static calibration the score cannot exceed 10, so points are deducted.

3Adaptability10 / 15 · 3.3/5

Triggers, intended users, Python-versus-JavaScript boundaries, and external-library limitations are fairly clear. Precision is reduced by limited treatment of n8n version differences, Python Beta runtime variation, input contracts, and non-fit cases, and there is no Chinese-language guidance. Core functionality does not depend on overseas services, but documentation reachability is not addressed, so points are deducted.

4Convention8 / 15 · 2.7/5

The skill uses layered SKILL, README, data-access, error-pattern, and standard-library documents with many examples, limitations, and a 1.0.0 version. It lacks a changelog, explicit maintenance owner, update path, and dependency/compatibility governance. Claims such as “production-tested” and “Production Ready” lack supporting evidence in the supplied files, so points are deducted.

5Effectiveness6 / 15 · 2.0/5

The material can directly help users write common Python Code node transformations, filtering, aggregation, and error-handling logic, with copyable templates. However, some examples may depend on unverified n8n runtime behavior, contain syntax or semantic inconsistencies, and most tasks are explicitly better served by JavaScript or other nodes. Human verification is therefore still required, so points are deducted.

6Verifiability4 / 10 · 2.0/5

The files contain concrete code, error messages, and wrong-versus-right comparisons, providing limited static auditability. They contain no committed tests, CI coverage, execution logs, third-party validation, or independently reproducible results, and the external documentation links do not establish an evidence chain. Points are therefore deducted.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 05eea4848c12 Review evidence[1][2][3][4][5][6]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Does this skill cost anything?
The source identifies the repository as MIT licensed, but it does not mention a hosted service or additional fees.
Can I install pandas or requests in a Python Code node?
Not in default installations. Availability on a self-hosted instance depends on the Python runner configuration; when uncertain, use the standard library or ask the instance administrator.
Why must the code return a list containing a json key?
Downstream n8n nodes expect the [{"json": {...}}] structure. Returning a dictionary, an unwrapped list, or a string can cause workflow execution to fail.
Does this cover the AI Agent Custom Code Tool?
Not directly. The Custom Code Tool uses _query and must return a string, so the n8n-code-tool skill is the appropriate reference.

More skills from this repository

All from czlonkowski/n8n-skills

Dev & Engineering

n8n JavaScript Code Node Guide

Write reliable, efficient JavaScript for n8n Code nodes.

★ 6.4k FS 47 Use with care 19d ago
Dev & Engineering

n8n AI Code Tool Guide

Write JavaScript or Python that obeys the n8n Custom Code Tool contract for AI-agent calls.

★ 6.4k FS 54 Use with care 19d ago
Automation & Ops

n8n Binary & File Handling

Keep files intact in n8n workflows and move them safely through AI tools and chat interfaces.

★ 6.4k FS 53 Use with care 19d ago
Dev & Engineering

n8n Expression Syntax Guide

Write, validate, and repair n8n expressions for reliable workflow data mapping.

★ 6.4k FS 47 Use with care 19d ago
Automation & Ops

n8n Error Handling

Make n8n workflow failures routable, visible, and recoverable.

★ 6.4k FS 53 Use with care 19d ago
Automation & Ops

n8n Multi-Instance Targeting

Safely select, verify, and switch the n8n instance targeted by an MCP session.

★ 6.4k FS 51 Use with care 19d ago
Automation & Ops

n8n AI Agent Architecture Guide

Design n8n AI agents with the right nodes, tool connections, memory, structured output, and human approval.

★ 6.4k FS 50 Use with care 19d ago
Automation & Ops

n8n MCP Workflow Router

Routes n8n-mcp tasks to the right skills and reduces production workflow failures.

★ 6.4k FS 50 Use with care 19d ago
Automation & Ops

n8n Subworkflow Architect

Turn reusable n8n logic into explicit, testable sub-workflows that humans and AI agents can discover and call safely.

★ 6.4k FS 49 Use with care 19d ago
Automation & Ops

n8n Node Configuration Guide

Configure n8n nodes by operation and dependency to reduce validation errors and silent runtime failures.

★ 6.4k FS 46 Use with care 19d ago
Automation & Ops

n8n Validation Expert

Explains n8n validation results and guides iterative fixes for problems that can stop workflows from running.

★ 6.4k FS 46 Use with care 19d ago
Automation & Ops

n8n MCP Tools Expert

A practical guide for reliably searching, validating, and managing n8n workflows.

★ 6.4k FS 45 Not recommended 19d ago
Automation & Ops

n8n Workflow Architecture Patterns

Design, validate, and deploy reliable n8n workflows with proven architectural patterns.

★ 6.4k FS 40 Not recommended 19d ago
Automation & Ops

n8n Self-Hosting Deployment

Deploy production self-hosted n8n on Linux with Docker Compose, Caddy, and automatic HTTPS.

★ 6.4k FS 46 Use with care 19d ago

Related skills