Skip to content
Skillpedia
General coding48k · #3655

n8n-code-python

Lets your agent write Python code in n8n. It works with the standard library and understands limitations. Useful for those who prefer using Python in automations.

What it does

This code helps you write Python instructions for n8n, an automation tool. It explains what you can and cannot do with Python within n8n, focusing on what's available in the standard library.

When to use it

  • ✓When you need to write Python code for n8n.
  • ✓If you want to know which Python libraries can be used.
  • ✓To understand how Python works inside n8n's code nodes.

Example of what to ask your AI

“How do I use the 'json' module in an n8n Python code node?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-python/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-python/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It works by explaining the rules and limitations of Python in n8n. It lists the libraries you can use (like 'json' and 'datetime') and those you cannot (like 'requests' or 'pandas').

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill n8n-code-python

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-python/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Python Code Node (Beta)

Expert guidance for writing Python 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.

Critical Limitation: No External Libraries

MOST IMPORTANT PYTHON LIMITATION: Cannot import external packages

What's NOT Available

# ❌ NOT AVAILABLE - Will raise ModuleNotFoundError
import requests  # ❌ No
import pandas  # ❌ No
import numpy  # ❌ No
import scipy  # ❌ No
from bs4 import BeautifulSoup  # ❌ No
import lxml  # ❌ No

What IS Available (Standard Library)

# ✅ AVAILABLE - Standard library only
import json  # ✅ JSON parsing
import datetime  # ✅ Date/time operations
import re  # ✅ Regular expressions
import base64  # ✅ Base64 encoding/decoding
import hashlib  # ✅ Hashing functions
import urllib.parse  # ✅ URL parsing
import math  # ✅ Math functions
import random  # ✅ Random numbers
import statistics  # ✅ Statistical functions

Workarounds

Need HTTP requests?

  • ✅ Use HTTP Request node before Code node
  • ✅ Or switch to JavaScript and use $helpers.httpRequest()

Need data analysis (pandas/numpy)?

  • ✅ Use Python statistics module for basic stats
  • ✅ Or switch to JavaScript for most operations
  • ✅ Manual calculations with lists and dictionaries

Need web scraping (BeautifulSoup)?

  • ✅ Use HTTP Request node + HTML Extract node
  • ✅ Or switch to JavaScript with regex/string methods

See: STANDARD_LIBRARY.md for complete reference


When to Use Python vs JavaScript

Use Python When:

  • ✅ You need statistics module for statistical operations
  • ✅ You're significantly more comfortable with Python syntax
  • ✅ Your logic maps well to list comprehensions
  • ✅ You need specific standard library functions

Use JavaScript When:

  • ✅ You need HTTP requests ($helpers.httpRequest())
  • ✅ You need advanced date/time (DateTime/Luxon)
  • ✅ You want better n8n integration
  • ✅ For 95% of use cases (recommended)

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

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

Can I use external libraries like 'requests' or 'pandas'?

No, you cannot import external libraries in n8n's Python code node. Only Python's standard library is available.

What is the 'standard library'?

It's a set of modules that come with Python when you install it. Examples include 'json', 'datetime', 'math', among others.

When should I use JavaScript instead of Python in n8n?

It's recommended to use JavaScript for most tasks in n8n, especially if you need to make HTTP requests or use advanced date and time functionalities.

Details

Original description by the author

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.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3655
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills