Skip to main content
Base Node Node inspector for a Run Code node

Parameters

Returned Variables
array
default:"['var1', 'var2']"
required
List of variable names to return from the executed code.
Source Code
string
required
Python code that computes the variables listed in Returned Variables. The default value for this parameter is:
Default code block
var1 = 42
var2 = "Hello, World!"
You can access upstream node outputs by node ID. For example:
Accessing upstream node outputs
agent_output = Agent.output
var1 = len(agent_output)
var2 = f"Agent said: {agent_output}"
In the above example, Agent is the ID of an upstream node with an output port.

Inputs

Input
any
Optional input available to the script.

Outputs

Output
json
Object containing the variables specified in Returned Variables as keys.