# Pipeline Steps Tracking and Visualization

The pipeline generates a **trace file**, typically named **`trace.json`**, inside the configured output folder. This is the same folder where subfolders for each executed step are created. The trace file contains a complete record of all steps executed in the pipeline, including branches, steps, parameters, and outputs.

***

### Visualization Functions

We have functions to visualize the execution of the pipeline: `trace()` and `info()`.

For example, here we create a pipeline with the main branch named **branch 1** and run the following steps:

```
pipeline = CIPipe(pipeline_input, branch_name="branch 1", file_system=my_file_system)
pipeline.preprocess_videos().bandpass_filter_videos().normalize_dff_videos()
```

#### The visualization functions will be:

#### `trace()`

Displays all steps executed in the current branch, including their names, parameters, and outputs.

```python
pipeline.trace()
```

<figure><img src="/files/bhgnsaWOPQZ7jc6TiN3m" alt=""><figcaption></figcaption></figure>

#### `info(step_number`

Shows detailed information for a specific step in the current branch, including inputs, outputs, and parameters used.

```
pipeline.info(2)
```

<figure><img src="/files/tCr0iMxSpROYuxbqkIzN" alt=""><figcaption></figcaption></figure>

***

#### Interpreting `trace.json`

The `trace.json` file is generated in the output folder and has the following structure:

```
{
  "pipeline": {
    "inputs": { ... },
    "defaults": { ... },
    "outputs_directory": "path/to/output"
  },
  "main": [
    {
      "index": 1,
      "name": "preprocess_videos",
      "params": { "isx_pp_temporal_downsample_factor": 1, ... },
      "outputs": { "videos-isxd": [ ... ] }
    },
    {
      "index": 2,
      "name": "bandpass_filter_videos",
      "params": { "isx_bp_low_cutoff": 0.005, ... },
      "outputs": { "videos-isxd": [ ... ] }
    }
  ],
  "Secondary Branch": [
    {
      "index": 1,
      "name": "preprocess_videos",
      "params": { "isx_pp_temporal_downsample_factor": 1, ... },
      "outputs": { "videos-isxd": [ ... ] }
    }
  ]
}
```

* Each **branch** contains a list of executed steps.
* Each **step** includes:
  * `index`: the order of the step within the branch
  * `name`: the executed function name
  * `params`: dictionary of parameters used
  * `outputs`: dictionary of outputs produced

This structure allows you to easily inspect which steps were executed, with which parameters, and what outputs were produced for each step, both in the main branch and any derived branches.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cipipe.gitbook.io/cipipe-docs/creating-a-pipeline/pipeline-steps-tracking-and-visualization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
