or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-2/

Notebook Workflow Runner

Build a module that programmatically creates, executes, and saves a notebook from structured steps using a chosen kernel.

Capabilities

Builds notebook from steps

  • Given ordered steps mixing markdown and code, creates a new notebook saved to outputPath with matching cell types and sources, bound to the specified kernel name; returns the saved path. @test

Executes code cells sequentially

  • Runs code cells in order with the selected kernel, waiting for each execution to finish before moving on, while leaving markdown cells unexecuted. @test

Collects outputs and errors

  • Captures stdout/stderr or display text for each code cell execution; when execution fails, records the error name and message and stops unless allowErrors is true. @test

Persists executed notebook

  • Saves the notebook with execution results and metadata to outputPath, returning an outcome summary listing each cell index, type, status, and outputs. @test

Implementation

@generates

API

export type NotebookCellType = 'code' | 'markdown';

export interface NotebookStep {
  type: NotebookCellType;
  source: string;
}

export interface CellOutcome {
  index: number;
  type: NotebookCellType;
  status: 'ok' | 'error';
  outputs: string[];
  error?: { name: string; message: string };
}

export interface NotebookRunOptions {
  kernelName: string;
  steps: NotebookStep[];
  cwd?: string;
  outputPath: string;
  allowErrors?: boolean;
}

export interface NotebookRunResult {
  path: string;
  outcomes: CellOutcome[];
}

export async function runNotebookWorkflow(options: NotebookRunOptions): Promise<NotebookRunResult>;

Dependencies { .dependencies }

@jupyterlab/notebook { .dependency }

Notebook document creation and cell operations.

@jupyterlab/services { .dependency }

Kernel sessions and execution requests.