Saltar al contenido principal

Python Code Execution Toolkit

The Python Code Execution Toolkit is a workflow node. Its tools include Execute Python, Search Knowledge Base Files, Upload File To Sandbox, and List Sandbox Files, plus 2 more listed below. These tools run in the workflow and do not use a third-party account. Type @ in a field when the value should come from an earlier step.

Authentication​

Python Code Execution tools do not use a connected third-party account. Add the node to the workflow and set the fields on the tool.

Tools​

Execute Python​

Runs the execute python tool.

FieldRequiredDescription
CodeYesPython code to execute in the sandbox. Type @ to select a variable.
Entry PointNoDeprecated and ignored; invoke functions explicitly in the provided code. Default is main. Type @ to select a variable.
ArgsNoPositional arguments. Default is [].
KwargsNoKeyword arguments. Default is \{\}.
DependenciesNoOptional PyPI package specifications to install before this code runs, for example ['pandas==2.2.3', 'python-pptx', 'pypdf']. Every third-party import must be declared here; do not run pip from the code itself. At most 10 simple package/version specifications are allowed. Default is [].
TimeoutNoSandbox timeout in seconds (defaults to 300). Default is null.

Search Knowledge Base Files​

Searches knowledge base files.

FieldRequiredDescription
QueryYesSearch query to find files in knowledge base. Type @ to select a variable.

Upload File To Sandbox​

Uploads file to sandbox.

FieldRequiredDescription
File PathYesUse trigger.file, trigger.files, or comma-separated KB document IDs for multi-file uploads (e.g. uuid1/a.csv, uuid2/b.csv).
Target PathNoTarget path in sandbox (optional, only used for single file). Default is null. Type @ to select a variable.
TimeoutNoSandbox timeout in seconds (defaults to 300). Default is null.

List Sandbox Files​

Lists sandbox files.

FieldRequiredDescription
TimeoutNoSandbox timeout in seconds (defaults to 300). Default is null.

Create Download URL​

Creates download url.

FieldRequiredDescription
File PathYesPath to file in sandbox to create download URL for. Type @ to select a variable.
TimeoutNoSandbox timeout in seconds (defaults to 300). Default is null.

Render Chart​

Runs the render chart tool.

FieldRequiredDescription
Chart TypeYesChart type. One of: bar, stacked_bar, horizontal_bar, line, area, pie, donut, scatter, radar, composed, funnel, treemap, radial_bar, waterfall. Type @ to select a variable.
TitleYesChart title displayed above the chart. Type @ to select a variable.
DataYesArray of data objects. Each object is a row with key-value pairs. Example: [{'quarter': 'Q1', 'revenue': 120000, 'cost': 80000}].
Category KeyYesThe key in each data object to use as the x-axis / category grouping (e.g. 'quarter', 'department'). Type @ to select a variable.
Value KeysYesList of keys in data objects to plot as series/values (e.g. ['revenue', 'cost']). For pie charts, use a single key.
X Axis LabelNoOptional label for x-axis. Default is ``. Type @ to select a variable.
Y Axis LabelNoOptional label for y-axis. Default is ``. Type @ to select a variable.
Include TableNoWhen true, also render a data table alongside the chart, showing the same category_key/value_keys rows the chart was built from. Use this when the user asked to see the underlying numbers (e.g. 'chart it and show me the table') instead of calling a separate table tool. Default is false.

Agents can use this integration from chat. See Python Code Execution.

See all integrations on the toolkits overview.