Inputs: Define the arguments that you want your function to have. Example input could be named ‘location’.
Function Body: This is the body of the function that you want to run. You can write a Python or JavaScript function here that will execute when the node runs. You can access the ‘Inputs’ through their names within your function. Outputs can be set in this function and will be accessible through Gumloop outputs.
Outputs: Define the outputs that you want your function to have. An example output could be ‘temperature’. This is the name of the outputs of your function which will be returned as values accessible through Gumloop outputs.
For a complete list of available packages, please refer to our requirements.txt.To import a Python package, simply use the standard import statement within your function body. For example:
Copy
Ask AI
def function(): import pandas as pd import numpy as np # Your code return
The output of this node will vary based on the user-defined function’s returns. Outputs are defined by the user and can consist of any data type or structure the function is capable of returning.
This node is incredibly versatile and can be used whenever there’s a need to run arbitrary Python or JavaScript code within a flow. It allows for flexible inputs and outputs, meaning it can be adapted to perform a wide range of tasks that require custom code execution. This could be anything from data manipulation, calling external APIs, complex calculations, or conditionally handling information based on inputs provided to the node.It’s especially useful in scenarios where existing nodes do not meet your requirements, and you need a quick, customizable solution that doesn’t require developing a new node from scratch. Use this node to embed Python or JavaScript scripts that extend the functionality of your flows, making them more powerful and tailored to your specific needs.