0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

The 0-CodeKit node, specifically for the Resource Code and Operation Python, allows users to execute custom Python code within an n8n workflow. This is useful for scenarios where you need to perform data transformations, calculations, or any logic that is best expressed in Python, directly from your automation pipeline.

Common use cases:

  • Data manipulation or cleaning using Python libraries.
  • Custom calculations not available in standard n8n nodes.
  • Integrating with external systems or APIs via Python scripts.
  • Prototyping and testing Python code snippets as part of a workflow.

Example:
You have incoming JSON data and want to apply a complex transformation using Python before passing it to the next step in your workflow.


Properties

Name Meaning
Code Your python code. The Python script you wish to execute. This is a required multi-line string input.

Output

  • The output will be a JSON object containing the result of the executed Python code.
  • The exact structure of the output depends on what your Python code returns or prints.
  • If there is an error during execution and "Continue On Fail" is enabled, the output will include an error field with the error message.

Example output (success):

[
  {
    "result": 42
  }
]

Example output (error, if continue on fail is enabled):

[
  {
    "error": "SyntaxError: invalid syntax"
  }
]

Dependencies

  • External Service: Requires valid credentials for codeKitApi.
  • n8n Configuration: Ensure the codeKitApi credential is set up in your n8n instance.
  • Environment: The backend service must support Python code execution.

Troubleshooting

Common Issues:

  • Invalid Python Syntax: If your code contains syntax errors, the node will return an error message.
  • Missing Credentials: If codeKitApi credentials are not configured, the node will fail to execute.
  • Execution Timeouts: Long-running Python scripts may time out depending on backend limits.

Common Error Messages:

  • "SyntaxError: ..." – Check your Python code for typos or syntax issues.
  • "Authentication failed" – Ensure your codeKitApi credentials are correct and active.
  • "Timeout exceeded" – Optimize your Python code for faster execution.

How to resolve:

  • Double-check your Python code for correctness.
  • Verify that the required credentials are properly set up in n8n.
  • For large or slow scripts, try optimizing your code or splitting tasks into smaller steps.

Links and References

Discussion