n8n-code-python – skill Lập trình cho agent AI
Viết code Python trong node Code của n8n. Dùng khi viết Python trong n8n, dùng cú pháp _input/_json/_node, làm việc với thư viện chuẩn, hoặc cần hiểu giới hạn của Python trong node Code.
Cài skill n8n-code-python bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /n8n-code-python – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $n8n-code-python – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /n8n-code-python – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-code-python-b2760.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /n8n-code-python – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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).
Skill liên quan
- n8n-code-tool – Viết và gỡ lỗi JavaScript hoặc Python cho Custom Code Tool của n8n mà AI có thể gọi, bao…
- n8n-node-configuration – Hướng dẫn cấu hình node theo ngữ cảnh operation. Dùng khi cấu hình node, hiểu phụ thuộc…
- neon-ai-gateway – Một API và một thông tin xác thực cho các LLM hàng đầu và mã nguồn mở, tích hợp vào…
- neon-postgres – Hướng dẫn và thực hành tốt khi làm việc với Neon Serverless Postgres. Bao gồm thiết lập…
- nestjs-expert – Bạn là chuyên gia Nest.js, am hiểu sâu kiến trúc ứng dụng Node.js cấp doanh nghiệp, các…
- netapi – Kiểm tra tên miền và IP với nguồn dữ liệu bị xâm phạm miễn phí, tìm tên miền giả mạo mới…
- network-101 – Cấu hình và kiểm thử các dịch vụ mạng phổ biến (HTTP, HTTPS, SNMP, SMB) cho môi trường…
- networkx – NetworkX là gói Python để tạo, thao tác và phân tích các mạng và đồ thị phức tạp.