What problem does it solve?
Python usage inside n8n Code nodes is limited by the lack of external libraries and the need to keep workflows robust. This Skill clarifies when Python is appropriate, how to access data from inputs and webhook bodies, and how to reason about Python's standard library within n8n, helping you automate data processing without breaking your automation.
Core Features & Use Cases
- _input/_json/_node data access: Learn how to read and transform data from multiple sources in Python Code nodes.
- Webhook gotcha: Webhook data is under
_json["body"], not at the root of _json.
- Error prevention: Understand and prevent the top 5 Python Code node errors (ModuleNotFoundError, Empty code / Missing return, KeyError, IndexError, Incorrect return format).
- Standard library only: Use json, datetime, re, base64, hashlib, urllib.parse, math, random, statistics.
- Guided patterns: Use _input.all() for batch processing, _input.first() for single item flows, and per-item mode when appropriate.
Quick Start
Start with a minimal Python Code node that reads all input items with _input.all(), performs a simple transformation, and returns the results in the required format. For example, add a timestamp and pass through fields.