Community生產力與協作github.com

czlonkowski/n8n-code-javascript

在 n8n 的 Code 節點中編寫 JavaScript 程式碼。當需要在 n8n 中撰寫 JavaScript、使用 $input/$json/$node 語法、透過 this.helpers 或 $helpers 全域物件發出 HTTP 請求、使用 DateTime 處理日期、疑難排解 Code 節點錯誤、選擇 Code 節點模式,或進行任何自訂資料轉換時,請使用此技能。若工作流程需要 Code 節點(無論是資料彙總、過濾、API 呼叫、格式轉換、批次處理邏輯或任何自訂 JavaScript),一律優先使用此技能。涵蓋 SplitInBatches 迴圈模式、跨迭代資料、pairedItem,以及真實世界的生產模式。當被問及為何 Code 節點或工作流程執行緩慢、哪種執行模式更快,或如何降低大型資料集上的每項目開銷時,也可使用此技能。例外情況:對於可被 AI 代理呼叫的自訂程式碼工具(@n8n/n8n-nodes-langchain.toolCode,附加於 AI 代理的工具),請改用 n8n-code-tool 技能;其執行時期合約不同。

n8n-code-javascript 是什麼?

此技能旨在為開發人員和 AI 代理提供在 n8n 的 Code 節點中撰寫 JavaScript 的完整指引與最佳實踐。它不僅涵蓋了從基礎的變數使用(如 $input、$json、$node)到進階功能(如透過 this.helpers 或 $helpers 進行 HTTP 請求、使用 DateTime 處理日期),還包含了深入的生產環境模式,例如 SplitInBatches 迴圈、跨迭代資料處理、以及 pairedItem 追蹤。此技能特別實用於需要進行複雜資料轉換、彙總、過濾或批次處理的工作流程。它同時也提供了效能優化的建議,幫助開發者理解不同執行模式的差異、如何診斷 Code 節點或工作流程的瓶頸,以及降低處理大量資料時的開銷。此技能主要適用於 n8n 的標準 Code 節點;對於由 AI Agent 呼叫的自訂程式碼工具,則應參考專門的 n8n-code-tool 技能,因為它們擁有不同的執行時期契約。

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

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

n8n-code-javascript 是做什麼的?

在 n8n 的 Code 節點中編寫 JavaScript 程式碼。當需要在 n8n 中撰寫 JavaScript、使用 $input/$json/$node 語法、透過 this.helpers 或 $helpers 全域物件發出 HTTP 請求、使用 DateTime 處理日期、疑難排解 Code 節點錯誤、選擇 Code 節點模式,或進行任何自訂資料轉換時,請使用此技能。若工作流程需要 Code 節點(無論是資料彙總、過濾、API 呼叫、格式轉換、批次處理邏輯或任何自訂 JavaScript),一律優先使用此技能。涵蓋 SplitInBatches 迴圈模式、跨迭代資料、pairedItem,以及真實世界的生產模式。當被問及為何 Code 節點或工作流程執行緩慢、哪種執行模式更快,或如何降低大型資料集上的每項目開銷時,也可使用此技能。例外情況:對於可被 AI 代理呼叫的自訂程式碼工具(@n8n/n8n-nodes-langchain.toolCode,附加於 AI 代理的工具),請改用 n8n-code-tool 技能;其執行時期合約不同。

Individual skills in this repo

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

czlonkowski/n8n-code-python

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. Use this skill when the user specifically requests Python for an n8n Code node. Note — JavaScript is recommended for 95% of use cases — only use Python when the user explicitly prefers it or the task requires Python-specific standard library capabilities (regex, hashlib, statistics). EXCEPTION — for Python in the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), use the n8n-code-tool skill instead (input is _query, return must be a string).

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).

相關技能