Python Notebook
Execute a multi-cell Python notebook in an Isolated Sandbox with rich table and chart outputs.
About this Node
Executes a version-pinned multi-cell Jupyter notebook (.ipynb) top-to-bottom inside an Isolated Sandbox with access to workflow state via `inputs`, staged `FileRef` attachments in `INPUTS_DIR`, and file outputs in `OUTPUTS_DIR`. Structured results assigned to `outputs` are written under `output_key`, and a fully rendered executed notebook report (`notebook.executed.ipynb`) with tables, plots, and cell timings is persisted automatically for Run History inspection.
Ports & Branches
inPort 0Inbound execution flowoutPort 1Outbound execution flow with notebook outputs and executed report artifactHow this Node Reads Data
| Input | Access | Field | Example | Description |
|---|---|---|---|---|
| Sandbox `inputs` Dictionary | Python Context | input_key |
records = inputs["input"]; threshold = inputs.get("min_score", 0.8) |
Receives `inputs["input"]` mapped from `input_key` along with all other non-internal scoped state keys. Any `FileRef` objects are automatically staged on disk under `INPUTS_DIR`. |
State Keys Written (Outputs)
| Key Pattern | Type | Role | Description |
|---|---|---|---|
{output_key} |
object | any |
Primary | Clean serialized contents assigned to the notebook's `outputs` dictionary (default key `notebook_result`), plus `_files` `FileRef` handles for files saved to `OUTPUTS_DIR`. |
Tips & Best Practices
- Pin a notebook version in Project Storage so scheduled and triggered runs stay reproducible.
- Use Shift+Enter, Ctrl+Enter, and Alt+Enter in Notebook Studio to test cells iteratively before saving a new version.
- Every automated run persists a read-only executed notebook report viewable in Run History.
Commonly Paired With
Settings Parameters (8)
Configuration schema synchronized with the workflow catalog
| Field | Type | Default | Allowed Options | Description |
|---|---|---|---|---|
notebook_uuid |
string |
— |
— | UUID of the versioned Python notebook (.ipynb) |
notebook_name |
string |
— |
— | Display name of the pinned Python notebook |
notebook_version |
string |
— |
— | Pinned version tag of the notebook (e.g. v1.0) |
notebook_scope |
string |
project |
project, workspace | Storage scope where the versioned notebook is stored |
input_key |
string |
input |
— | Optional workflow state key aliased to inputs['input'] inside the notebook |
output_key |
string |
notebook_result |
— | Workflow state key receiving values written to the notebook outputs dictionary |
timeout_seconds |
integer |
300 |
— | Maximum total execution time across all notebook cells in seconds (5 to 1800) |
runtime_environment |
string |
builtin:datascience-cpu |
— | Runtime environment profile for isolated notebook execution |
Quarterly Revenue Cohort Analysis
Run a multi-cell notebook that aggregates a staged Parquet dataset, renders summary charts, and outputs headline KPIs for downstream reporting.
Node Configuration
{
"Id": "action_notebook_1",
"Type": "action_notebook",
"Config": {
"notebook_uuid": "nb-quarterly-revenue",
"notebook_name": "Quarterly Revenue Analysis",
"notebook_version": "v1.0",
"notebook_scope": "project",
"input_key": "dataset_files",
"output_key": "revenue_summary",
"timeout_seconds": 300,
"runtime_environment": "builtin:datascience-cpu"
}
}Sample Input State
{
"dataset_files": { "type": "file_ref", "filename": "orders_q4.parquet" }
}Expected Output State
{
"revenue_summary": { "total_revenue": 1284500, "top_region": "NA" }
}Tip: Inspect the rendered tables and plots from any historical run in Run History or Storage → Runs.
Feature Cleaning & Anomaly Scoring
Clean inbound API records across modular Markdown-documented cells and pass scored rows to a downstream Dataset Write node.
Node Configuration
{
"Id": "action_notebook_1",
"Type": "action_notebook",
"Config": {
"notebook_uuid": "nb-anomaly-scoring",
"notebook_name": "Anomaly Scoring",
"notebook_version": "v2.1",
"notebook_scope": "workspace",
"input_key": "raw_events",
"output_key": "scored_events",
"timeout_seconds": 600,
"runtime_environment": "builtin:datascience-cpu"
}
}Sample Input State
{
"raw_events": [ { "id": "E-1", "latency_ms": 812 } ]
}Expected Output State
{
"scored_events": [ { "id": "E-1", "anomaly_score": 0.94 } ]
}