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 → Javascript
AI-generatedOverview
The node provides a "Code" resource with a "Javascript" operation that allows users to execute custom JavaScript code snippets within an n8n workflow. This is useful for scenarios where you want to perform data transformations, calculations, or any custom logic that is not covered by existing nodes. For example, you could manipulate input data arrays, call utility libraries, or implement complex conditional logic directly in the workflow.
Properties
| Name | Meaning |
|---|---|
| Code | The JavaScript code snippet to be executed. It can include any valid JS code and return data. |
| Dependencies | A list of system dependencies (package names) required by the code, which will be installed using the Alpine package manager. |
Output
The output contains a json field with the result of the executed JavaScript code. The structure of this JSON depends entirely on what the user returns from their code snippet. For example, if the code returns { data: [...] }, then the output JSON will have a data property with the corresponding value.
If the code produces binary data, it would typically be handled separately, but this node focuses on executing JavaScript and returning JSON results.
Dependencies
- The node requires an API key credential to authenticate requests to the external service at
https://prod.0codekit.com. - System dependencies specified by the user are installed via the Alpine package manager (
apk) before running the code. - No other explicit external services are required beyond the configured API key and the 0CodeKit platform.
Troubleshooting
- Common issues:
- Syntax errors in the provided JavaScript code will cause execution failures.
- Missing or incorrect dependency names may lead to runtime errors if the code relies on unavailable packages.
- Network or authentication errors if the API key is invalid or missing.
- Error messages:
- Errors related to code execution usually indicate syntax or runtime exceptions in the user-provided script.
- Dependency installation failures might occur if the specified package names are invalid or not available in Alpine repositories.
- Resolutions:
- Validate and test JavaScript code independently before using it in the node.
- Ensure all required dependencies are correctly named and supported by Alpine.
- Verify that the API key credential is properly configured and has necessary permissions.
Links and References
- Alpine Package Manager (apk) documentation
- JavaScript language reference
- 0CodeKit platform (general info) (Note: URL from source, no direct docs linked)