Skip to main content
Actions

Python Script

action_python

Run custom Python script inside an Isolated Sandbox.

Inputs1
Outputs1
Settings2
Field AccessPython Context
Examples2

About this Node

Executes a versioned Python script inside an Isolated Sandbox with read access to workflow inputs and mounted `FileRef` objects. The script reads values from the `inputs` dictionary (with `inputs["input"]` mapped from `input_key` plus every other non-internal scoped state key) and assigns results into `outputs`, which are written back to workflow state under `output_key`.

Ports & Branches

Inputs (1)
inPort 0Inbound execution flow
Outputs (1)
outPort 1Outbound execution flow with script result

How this Node Reads Data

Input Access Field Example Description
Sandbox `inputs` Dictionary Python Context — payload = inputs["input"]; tier = inputs.get("customer_tier") Receives `inputs["input"]` from `input_key` along with all other non-internal scoped state keys. Any `FileRef` values are automatically staged on disk inside the sandbox.

State Keys Written (Outputs)

Key Pattern Type Role Description
{output_key} object | any Primary Clean serialized contents written to the script's `outputs` dictionary (default key `python_result`), including any newly produced `FileRef` artifacts.

Tips & Best Practices

  • Scripts are version-pinned in Project Storage so production runs remain reproducible.
  • Keep scripts deterministic and bounded by `timeout_seconds` (default 300s).

Commonly Paired With