n8n-code-python

Write Python in n8n Code nodes using standard library and safe data access patterns.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/Alkan-ia/Alkan-ia.github.io --skill n8n-code-python-alkan-ia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/Alkan-ia/Alkan-ia.github.io/tree/main/n8n-skills/skills/n8n-code-python
Command: npx skills add https://github.com/Alkan-ia/Alkan-ia.github.io --skill n8n-code-python-alkan-ia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill explains how to write Python code in n8n Code nodes, covering the restricted environment (no external libraries) and safe data access patterns using _input, _json, and _node.

Core Features & Use Cases

  • Learn when to use Python in Code nodes and how to apply safe data handling and standard library usage.
  • Understand the no-external-libraries rule and how to accomplish common transformations with Python's standard library.
  • Real-world scenarios include webhook payload parsing, data transformation, validation, and lightweight scripting within Code nodes.

Quick Start

Use Python in Code nodes to implement simple transformations like merging fields, validating input, or computing a derived value, while adhering to the conventions explained above.

Frequently Asked Questions about n8n-code-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Python code in n8n Code nodes?

Python in n8n Code nodes requires using underscore-prefixed access patterns like _input and _json for safe data handling, and you must return a list of items formatted as [{"json": {...}}].

Can I use external Python libraries in n8n Code nodes?

No, the n8n Code node environment enforces a strict no-external-libraries rule, limiting Python scripts to only the built-in standard library for data transformation and webhook payload handling.

How do I access input data when running Python in n8n?

You access input data in n8n Python scripts using underscore-prefixed variables like _input and _json, enabling safe data handling across both All Items and Each Item execution modes.

What is the correct return format for Python scripts in n8n?

Python scripts in n8n Code nodes must return a list of items structured as [{"json": {...}}], ensuring the workflow correctly receives your transformed data or webhook payload processing results.

What are the limitations of using Python in n8n Code nodes?

The primary limitation of Python in n8n Code nodes is the strict restriction against external libraries, requiring you to accomplish all data transformations and webhook payload validations using only the standard library.

When should I use Python instead of JavaScript in n8n Code nodes?

Use Python in n8n Code nodes for lightweight scripting, data validation, or webhook payload parsing when you prefer Python's standard library and can operate within its no-external-libraries restriction.