Actions132
- AI Actions
- Extract Text From Document
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Extract Entities
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate JavaScript Code
- Generate Python Code
- Detect Language
- Detect Mood
- Extract Text From PDF
- Recognize Objects in Image
- Extract Text From Image
- Redact Sensitive Information From PDF
- Remove Background Image
- Summarize Text
- Transcribe
- Translate Text
- Image Actions
- Business Actions
- Convert Actions
- Generate Actions
- Crypto Actions
- Operator Actions
- Storage Actions
- Scheduler Actions
- Text Actions
- Chart Actions
- Code Actions
- Calculate Actions
- Date and Time Actions
- PDF Actions
- Compress PDF File
- Count PDF Pages
- Create Empty PDF
- Decrypt PDF
- Convert DOCX to PDF
- Draw Image on PDF
- Draw Text on PDF
- Encrypt PDF
- Convert HTML to PDF
- Convert Markdown to PDF
- Manage PDF Metadata
- Merge PDF Files
- Add PDF Pages
- Remove PDF Pages
- Resize PDF Pages
- Rotate PDF Pages
- Convert PDF to Base64
- Convert PDF to Image
- Split PDF File
- Add Image Watermark to PDF
- Add Text Watermark to PDF
- Shortened URL Actions
Code → Execute Python Code
AI-generatedOverview
The node "0CodeKit" provides a versatile toolbox of no-code utilities grouped by various resource types, including code execution capabilities. Specifically, the Execute Python Code operation under the Code resource allows users to run custom Python scripts within their workflows. This is useful for scenarios where you want to perform complex data processing, integrate with Python libraries, or execute logic that is not natively supported by other nodes.
Practical examples include:
- Running data transformation scripts using popular Python libraries.
- Executing machine learning inference or data analysis snippets.
- Automating tasks that require Python-specific packages.
- Quickly prototyping and testing Python code as part of an automation pipeline.
Properties
| Name | Meaning |
|---|---|
| Code | The Python code snippet to execute. Users write their Python script here. For example, importing libraries, defining functions, and printing JSON results. |
| Requirements | A list of PyPI (Python Package Index) library dependencies your Python code requires. These are installed before running the code. Explicitly specifying these is recommended for accuracy. |
| Dependencies | System-level dependencies required by your Python code, installed via Alpine's package manager (apk). Useful for native libraries or system tools your Python packages depend on. |
Output
The node outputs the result of the executed Python code in the json field. Typically, this will be the JSON-parsed output printed by the Python script. If the Python code prints JSON-formatted data, it will be parsed and returned as structured JSON in the workflow.
If the Python code produces binary data, the node can handle it accordingly, but the primary focus is on JSON output from the executed script.
Dependencies
- Requires an API key credential to authenticate requests to the external service at
https://prod.0codekit.com. - The node sends the Python code and dependency information to this external API endpoint
/code/pythonvia POST request. - The environment must support installing specified PyPI packages and Alpine system packages as declared in the properties.
Troubleshooting
Common issues:
- Missing or incorrect Python dependencies may cause runtime errors. Always specify all required PyPI packages explicitly.
- System dependencies not declared might lead to failures if native libraries are missing.
- Syntax errors or exceptions in the Python code will cause the node to fail.
- Network or authentication issues with the external API service can prevent code execution.
Error messages:
- Errors related to package installation usually indicate missing or misspelled package names in Requirements or Dependencies.
- Python runtime errors will reflect the exception message from the executed script.
- Authentication errors suggest invalid or missing API credentials.
Resolution tips:
- Double-check and explicitly list all Python and system dependencies.
- Validate Python code syntax before running.
- Ensure API credentials are correctly configured in n8n.
- Review error details returned by the node for specific Python exceptions.
Links and References
- PyPI - The Python Package Index
- Alpine Linux apk package manager
- 0CodeKit Documentation (if available) (Note: link inferred from baseURL, verify actual docs)