n8n Python Code Node Guide
Write dependable Python for n8n Code nodes within their real runtime limits.
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.
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.
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.
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.
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.
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.
- 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.
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.
- 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.
What are this skill's strengths and limitations?
- 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.
- 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 do you install this skill?
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.
How do you use this skill?
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.
How does this skill compare with similar options?
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.