Skip to content

abbibo/N8N-Workflow-Builder-Agent-skills-N8N / skills/04-code-nodes-javascript-python

n8n-code-nodes-javascript-python

Verified

Best practices for writing JavaScript and Python in n8n Code nodes, data access methods, and return contracts.

FileKindSize
JAVASCRIPT_PATTERNS.mdmarkdown606 B
SKILL.mdskill md593 B
---
name: n8n-code-nodes-javascript-python
description: Best practices for writing JavaScript and Python in n8n Code nodes, data access methods, and return contracts.
---

# N8N Code Nodes: JavaScript & Python

## Decision: Edit Fields vs Code Node
- Prefer **Edit Fields (Set)** for basic mapping, renaming, and static formulas (runs in-process, ~100x faster).
- Use **Code Node** for complex loops, regex extraction, array flattening, deduplication, and non-trivial algorithms.

## Return Contracts
- Every returned item must be a dictionary/object with a `json` key: `[{ json: { ... } }]`.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall