0.9.23 or greater.
In addition to the global runtime variables that can be used by any block in a pipeline, there are also variables scoped at the block-level, meaning they are accessible in a specific block but not other blocks in the same pipeline. Block variables are not accessible by other pipelines that use the same block.
Using block variables
Block variables can be accessed via the
kwargs parameter in your block function.
The variables are stored in a block’s configuration, which is accessible through
def export_data(*args, **kwargs):
demo_block_var = kwargs['configuration'].get('demo_block_var')
Supported block types
Block variables are currently only supported for Python blocks with the following block types:
Creating block variables
In Mage UI
You can create new block variables from the Mage UI through the “Block settings” tab in the Sidekick of the Pipeline Editor page. The block settings can also be quickly accessed by clicking the settings icon in a block’s header.
In the “Block variables” section of the block settings, click the
+ New button, enter
the variable’s name and value in the input fields and then press
your keyboard while still focused on one of the input fields (this step can be repeated
This will add the variable(s), but not save it. You need to also click the blue
Update block settings button below the “Block variables” section in order to save
and persist these new variables. You can also edit/delete existing block variables by
hovering over a variable and clicking the edit/trash icons. You can press the
key to exit a variable’s edit mode.
You can also create or edit block variables by going to a pipeline’s
(located in the
pipelines/[pipeline_uuid] directory) and adding them to a block’s
- all_upstream_blocks_executed: true
name: billowing snow