0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

This node executes asynchronous Python scripts in a complex and flexible manner within the "Code" resource of the 0CodeKit toolbox. It allows users to run Python code that can include import statements and does not require explicitly returning a result variable. Instead, output is generated via print statements, which are parsed asynchronously by a webhook URL specified by the user.

Common scenarios where this node is beneficial include:

  • Running advanced or long-running Python scripts that need to execute asynchronously.
  • Executing Python code with external dependencies (libraries) specified dynamically.
  • Integrating Python script results into workflows by sending outputs to a webhook for further processing.
  • Automating data processing, scraping, or any custom logic that requires Python's ecosystem.

Practical example:

  • A user writes a Python script that scrapes data from a website using requests and BeautifulSoup, specifies these as requirements, and sets a webhook URL to receive the processed JSON data asynchronously once the script finishes.

Properties

Name Meaning
Code The Python code string to be executed asynchronously. Must include all necessary import statements. Output should be printed in the code to be captured by the webhook.
Requirements List of Python package dependencies required by the script, e.g., ['selenium', 'requests', 'numpy']. These packages will be installed before execution.
Send To The webhook URL where the execution result will be sent after the script finishes. This URL receives the printed output from the Python script asynchronously.
Code Variables Optional variables defined in the code editor that can be passed into the script at runtime. Users can select variable names or IDs and provide their values to customize script execution dynamically.

Output

The node outputs a JSON array containing the response(s) from the asynchronous Python script execution request. Since the execution is asynchronous, the immediate output typically confirms the submission or status of the job rather than the final script result.

The actual script output is sent separately to the specified webhook URL as JSON data parsed from the script's printed output.

No binary data is directly output by this node; all communication is handled via JSON and webhooks.

Dependencies

  • Requires an active API key credential for the 0CodeKit service to authenticate requests.
  • The Python environment on the remote execution endpoint must support installing specified dependencies dynamically.
  • The user must provide a reachable webhook URL to receive asynchronous execution results.
  • Network connectivity to the 0CodeKit API and the webhook endpoint is essential.

Troubleshooting

  • Common issues:

    • Incorrect or unreachable webhook URL: The node submits the job but no results arrive. Verify the webhook URL is correct and publicly accessible.
    • Missing or misspelled dependencies in the Requirements list may cause script failures.
    • Syntax errors or runtime exceptions in the provided Python code will cause execution failure.
    • Forgetting to use print statements in the Python code means no output is sent to the webhook.
  • Error messages:

    • Errors returned from the API usually indicate invalid parameters or authentication issues. Check API credentials and parameter correctness.
    • Script execution errors will appear in the webhook payload if the script prints error information.
    • If the node throws an error about missing required properties, ensure all mandatory fields like Code and Send To are filled.

Links and References


This summary focuses exclusively on the "Code" resource and the "ASYNC Python Script Advanced (Complex Script)" operation as requested.

Discussion