Saltar al contenido
Skillpedia
Programación general48 mil · #5269

n8n-code-python

Qué hace

Este código te ayuda a escribir instrucciones en Python para n8n, una herramienta de automatización. Explica qué puedes y qué no puedes hacer con Python dentro de n8n, centrándose en lo que está disponible en la biblioteca estándar.

Cuándo usarla

  • ✓Cuando necesites escribir código en Python para n8n.
  • ✓Si quieres saber qué bibliotecas de Python puedes usar.
  • ✓Para entender cómo funciona Python dentro de los nodos de código de n8n.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-code-python/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Cómo uso el módulo 'json' en un nodo de código Python de n8n?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Funciona explicando las reglas y limitaciones de Python en n8n. Enumera las bibliotecas que puedes usar (como 'json' y 'datetime') y las que no (como 'requests' o 'pandas').

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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.
Preguntas frecuentes

¿Puedo usar bibliotecas externas como 'requests' o 'pandas'?

No, en el nodo de código Python de n8n no puedes importar bibliotecas externas. Solo está disponible la biblioteca estándar de Python.

¿Qué es la 'biblioteca estándar'?

Es un conjunto de módulos que vienen incluidos con Python al instalarlo. Algunos ejemplos son 'json', 'datetime', 'math', entre otros.

¿Cuándo debería usar JavaScript en lugar de Python en n8n?

Se recomienda usar JavaScript para la mayoría de las tareas en n8n, sobre todo si necesitas hacer peticiones HTTP o usar funciones avanzadas de fecha y hora.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
48 mil
Posición en el ranking
#5269
Licencia
MIT
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas