> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftd.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Notebook Concepts

SPIN notebooks extend the familiar Jupyter model with specialized cell types and operational features for troubleshooting and automation. Understanding these concepts will help you create effective operational runbooks.

## Notebook Fundamentals

### Notebook Structure

A SPIN notebook consists of:

* **Sequential cells**: Executed independently or as a workflow
* **Session state**: Persists variables and context across cell executions
* **Output history**: Captures results for collaboration and audit
* **Metadata**: Defines notebook purpose, ownership, and configuration

### Cell Execution Model

Unlike scripts, notebook cells can be:

* **Executed individually** for testing and development
* **Run out of order** for non-linear troubleshooting
* **Re-executed** to refresh data or retry failures
* **Chained together** with shared variables and state
* **Linked** to automatically run when the previous cell completes (see [Linked Cells](#linked-cells))

## Cell Types

SPIN supports multiple cell types for different tasks:

* [Markdown Cells](./markdown-cells)
* [Python Cells](./python-cells)
* [Shell Cells](./shell-cells)
* [REST Cells](./rest-cells)
* [LLM Cells](./llm-cells)
* [Form Cells](./form-cells)

There are also cells for specific integrations:

* [Datadog](../../integrations/datadog)
* [Splunk](../../integrations/splunk)
* [Grafana](../../integrations/grafana)
* [Jenkins](../../integrations/jenkins)
* [Kubernetes](../../integrations/k8s)
* [Prometheus](../../integrations/p8s)
* [GitHub](../../integrations/github)

## Linked Cells

Linked cells allow you to chain cell executions together automatically. When a cell is linked to its previous cell, it will automatically run when the previous cell completes successfully.

### How Linking Works

* **Automatic execution**: When a linked cell's predecessor finishes running successfully, the linked cell starts automatically
* **Chain reactions**: Multiple linked cells in sequence create an execution chain—each cell triggers the next upon successful completion
* **Error stops the chain**: If a cell fails, subsequent linked cells will not auto-run

### Linking and Unlinking Cells

To link a cell to the previous cell:

1. Click the dropdown menu (⋮) at the top right corner of the cell you want to link
2. Select **Link to previous cell**

To unlink a cell:

1. Click the dropdown menu (⋮) on the linked cell
2. Select **Unlink from previous cell**

<Note>
  Markdown cells cannot be linked to other cells. Linking is only available for executable cell types (Python, Shell, REST, etc.).
</Note>

<Note>
  Cells can be linked to a form cell above it, but form cells cannot be explicit linked previous cells because form cells are always automatically refreshed whenever any previous cell is run.
</Note>

### Visual Indicator

Linked cells display a link icon (🔗) between them, making it easy to identify execution chains in your notebook. The run button also shows a link icon instead of the play button for linked cells.

### Movement Restrictions

Linked cells cannot be moved up or down in the notebook. To reposition a linked cell, you must first unlink it. This ensures that execution chains remain intact and prevents accidental ordering changes that could break workflow dependencies.

### Output Variables

Cells can store results in named variables for use by later cells:

* Variables persist throughout the session
* Shared across all cell types
* Complex data structures (DataFrames, JSON) are preserved
* Variables can be cleared or reset

### Form Inputs (Template Variables)

Enable dynamic notebook behavior using [form cells](./form-cells).

## Output and Results

SPIN provides specialized rendering for operational data:

* **Data Tables**
* **Time Series Charts**
* **JSON Trees**

as well as standard Jupyter outputs:

* **Images**
* **HTML**
* **Markdown**
* **Text**
