n8n-code-python

Installation
Summary

Expert guidance for writing Python code in n8n Code nodes, with strong recommendation to use JavaScript instead.

  • Python is limited to standard library only (json, datetime, re, base64, hashlib, urllib.parse, math, random, statistics); no external packages like requests, pandas, or numpy
  • Must return data as a list of dictionaries with {"json": {...}} structure; common mistakes include incorrect return format, missing return statements, and unsafe dictionary access without .get()
  • Two execution modes available: "Run Once for All Items" (recommended, uses _input.all()) and "Run Once for Each Item" (uses _input.item); webhook data is nested under _json["body"], not at root level
  • Use Python only when you need specific standard library functions or are significantly more comfortable with Python syntax; JavaScript is preferred for 95% of use cases due to better n8n helper functions and documentation
SKILL.md

Python Code Node (Beta)

Expert guidance for writing Python code in n8n Code nodes.


⚠️ Important: JavaScript First

Recommendation: Use JavaScript for 95% of use cases. Only use Python when:

  • You need specific Python standard library functions
  • You're significantly more comfortable with Python syntax
  • You're doing data transformations better suited to Python

Why JavaScript is preferred:

  • Full n8n helper functions ($helpers.httpRequest, etc.)
  • Luxon DateTime library for advanced date/time operations
  • No external library limitations
  • Better n8n documentation and community support
Related skills

More from czlonkowski/n8n-skills

Installs
2.1K
GitHub Stars
4.9K
First Seen
Jan 20, 2026