Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Blocks

The types of block you can use in a project, and what you can do with them.

A block is a single step in a project, such as a piece of Python or a SQL query. Blocks are connected: each one can use the results of the blocks before it.

Block types

Block
What it's for
Notebook
Canvas

Python code

Yes

Yes

Querying a data connection, or a dataframe from another block

Yes

Yes

R code

Yes

Yes

Notes and documentation

Yes

Yes

Sending a prompt to an AI model

Yes

Yes

Building a simple app from your project

Yes

Yes

Collecting the results of a Fleet

Yes

Yes

Running the next blocks only when a condition is met

No

Yes

R code with narrative, published as a report. Being retired.

No

Yes

The canvas view also has API Controller, API Route and SageMaker endpoint blocks, for building deployments. See APIs.

Adding a block

To
Windows
Mac

Add a block connected to the active block

Alt + N

⌥ + N

Choose the type of the new block first

Shift + Alt + N

⇧ + ⌥ + N

Running blocks

Each block's run menu offers:

Option
What it does

Run this block

Runs the block. If it has already run and nothing has changed, its saved results are used.

Run up to here

Runs every block before this one, then this one

Run from here

Runs this block, then every block after it

Force run (each of the above)

Runs again even if the saved results are up to date

While a block is running, the same button stops it. See Keyboard shortcuts for the shortcut for each option.

Other block options

The block toolbar includes:

Option
Details

Compute settings

Choose the compute the block runs on. See Compute types.

Comments

Discuss the block with your team. See Collaboration and comments.

Lint code

Tidy a Python block's code

Split block

Split a Python or R block into two, at the cursor

Copy block link

Copy a link to the block

Clear output

Remove the block's saved output

Lock block

Stop the block from being changed or run. See Block-level security.

Code & Variables mode

See the block's inputs, outputs and variables in full. See Variables, outputs and caching.

Delete

Remove the block

Last updated

Was this helpful?