n8n-code-javascript
What it does
This guide helps you write JavaScript code within n8n, an automation tool. It's useful for more complicated programming tasks that other n8n tools can't handle.
When to use it
- βWhen you need to perform complex calculations or apply custom business logic.
- βWhen processing API responses with complicated structures.
- βTo group data from different sources in an advanced way.
Skill link
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-javascript/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHow can I use JavaScript in n8n to transform input data?β
5 new skills a week. 1 minute to read.
How it works
n8n allows you to write your own JavaScript code to manipulate data. It provides special tools to access information from previous steps and make requests to other services.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
JavaScript Code Node
Expert guidance for writing JavaScript code in n8n Code nodes.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use Code Node
Use Code node when:
- β Complex transformations requiring multiple steps
- β Custom calculations or business logic
- β Recursive operations
- β API response parsing with complex structure
- β Multi-step conditionals
- β Data aggregation across items
Consider other nodes when:
- β Simple field mapping β Use Set node
- β Basic filtering β Use Filter node
- β Simple conditionals β Use IF or Switch node
- β HTTP requests only β Use HTTP Request node
Code node excels at: Complex logic that would require chaining many simple nodes
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ
When should I use the Code node instead of other nodes?
Use the Code node for complex multi-step transformations, custom calculations, recursive logic, parsing complex API responses, multi-step conditionals, or data aggregation. For simpler tasks like field mapping or basic filtering, use nodes like 'Set', 'Filter', or 'IF'.
What are '$input', '$json', '$node', and '$helpers'?
These are special shortcuts n8n provides so your JavaScript code can easily access input data, information from previous nodes, and useful functions for making requests or working with dates.
Does this guide replace the need to test my code?
No. This guide offers guidance, but you still need to validate and test your code in your specific environment to ensure it works correctly and securely.
Details
Original description by the author
Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.
Popularity
- GitHub stars
- 48k
- Ranking position
- #5268
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
00-andruia-consultant
48kHelps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
007
48kLets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
10-andruia-skill-smith
48kHelps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
20-andruia-niche-intelligence
48kLets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.