n8n-code-python

Guide Python code writing in n8n Code nodes with data access patterns.

1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/VitorSantos-1/Meus-projetos --skill n8n-code-python-vitorsantos-1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-python
Source: https://github.com/VitorSantos-1/Meus-projetos/tree/main/.gemini/skills/n8n-code-python
Command: npx skills add https://github.com/VitorSantos-1/Meus-projetos --skill n8n-code-python-vitorsantos-1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides expert guidance for writing Python code in n8n Code nodes, offering best practices, data access patterns, and error prevention strategies.

Core Features & Use Cases

  • Python Best Practices: Recommendations for code structure, data handling, and error handling in n8n Python Code nodes.
  • Data Access Patterns: Comprehensive guide to accessing data using _input, _json, and _node in Python Code nodes.
  • Error Prevention: Step-by-step solutions to common Python Code node errors and best practices to avoid them.
  • Standard Library Reference: Overview of available Python standard library modules and their usage in n8n Code nodes.

Quick Start

  • To begin, read the SKILL.md file to understand the limitations and best practices for writing Python code in n8n Code nodes.
  • Use the provided DATA_ACCESS.md and COMMON_PATTERNS.md files to learn about specific data access patterns and production-tested Python patterns for n8n Code nodes.

Frequently Asked Questions about n8n-code-python

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

FAQPage Schema
How do I access input data in n8n Python Code nodes?

Access input data in n8n Python Code nodes using the built-in `_input`, `_json`, and `_node` objects. These patterns allow your Python scripts to retrieve and manipulate workflow items directly within the n8n environment.

What are the best practices for writing Python code in n8n?

Best practices for writing Python code in n8n include following recommended code structures, implementing proper data handling techniques, and applying error prevention strategies to ensure your workflow automation runs reliably.

Which Python standard library modules are available in n8n Code nodes?

Python standard library modules available in n8n Code nodes cover a wide range of utilities for data transformation and processing. The provided reference outlines these modules and their specific usage within the n8n framework.

How do I prevent common errors in n8n Python Code nodes?

Prevent common errors in n8n Python Code nodes by following step-by-step solutions and best practice guidelines. Proper data handling and structured error prevention strategies help avoid typical Python execution failures.

Can I use Python for data transformation and workflow automation in n8n?

Yes, you can use Python for data transformation and workflow automation in n8n. The Code node supports Python execution, enabling you to process data and automate workflows using standard Python patterns and libraries.