# How Zerve Works

## Execution modes:

### Canvas Level:

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

#### **Run All:**

This mode runs all the block from left to right starting from the first unfinished block. (Refer the image above for more info)

#### Force Run All:

This mode will rerun all the blocks from the  first block irrespective of it's run status and replace data outputs. (Refer the image above for more info)

### Block Level:

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

#### Run this block:

Runs the particular block. This is active only if the block is not run or if there is a code change

#### Run up to here:

Runs all the blocks up to this particular block including the selected block.

#### Run from here:

Runs all the blocks after this particular block including the selected block.

#### Force run this block:

Force executes the block regardless of code state or block state.

#### Force run up to here:

Force executes all the blocks up to the particular block regardless of current state.

#### Force run from here:

Force executes all the blocks from the particular block regardless of current state.

## How code blocks manage data:

Zerve is designed to be serverless and to abstract compute from storage. Once the code execution is done the data - all the variables, functions, dataframes, charts etc are cached, serialized and stored on disk (s3 in this case). This is then passed on to the next block as input for futher code execution.&#x20;

This stored data is separated from the compute and won't be affected by code execution in downstream blocks. &#x20;

## Block states:

### When is a block's data replaced?

When the block execution has been successfully completed.  It is inheriting an integer and a dataframe from upstream, and its code creates an additional integer and makes some changes to the dataframe.  If the user makes changes to the code in the block and re-runs it, the following are the various scenarios on what data will be passed downstream.

#### **Scenario 1: Code changed and run, resulting in an error.**

* Old data remains unless explicitly modified or deleted.

#### **Scenario 2: Code changed but not run.**

* Old data remains unaffected. &#x20;

#### **Scenario 3: Code changed and run, still running.**

* Old data remains unless explicitly modified or deleted.&#x20;

#### **Scenario 4: Code changed, run, and completes successfully.**

* Old data may or may not be replaced by new results, depending on the code's design.&#x20;


---

# 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://docs.zerve.ai/guide/notebook-view/how-zerve-works.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.
