Community生产力与协作github.com

czlonkowski/n8n-code-python

在 n8n Code 节点中编写 Python 代码。当在 n8n 中使用 Python、操作 _input/_json/_node 语法、使用标准库或需要了解 n8n Code 节点中 Python 的限制时使用此技能。

n8n-code-python 是什么?

该技能旨在帮助开发者在使用 n8n Code 节点时编写 Python 代码。n8n 是一个工作流自动化平台,Code 节点允许用户编写自定义代码来处理数据。此技能专门针对 Python 语言,涵盖了如何在 Code 节点中访问输入数据(通过 _input、_json、_node 等对象),使用 Python 标准库(如 re、hashlib、statistics)以及处理 Python 在 n8n 环境中的限制(例如无外部包、单线程等)。它还提醒用户,在 95% 的情况下,n8n 更推荐使用 JavaScript,仅当用户明确偏好 Python 或需要 Python 特定标准库功能时才使用 Python。有一个重要例外:当在 AI 可调用的自定义代码工具(@n8n/n8n-nodes-langchain.toolCode)中使用 Python 时,应改用 n8n-code-tool 技能,因为其输入为 _query,返回值必须为字符串。该技能适用于所有主流 AI 代理平台(Claude Code、Cursor、Codex 等),帮助代理在 n8n 环境中生成符合规范的 Python 代码。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/czlonkowski/n8n-skills/tree/main/skills/n8n-code-python

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

n8n-code-python 是做什么的?

在 n8n Code 节点中编写 Python 代码。当在 n8n 中使用 Python、操作 _input/_json/_node 语法、使用标准库或需要了解 n8n Code 节点中 Python 的限制时使用此技能。当用户特别要求为 n8n Code 节点使用 Python 时,请使用此技能。注意——在 95% 的用例中建议使用 JavaScript——仅在用户明确偏好 Python 或任务需要 Python 特定标准库功能(regex、hashlib、statistics)时才使用 Python。例外——对于 AI 可调用的自定义代码工具(@n8n/n8n-nodes-langchain.toolCode)中的 Python,请改用 n8n-code-tool 技能(输入为 _query,返回值必须为字符串)。

Individual skills in this repo

This repo contains 6 individual skills — each has its own dedicated page.

czlonkowski/n8n-code-javascript

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with this.helpers / the $helpers global, working with dates using DateTime, troubleshooting Code node errors, choosing between Code node modes, or doing any custom data transformation in n8n. Always use this skill when a workflow needs a Code node — whether for data aggregation, filtering, API calls, format conversion, batch processing logic, or any custom JavaScript. Covers SplitInBatches loop patterns, cross-iteration data, pairedItem, and real-world production patterns. Also use when asked why a Code node or workflow is slow, which execution mode is faster, or how to cut per-item overhead on large datasets. EXCEPTION — for the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode, a tool attached to an AI Agent), use the n8n-code-tool skill instead; it has a different runtime contract.

czlonkowski/n8n-expression-syntax

Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, mapping data between nodes, or referencing webhook data in workflows. Use this skill whenever configuring node fields that reference data from previous nodes — expressions are how n8n passes data between nodes, and getting the syntax wrong is the most common source of workflow errors. Also use when asked whether a complex expression hurts performance.

czlonkowski/n8n-mcp-tools-expert

Expert guide for using n8n-mcp MCP tools effectively. Use when searching for nodes, validating configurations, accessing templates, managing workflows, managing credentials, auditing instance security, or using any n8n-mcp tool. Provides tool selection guidance, parameter formats, and common patterns. IMPORTANT — Always consult this skill before calling any n8n-mcp tool — it prevents common mistakes like wrong nodeType formats, incorrect parameter structures, and inefficient tool usage. If the user mentions n8n, workflows, nodes, or automation and you have n8n MCP tools available, use this skill first.

czlonkowski/n8n-node-configuration

Operation-aware node configuration guidance. Use when configuring nodes, understanding property dependencies, determining required fields, choosing between get_node detail levels, or learning common configuration patterns by node type. Always use this skill when setting up node parameters — it explains which fields are required for each operation, how displayOptions control field visibility, and when to use patchNodeField for surgical edits vs full node updates.

czlonkowski/n8n-validation-expert

Interpret validation errors and guide fixing them. Use when encountering validation errors, validation warnings, false positives, operator structure issues, or need help understanding validation results. Also use when asking about validation profiles, error types, the validation loop process, or auto-fix capabilities. Consult this skill whenever a validate_node or validate_workflow call returns errors or warnings — it knows which warnings are false positives and which errors need real fixes.

czlonkowski/n8n-workflow-patterns

Proven workflow architectural patterns from real n8n workflows. Use when building new workflows, designing workflow structure, choosing workflow patterns, planning workflow architecture, or asking about webhook processing, HTTP API integration, database operations, AI agent workflows, batch processing, or scheduled tasks. Always consult this skill when the user asks to create, build, or design an n8n workflow, automate a process, or connect services — even if they don't explicitly mention 'patterns'. Covers webhook, API, database, AI, batch processing, and scheduled automation architectures. Also use when optimizing a slow workflow or speeding up large-item-count processing (node count, batchSize, all-items vs per-item).

相关技能